Golang client for DaData.ru
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
vendor
.benchpackages
.gitignore
.gogenerate
.testpackages
.travis.yml
LICENSE
Makefile
README.md
balance.go
balance_test.go
clean.go
clean_test.go
constants.go
dadata.go
dadata_http_client_test.go
dadata_test.go
examples_test.go
find_by_id.go
find_by_id_test.go
geoip.go
geoip_test.go
geoip_types.go
interfaces.go
model.go
stat.go
stat_test.go
suggest.go
suggest_test.go
suggest_types.go

README.md

Client for DaData.ru

GoDoc Go Report Card Coverage Status Build Status

DaData API v2

Implemented Clean and Suggest methods.

Installation

go get gopkg.in/webdeskltd/dadata.v2

Usage

package main

import (
	"fmt"

	"gopkg.in/webdeskltd/dadata.v2"
)

func main() {
	daData := dadata.NewDaData("PUT_YOUR_API_KEY", "PUT_YOUR_SECRET_KEY")

	banks, err := daData.SuggestBanks(dadata.SuggestRequestParams{Query: "Кредитный", Count: 3})
	if nil != err {
		fmt.Println(err)
	}

	for _, bank := range banks {
		fmt.Println(bank.Data.Name.Full)
		fmt.Println(bank.Data.Bic)
	}

	// Output:
	// "МОСКОВСКИЙ КРЕДИТНЫЙ БАНК" (ПУБЛИЧНОЕ АКЦИОНЕРНОЕ ОБЩЕСТВО)
	// 044525659
	// КОММЕРЧЕСКИЙ БАНК "РЕСПУБЛИКАНСКИЙ КРЕДИТНЫЙ АЛЬЯНС" (ОБЩЕСТВО С ОГРАНИЧЕННОЙ ОТВЕТСТВЕННОСТЬЮ)
	// 044525860
	// ЖИЛИЩНО-КРЕДИТНЫЙ КОММЕРЧЕСКИЙ БАНК "ЖИЛКРЕДИТ" ОБЩЕСТВО С ОГРАНИЧЕННОЙ ОТВЕТСТВЕННОСТЬЮ
	// 044525325
}

more examples in examples_test.go

Licence

MIT see LICENSE