Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/yageek/tpggo

:bus: API for TPG
https://github.com/yageek/tpggo

api golang opendata tpg

Last synced: about 2 months ago
JSON representation

:bus: API for TPG

Awesome Lists containing this project

README

        

# tpggo

An http client for the TPG Open Data.

For more explanation: [TPG Open Data](http://www.tpg.ch/fr/web/open-data/mode-d-emploi)

## Installation

```shell
go get github.com/gophersch/tpggo
```

## Usage

```go
package main

import (
"fmt"

"github.com/gophersch/tpggo"
)

const (
apiKey = "MY_KEY"
)

func main() {

client := tpggo.NewClient(apiKey)

// Get all the stops
if resp, err := client.GetStops(); err != nil {
panic(err)
} else {
for _, stop := range resp.Stops {
fmt.Printf("Stop Name: %s | Code: %s \n", stop.Code, stop.Name)
}
}
}
```