{"id":13764042,"url":"https://github.com/sergioaugrod/go-sptrans","last_synced_at":"2025-04-22T21:30:26.972Z","repository":{"id":57496938,"uuid":"103075183","full_name":"sergioaugrod/go-sptrans","owner":"sergioaugrod","description":"Go client library for the SPTrans Olho Vivo API. :bus:","archived":false,"fork":false,"pushed_at":"2020-09-16T22:40:59.000Z","size":34,"stargazers_count":11,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-02T04:03:30.641Z","etag":null,"topics":["golang","sptrans"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sergioaugrod.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-09-11T01:21:28.000Z","updated_at":"2025-03-24T22:51:49.000Z","dependencies_parsed_at":"2022-09-03T23:50:32.891Z","dependency_job_id":null,"html_url":"https://github.com/sergioaugrod/go-sptrans","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sergioaugrod%2Fgo-sptrans","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sergioaugrod%2Fgo-sptrans/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sergioaugrod%2Fgo-sptrans/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sergioaugrod%2Fgo-sptrans/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sergioaugrod","download_url":"https://codeload.github.com/sergioaugrod/go-sptrans/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250328060,"owners_count":21412550,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["golang","sptrans"],"created_at":"2024-08-03T15:01:09.511Z","updated_at":"2025-04-22T21:30:26.688Z","avatar_url":"https://github.com/sergioaugrod.png","language":"Go","funding_links":[],"categories":["Third-party APIs","第三方api","第三方API`第三方API 汇总`","第三方API","\u003cspan id=\"第三方api-third-party-apis\"\u003e第三方API Third-party APIs\u003c/span\u003e","Utility"],"sub_categories":["Utility/Miscellaneous","Advanced Console UIs","HTTP Clients","实用程序/Miscellaneous","查询语","Fail injection","交流","\u003cspan id=\"高级控制台用户界面-advanced-console-uis\"\u003e高级控制台用户界面 Advanced Console UIs\u003c/span\u003e"],"readme":"# go-sptrans [![Build Status](https://travis-ci.org/sergioaugrod/go-sptrans.svg?branch=master)](https://travis-ci.org/sergioaugrod/go-sptrans) [![GoDoc](https://godoc.org/github.com/sergioaugrod/go-sptrans?status.png)](https://godoc.org/github.com/sergioaugrod/go-sptrans) [![Go Report Card](https://goreportcard.com/badge/github.com/sergioaugrod/go-sptrans)](https://goreportcard.com/report/github.com/sergioaugrod/go-sptrans) [![codecov](https://codecov.io/gh/sergioaugrod/go-sptrans/branch/master/graph/badge.svg)](https://codecov.io/gh/sergioaugrod/go-sptrans)\n\n**This project is no longer maintained.**\n\ngo-sptrans is a Go client library for the [SPTrans Olho Vivo API](http://www.sptrans.com.br/desenvolvedores/APIOlhoVivo.aspx).\n\n### Features\n\n- [x] Lines\n- [x] Stops\n- [x] Corridors\n- [x] Companies\n- [x] Vehicles Position\n- [x] Forecast\n\n## Documentation\n\nSee the documentation at [godoc](https://godoc.org/github.com/sergioaugrod/go-sptrans).\n\n## Install\n\ngo get github.com/sergioaugrod/go-sptrans/sptrans\n\n## Usage\n\n### Import\n\n```go\nimport \"github.com/sergioaugrod/go-sptrans/sptrans\"\n```\n\n### Authentication\n\n```go\ntoken = \"123456\"\nclient = sptrans.NewClient(token)\nclient.Authenticate()\n```\n\n### Endpoints\n\n#### Lines\n\n```go\n// Search by line description or number\nclient.Line.Search(\"Lapa\")\nclient.Line.Search(\"8000\")\n\n// Search by line direction\nclient.Line.SearchByDirection(\"Lapa\", 1)\n```\n\n#### Stops\n\n```go\n// Search by stop name or address\nclient.Stop.Search(\"Afonso\")\nclient.Stop.Search(\"Rua Baltharzar da Veiga\")\n\n// Search by line id\nclient.Stop.SearchByLine(1273)\n\n// Search by corridor id\nclient.Stop.SearchByCorridor(8)\n```\n\n#### Corridors\n\n```go\n// All corridors\nclient.Corridor.All()\n```\n\n#### Companies\n\n```go\n// All companies\nclient.Company.All()\n```\n\n#### Vehicles Position\n\n```go\n// All Vehicles Position\nclient.VehiclePosition.All()\n\n// Search by line id\nclient.VehiclePosition.SearchByLine(1273)\n\n// Search by company id\nclient.VehiclePosition.SearchByCompany(99)\n```\n\n#### Forecast\n\n```go\n// Search by stop id and line id\nclient.Forecast.Search(4200953, 2004)\n\n// Search by line id\nclient.Forecast.SearchByLine(1273)\n\n// Search by stop id\nclient.Forecast.SearchByStop(8)\n```\n\n## Contributing\n\n1. Clone it!\n2. Create your feature branch: `git checkout -b my-new-feature`\n3. Commit your changes: `git commit -am 'Add some feature'`\n4. Push to the branch: `git push origin my-new-feature`\n5. Submit a pull request :D\n\n## License\n\n[MIT License](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsergioaugrod%2Fgo-sptrans","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsergioaugrod%2Fgo-sptrans","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsergioaugrod%2Fgo-sptrans/lists"}