{"id":15655249,"url":"https://github.com/mpolden/atb","last_synced_at":"2025-05-02T17:11:19.836Z","repository":{"id":27897479,"uuid":"31389105","full_name":"mpolden/atb","owner":"mpolden","description":"Sane API for bus data in Trondheim, Norway","archived":false,"fork":false,"pushed_at":"2023-04-14T19:16:19.000Z","size":104,"stargazers_count":28,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-01T15:06:53.980Z","etag":null,"topics":["api","atb","bus-data","bus-schedule","go"],"latest_commit_sha":null,"homepage":"https://mpolden.no/atb/","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mpolden.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-02-26T21:13:00.000Z","updated_at":"2025-02-23T17:26:56.000Z","dependencies_parsed_at":"2024-06-19T05:22:01.259Z","dependency_job_id":null,"html_url":"https://github.com/mpolden/atb","commit_stats":null,"previous_names":["mpolden/atbapi"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpolden%2Fatb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpolden%2Fatb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpolden%2Fatb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpolden%2Fatb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mpolden","download_url":"https://codeload.github.com/mpolden/atb/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251895480,"owners_count":21661345,"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":["api","atb","bus-data","bus-schedule","go"],"created_at":"2024-10-03T12:57:22.549Z","updated_at":"2025-05-01T15:07:10.183Z","avatar_url":"https://github.com/mpolden.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# atb\n\n![Build Status](https://github.com/mpolden/atb/workflows/ci/badge.svg)\n\nA minimal API for bus data in Trondheim, Norway. This API proxies requests to\nEntur APIs and converts the responses into a sane JSON format.\n\nResponses from the proxied APIs are cached. By default bus stops will be cached\nfor 1 week and departures for 1 minute.\n\nAs of mid-August 2021 the SOAP-based AtB API no longer returns any departure\ndata. According to [this blog post on open\ndata](https://beta.atb.no/blogg/apne-data-og-atb) it appears the preferred API\nis now [Entur](https://developer.entur.org/). The `/api/v1/` paths have\ntherefore been removed.\n\nVersion 2 has been implemented and proxies requests to Entur instead. These are\nthe changes in version 2:\n\n* There is no version 2 variant of `/api/v1/busstops`. Use\n  https://stoppested.entur.org/ to find valid stop IDs.\n* Entur uses different stop IDs so old ones, such as `16011376`, cannot be used\n  in version 2. A stop includes departures in both directions by default so\n  there is no longer a unique stop for each direction.\n* The `registeredDepartureTime` field may be omitted.\n* The `isGoingTowardsCentrum` field has moved to the departure object.\n\nThis API aims to be compatible with\n[BusBuddy](https://github.com/norrs/busbuddy) (which appears to be defunct).\n\n## Usage\n\n```\n$ atb -h\nUsage of atb:\n  -d string\n    \tDeparture cache duration (default \"1m\")\n  -l string\n    \tListen address (default \":8080\")\n  -s string\n    \tBus stop cache duration (default \"168h\")\n  -x\tAllow requests from other domains\n```\n\n## API\n\n### `/`\n\nLists all available API routes.\n\nExample:\n\n```\n$ curl https://mpolden.no/atb/ | jq .\n{\n  \"urls\": [\n    \"https://mpolden.no/atb/v2/departures\"\n  ]\n}\n```\n\n### `/api/v2/departures`\n\nList departures from the given bus stop, identified by a stop ID. Use\nhttps://stoppested.entur.org to find stop IDs, for example `41613` (the number\npart of `NSR:StopPlace:41613`) for Prinsens gate.\n\nDepartures traveling in any direction are included by default. Add the parameter\n`direction=inbound` or `direction=outbound` to filter departures towards, or\naway from, the city centre.\n\nNote that the claimed direction is questionable in some cases so inspect the\nresponses to decide whether `inbound` or `outbound` makes sense for your use\ncase.\n\n```\n$ curl 'https://mpolden.no/atb/v2/departures/41613?direction=inbound' | jq .\n\n{\n  \"url\": \"https://mpolden.no/atb/v2/departures/41613\",\n  \"departures\": [\n    {\n      \"line\": \"71\",\n      \"scheduledDepartureTime\": \"2021-08-11T23:49:38.000\",\n      \"destination\": \"Dora\",\n      \"isRealtimeData\": true,\n      \"isGoingTowardsCentrum\": true\n    },\n    ...\n  ]\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmpolden%2Fatb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmpolden%2Fatb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmpolden%2Fatb/lists"}