{"id":28503597,"url":"https://github.com/cheeaun/sgbusdata","last_synced_at":"2025-07-05T14:30:40.600Z","repository":{"id":39296855,"uuid":"354002008","full_name":"cheeaun/sgbusdata","owner":"cheeaun","description":"Singapore Bus data","archived":false,"fork":false,"pushed_at":"2025-07-01T01:06:41.000Z","size":31410,"stargazers_count":40,"open_issues_count":0,"forks_count":11,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-07-01T02:23:33.895Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://data.busrouter.sg/v1/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cheeaun.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"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,"zenodo":null},"funding":{"github":"cheeaun","buy_me_a_coffee":"cheeaun","patreon":"cheeaun","custom":["https://revolut.me/cheeaun","https://donate.stripe.com/9AQeVfbr40ZB9nGaEF","https://paypal.me/cheeaun"]}},"created_at":"2021-04-02T11:43:24.000Z","updated_at":"2025-07-01T01:06:48.000Z","dependencies_parsed_at":"2023-02-15T14:45:43.500Z","dependency_job_id":"2aedc6c5-9de4-4995-b88c-fae21f39d9da","html_url":"https://github.com/cheeaun/sgbusdata","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cheeaun/sgbusdata","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cheeaun%2Fsgbusdata","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cheeaun%2Fsgbusdata/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cheeaun%2Fsgbusdata/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cheeaun%2Fsgbusdata/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cheeaun","download_url":"https://codeload.github.com/cheeaun/sgbusdata/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cheeaun%2Fsgbusdata/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263755412,"owners_count":23506393,"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":[],"created_at":"2025-06-08T17:30:40.451Z","updated_at":"2025-07-05T14:30:40.594Z","avatar_url":"https://github.com/cheeaun.png","language":"JavaScript","funding_links":["https://github.com/sponsors/cheeaun","https://buymeacoffee.com/cheeaun","https://patreon.com/cheeaun","https://revolut.me/cheeaun","https://donate.stripe.com/9AQeVfbr40ZB9nGaEF","https://paypal.me/cheeaun"],"categories":[],"sub_categories":[],"readme":"# SG Bus Data\n\n\u003e Singapore Bus data\n\nThis is a data-only repository to complement [BusRouter SG](https://github.com/cheeaun/busrouter-sg/).\n\n## The data\n\nIt's in the `/data` folder.\n\nOr, browse through them on the data server: https://data.busrouter.sg/\n\n## Terminologies\n\n- **Stop** - the bus stop itself\n- **Service** - the bus service, with numbers like `133` or `1N`\n- **Route** - the route of a bus service, the lines connecting all the stops\n- **Pattern** - the patterns of a bus route, _one_ of the lines connecting the stops\n  - If the route is one-way (A-\u003eB), there's only one pattern\n  - If the route is two-way (A-\u003eB, B-\u003eA), there're two patterns in a route\n  - Each pattern usually pass through different stops, as they're usually on opposite sides of the road.\n\n## Scripts\n\n### `npm run cleanup`\n\nDelete files in `data/v1/raw/services/*`, `data/v1/patch/*.cm.json` and `data/v1/patch/*.om.json`, _before_ running the commands below.\n\n### `npm run fetch`\n\n- `fetch-bus-stops` - Fetch all bus stops from https://www.lta.gov.sg/map/busService/bus_stops.xml\n- `fetch-bus-services` - Fetch bus services from https://www.lta.gov.sg/map/busService/bus_services.xml\n- `fetch-bus-services-route` - Fetch all the XMLs and KMLs e.g.: https://www.lta.gov.sg/map/busService/bus_route_xml/10.xml, https://www.lta.gov.sg/map/busService/bus_route_kml/10-1.kml and https://www.lta.gov.sg/map/busService/bus_route_kml/10-2.kml.\n\n### `npm run datamall`\n\n\u003e ⚠️ This requires `DatamallAccountKey` environment variable. Make a copy of `example.env` file, rename to `.env` and put in your [Datamall](https://datamall.lta.gov.sg/) [API key](https://datamall.lta.gov.sg/content/datamall/en/request-for-api.html).\n\n- `fetch-bus-stops-datamall` - Fetch all bus stops from http://datamall2.mytransport.sg/ltaodataservice/BusStops\n- `fetch-bus-routes-datamall` - Fetch all bus routes from http://datamall2.mytransport.sg/ltaodataservice/BusRoutes\n\n### `npm run patch`\n\n- `patch-missing-routes` - Patch missing routes (failed requests from `fetch-bus-services-route`) by getting fresh route data from [OneMap](https://www.onemap.gov.sg/)/[Citymapper](https://citymapper.com/).\n- `patch-multiline-routes` - Patch multi-line routes (routes that has more than one line, we only need one line here, per pattern) by getting fresh route data from OneMap (again).\n- `patch-bus-stop-names` - Patch bus stop names (some of them are all-uppercase instead of titlecase) by double-checking them on https://www.transitlink.com.sg/eservice/eguide/bscode_idx.php\n\n### `npm run generate`\n\n- `generate-data` - Generate all the _final_ clean data\n- `generate-data-firstlast` - Generate the first/last timing data\n\n### `npm run build`\n\nRun all `npm` commands above.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcheeaun%2Fsgbusdata","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcheeaun%2Fsgbusdata","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcheeaun%2Fsgbusdata/lists"}