A simple Node JS Wrapper to interact with the NYC MTA transit system's API using TypeScript. Get information about busses such as distance from a stop, passengers, ID, and more!
To obtain a MTA API Key/Token please click here!
import MTAClient from "ny-mta-api";
const client = new MTAClient("YOUR_MTA_TOKEN");
Or with JavaScript
const MTAClient = require('ny-mta-api').default;
const Client = new MTAClient("YOUR_TOKEN");
async function getStop(id:Number) {
console.log(await client.getStop(id))
};
getStop(202650);
We are not affiliated, associated, authorized, endorsed by, or in any way officially connected with the MTA, or any of its subsidiaries or its affiliates. The official MTA website can be found at https://new.mta.info/.