{"id":20418336,"url":"https://github.com/katsutedev/onemta","last_synced_at":"2025-08-13T03:07:12.517Z","repository":{"id":37320494,"uuid":"430957277","full_name":"KatsuteDev/OneMTA","owner":"KatsuteDev","description":"The MTA Bus and Subway APIs all in one Java library","archived":false,"fork":false,"pushed_at":"2025-07-22T00:16:42.000Z","size":45371,"stargazers_count":12,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-22T02:35:50.399Z","etag":null,"topics":["bus","bus-arrival","bus-locations","bus-route","bus-schedule","bus-stop","bus-time","bus-tracking","java","lib","library","lirr","mta","nyct","onemta","rest-api","subway","subway-time","train-schedule","transit"],"latest_commit_sha":null,"homepage":"https://katsute.dev/product/onemta","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/KatsuteDev.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"custom":["katsute.dev"]}},"created_at":"2021-11-23T04:23:53.000Z","updated_at":"2025-07-22T00:16:44.000Z","dependencies_parsed_at":"2025-04-12T17:35:44.167Z","dependency_job_id":"f18bf31e-483d-464a-a192-cc80654e1b0c","html_url":"https://github.com/KatsuteDev/OneMTA","commit_stats":null,"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"purl":"pkg:github/KatsuteDev/OneMTA","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KatsuteDev%2FOneMTA","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KatsuteDev%2FOneMTA/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KatsuteDev%2FOneMTA/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KatsuteDev%2FOneMTA/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KatsuteDev","download_url":"https://codeload.github.com/KatsuteDev/OneMTA/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KatsuteDev%2FOneMTA/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270172594,"owners_count":24539389,"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","status":"online","status_checked_at":"2025-08-13T02:00:09.904Z","response_time":66,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["bus","bus-arrival","bus-locations","bus-route","bus-schedule","bus-stop","bus-time","bus-tracking","java","lib","library","lirr","mta","nyct","onemta","rest-api","subway","subway-time","train-schedule","transit"],"created_at":"2024-11-15T06:31:40.229Z","updated_at":"2025-08-13T03:07:12.453Z","avatar_url":"https://github.com/KatsuteDev.png","language":"Java","funding_links":["katsute.dev"],"categories":[],"sub_categories":[],"readme":"\u003cdiv id=\"top\" align=\"center\"\u003e\n    \u003ca href=\"https://github.com/KatsuteDev/OneMTA\"\u003e\n        \u003cimg src=\"https://raw.githubusercontent.com/KatsuteDev/OneMTA/main/assets/icon.png\" alt=\"icon\" width=\"100\" height=\"100\"\u003e\n    \u003c/a\u003e\n    \u003ch3\u003eOneMTA\u003c/h3\u003e\n    \u003ch5\u003eJava wrapper for the MTA Bus and Subway API\u003c/h5\u003e\n    \u003cdiv\u003e\n        \u003ca href=\"https://docs.katsute.dev/onemta\"\u003eDocumentation\u003c/a\u003e\n        •\n        \u003ca href=\"https://new.mta.info/developers\"\u003eMTA Developer Resources\u003c/a\u003e\n        •\n        \u003ca href=\"https://groups.google.com/g/mtadeveloperresources\"\u003eMTA Google Group\u003c/a\u003e\n    \u003cbr\u003e\n        \u003ca href=\"https://mvnrepository.com/artifact/dev.katsute/onemta\"\u003eMaven Central\u003c/a\u003e\n        •\n        \u003ca href=\"https://github.com/KatsuteDev/OneMTA/packages/1221214\"\u003eGitHub Packages\u003c/a\u003e\n        •\n        \u003ca href=\"https://github.com/KatsuteDev/OneMTA/releases\"\u003eReleases\u003c/a\u003e\n    \u003c/div\u003e\n\u003c/div\u003e\n\n\u003cbr\u003e\n\n\u003e ⚠️ The MTA API [Terms and Conditions](https://new.mta.info/developers/terms-and-conditions) prohibits developers from giving users direct access to MTA servers.\n\u003e Any realtime data that is retrieved in this library **must be served to users on your own servers.**\n\nOneMTA is a Java wrapper for the [MTA SIRI REST API](https://bustime.mta.info/wiki/Developers/SIRIIntro) and [MTA Realtime GTFS API](https://api.mta.info/).\n\n## Installation\n\nOneMTA requires at least Java 8.\n\nOneMTA also requires the [protobuf-java](https://mvnrepository.com/artifact/com.google.protobuf/protobuf-java) library to be installed. Make sure you are using the same version as specified in the [pom.xml](https://github.com/KatsuteDev/OneMTA/blob/main/pom.xml) file.\n\nCompiled binaries can be installed from:\n\n * [Maven Central](https://mvnrepository.com/artifact/dev.katsute/onemta)\n * [GitHub Packages](https://github.com/KatsuteDev/OneMTA/packages/1221214)\n * [Releases](https://github.com/KatsuteDev/OneMTA/releases)\n\n#### Authentication\n\n 1. Request a bus token at \u003chttps://bt.mta.info/wiki/Developers/Index\u003e.\n 2. OneMTA requires static data from the MTA for most route and stop information.\n    Latest static data for the MTA is available at \u003chttps://new.mta.info/developers\u003e.\n\n    Static data is only required for the endpoints you are using. All boroughs are required for buses, including bus company.\n\n    [![static datafeeds](https://raw.githubusercontent.com/KatsuteDev/OneMTA/main/assets/static-gtfs-data.png)](https://new.mta.info/developers)\n 3. Initialize OneMTA\n    ```java\n    MTA mta = MTA.create(\n        busToken,\n        DataResource.create(DataResourceType.Bus_Bronx, new File(\"google_transit_bronx.zip\")),\n        DataResource.create(DataResourceType.Bus_Brooklyn, new File(\"google_transit_brooklyn.zip\")),\n        DataResource.create(DataResourceType.Bus_Manhattan, new File(\"google_transit_manhattan.zip\")),\n        DataResource.create(DataResourceType.Bus_Queens, new File(\"google_transit_queens.zip\")),\n        DataResource.create(DataResourceType.Bus_StatenIsland, new File(\"google_transit_staten_island.zip\")),\n        DataResource.create(DataResourceType.Bus_Company, new File(\"google_transit_bus_company.zip\")),\n        DataResource.create(DataResourceType.Subway, new File(\"google_transit_subway.zip\")),\n        DataResource.create(DataResourceType.LongIslandRailroad, new File(\"google_transit_lirr.zip\")),\n        DataResource.create(DataResourceType.MetroNorthRailroad, new File(\"google_transit_mnr.zip\"))\n    );\n    ```\n\n\u003cdiv align=\"right\"\u003e\u003ca href=\"#top\"\u003e\u003ccode\u003e▲\u003c/code\u003e\u003c/a\u003e\u003c/div\u003e\n\n## Features\n\n#### Routes\n\nRetrieve routes along with alerts and vehicles on the route.\n\n```java\nBus.Route M1    = mta.getBusRoute(\"M1\", DataResourceType.Bus_Manhattan);\nSubway.Route SI = mta.getSubwayRoute(\"SI\");\nLIRR.Route PW   = mta.getLIRRRoute(9);\nMNR.Route HM    = mta.getMNRRoute(2);\n```\n\n#### Stops\n\nRetrieve stops with alerts and vehicles en route.\n\n```java\nBus.Stop stop   = mta.getBusStop(400561);\nSubway.Stop GCT = mta.getSubwayStop(\"631\");\nLIRR.Stop FLS   = mta.getLIRRStop(\"FLS\");\nMNR.Stop WLN    = mta.getMNRStop(\"1WN\");\n```\n\n#### Vehicles\n\nRetrieve live vehicle information from stops and routes.\n\n```java\nBus.Vehicle[] bus       = stop.getVehicles();\nSubway.Vehicle[] subway = SI.getVehicles();\nLIRR.Vehicle[] lirr     = PW.getVehicles();\nMNR.Vehicle[] mnr       = WLN.getVehicles();\n```\n\n#### Alerts\n\nRetrieve alerts for all stops and routes.\n\n```java\nBus.Alert[] busAlerts       = mta.getBusAlerts();\nSubway.Alert[] subwayAlerts = SI.getAlerts();\nLIRR.Alert[] lirrAlerts     = FLS.getAlerts();\nMNR.Alert[] mnrAlerts       = mta.getMNRAlerts();\n```\n\n\u003cdiv align=\"right\"\u003e\u003ca href=\"#top\"\u003e\u003ccode\u003e▲\u003c/code\u003e\u003c/a\u003e\u003c/div\u003e\n\n##  Contributing\n\nSample response data available on the [`reference`](https://github.com/KatsuteDev/OneMTA/tree/reference) branch.\n\n#### Updating Protobuf Files\n\n 1. Run `install.sh`\n\n    or\n\n    Install [protobuf](https://github.com/protocolbuffers/protobuf/releases) and [gtfs realtime proto](https://github.com/OneBusAway/onebusaway-gtfs-realtime-api/tree/master/src/main/proto/com/google/transit/realtime) manually\n 2. Run `protobuf.sh`\n\n#### Notice About Tests\n\n - Tests are most reliable around rush hour.\n - Tests may not work during overnight hours.\n - Route tests may not work if the selected routes are out of service.\n - Stop tests may not work it the selected stops are out of service.\n - Alert tests may not work if no alerts are active.\n\n#### Running Tests Locally\n\nFor local tests you can use Java 8+, however only methods in the Java 8 API may be used. The `src/main/java9` folder should not be marked as a source root.\n\n - You must run `install.sh` to initialize test resources.\n - (Bus) Run tests locally by adding a text file named `bus.txt` that contains the bus token in the `src/test/java/resources` directory.\n\n#### Running Tests using GitHub Actions\n\nDevelopers running remote tests through GitHub Actions may do so by running the `MTA CI` workflow manually in the actions tab of your fork. Note that this requires a single secret, a `BUS_TOKEN` which contains the bus token.\n\n\u003cdiv align=\"right\"\u003e\u003ca href=\"#top\"\u003e\u003ccode\u003e▲\u003c/code\u003e\u003c/a\u003e\u003c/div\u003e\n\n## \u0026nbsp;\n\nThis library is released under the [GNU General Public License (GPL) v2.0](https://github.com/KatsuteDev/OneMTA/blob/main/LICENSE).\n\n * [@Katsute](https://github.com/Katsute) and [@KatsuteDev](https://github.com/KatsuteDev) are not affiliated with the MTA.\n * By using the MTA API you are subject to their [Terms and Conditions](https://new.mta.info/developers/terms-and-conditions).\n\n   \u003e In developing your app, you will provide that the MTA data feed is available to others only from a non-MTA server. Accordingly, you will download and store the MTA data feed on a non-MTA server which users of your App will access in order to obtain data. MTA prohibits the development of an app that would make the data available to others directly from MTA's server(s).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkatsutedev%2Fonemta","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkatsutedev%2Fonemta","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkatsutedev%2Fonemta/lists"}