/dadata

Golang client for DaData.ru

Primary LanguageGoMIT LicenseMIT

Client for DaData.ru

Forked from https://github.com/webdeskltd/dadata.

Build Status GitHub release Go Report Card GoDoc

DaData API v2

Implemented Clean and Suggest methods.

Installation

go get github.com/lyashm/dadata

Usage

import (
	"context"
	"fmt"

	"github.com/lyashm/dadata/v2"
	"github.com/lyashm/dadata/v2/api/suggest"
)

func DaDataExample()  {
	api := dadata.NewSuggestApi()

	params := suggest.RequestParams{
		Query: "ул Свободы",
	}

	suggestions, err := api.Address(context.Background(), &params)
	if err != nil {
		return
	}

	for _, s := range suggestions {
		fmt.Printf("%s", s.Value)
	}
}

Licence

MIT see LICENSE