Skip to content

liderman/yandex-rasp-api

Repository files navigation

yandex-rasp-api

Golang implementation Yandex Rasp Api v3.0 - https://tech.yandex.ru/rasp/doc/concepts/about-docpage/.

Build Status GoDoc

Installation

go get github.com/liderman/yandex-rasp-api

Usage

Getting a schedule of flights between stations:

    yapi := NewYandexRapsApi("YOUR_APIKEY")
    reps, _ := yapi.Search(map[string]string{
        "from":  "c146",
        "to":    "c213",
        "lang":  "ru_RU",
        "page":  "1",
        "date":  "2017-05-18",
        "limit": "2",
    })
    fmt.Println(reps);

Getting information about the nearest town to the specified point:

    yapi := NewYandexRapsApi("YOUR_APIKEY")
    reps, err := yapi.NearestSettlement(map[string]string{
        "lat":      "50.440046",
        "lng":      "40.4882367",
        "distance": "50",
        "lang":     "ru_RU",
    })
    fmt.Println(reps);

More examples can be found in the test files.

Features

  • Full support api version 3.0
  • Code is covered by tests
  • Without external dependencies

Requirements

  • Need at least go1.2 or newer.

Documentation

You can read package documentation here. Official docs: here

Testing

Unit-tests:

go test -v