{"id":22903961,"url":"https://github.com/json2d/mta-bustime","last_synced_at":"2025-04-01T07:56:50.203Z","repository":{"id":57304624,"uuid":"94721255","full_name":"json2d/mta-bustime","owner":"json2d","description":"🚌 Node.js wrapper for MTA-BusTime REST API","archived":false,"fork":false,"pushed_at":"2017-06-22T02:55:37.000Z","size":265,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-03T14:44:42.690Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/json2d.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-06-19T00:29:08.000Z","updated_at":"2023-07-28T22:25:31.000Z","dependencies_parsed_at":"2022-08-27T02:15:50.268Z","dependency_job_id":null,"html_url":"https://github.com/json2d/mta-bustime","commit_stats":null,"previous_names":["bitstrider/mta-bustime"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/json2d%2Fmta-bustime","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/json2d%2Fmta-bustime/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/json2d%2Fmta-bustime/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/json2d%2Fmta-bustime/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/json2d","download_url":"https://codeload.github.com/json2d/mta-bustime/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246604619,"owners_count":20804100,"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":"2024-12-14T02:39:34.731Z","updated_at":"2025-04-01T07:56:50.176Z","avatar_url":"https://github.com/json2d.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mta-bustime\n\n🚌 Node.js wrapper for MTA-BusTime REST API\n\n## Installation\n\n```sh\nnpm install mta-bustime --save\n```\n\n## Usage\nFirst, create a `BusTime` object with your API key.\n```javascript\nconst BusTime = require('mta-bustime')\n\nvar bustime = new BusTime(API_KEY)\n```\n\nThen, use the wrapper functions to make requests to the API endpoints and retrieve the responses\n```javascript\n// OneBusAway API\nbustime.agenciesWithCoverage({/* options */},function(err,res,body) { /* do something with response */ })\nbustime.routesForAgency('MTA NYCT',{/* options */},function(err,res,body) { /* do something with response */ })\nbustime.stopsForRoute('MTA NYCT_B70',{includePolylines:false /* , more options */ },function(err,res,body) { /* do something with response */ })\n\n\nvar LineRef ='B70',\n  DirectionRef = 0,\n  MonitoringRef = 308194\n\n// SIRI API\nbustime.stopMonitoring({LineRef,DirectionRef,MonitoringRef},function(err,res,body) { /* do something with response */ })\n\n```\n\nFor more information on the API endpoints and available query options for each, see the references below:\nhttp://bustime.mta.info/wiki/Developers/OneBusAwayRESTfulAPI\nhttp://bustime.mta.info/wiki/Developers/SIRIStopMonitoring\n\n\n## Tests\nTo run tests on the wrapper functions, first you'll need to create the file `/test/config/.env` with your API key like this:\n\n```\nKEY=\u003cyour-API-key\u003e\n```\n\nThen run the script:\n\n```sh\nnpm test\n```\n\nResponses for test API requests are saved to `test/cache` for further inspection.\n\n## Dependencies\n\n- [request](https://github.com/request/request): Simplified HTTP request client.\n\n## Dev Dependencies\n\n- [tap](https://github.com/tapjs/node-tap): A Test-Anything-Protocol library\n- [dotenv](https://github.com/motdotla/dotenv): Loads environment variables from .env file\n\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjson2d%2Fmta-bustime","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjson2d%2Fmta-bustime","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjson2d%2Fmta-bustime/lists"}