https://github.com/yageek/tpggo
:bus: API for TPG
https://github.com/yageek/tpggo
api golang opendata tpg
Last synced: about 1 month ago
JSON representation
:bus: API for TPG
- Host: GitHub
- URL: https://github.com/yageek/tpggo
- Owner: yageek
- License: mit
- Created: 2018-12-13T19:23:43.000Z (over 7 years ago)
- Default Branch: develop
- Last Pushed: 2019-02-19T15:44:19.000Z (over 7 years ago)
- Last Synced: 2026-03-12T07:40:39.742Z (3 months ago)
- Topics: api, golang, opendata, tpg
- Language: Go
- Homepage:
- Size: 5.86 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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)
}
}
}
```