{"id":33936406,"url":"https://github.com/catenarytransit/amtrak-gtfs-rt","last_synced_at":"2026-04-09T03:31:57.163Z","repository":{"id":215915552,"uuid":"739583131","full_name":"catenarytransit/amtrak-gtfs-rt","owner":"catenarytransit","description":null,"archived":false,"fork":false,"pushed_at":"2026-04-08T00:37:21.000Z","size":231,"stargazers_count":9,"open_issues_count":5,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-08T02:26:58.745Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","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/catenarytransit.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"open_collective":"catenarymaps"}},"created_at":"2024-01-05T23:25:48.000Z","updated_at":"2026-04-08T00:37:25.000Z","dependencies_parsed_at":"2024-08-11T06:34:00.759Z","dependency_job_id":"f57fac41-a513-4017-9190-04105159379d","html_url":"https://github.com/catenarytransit/amtrak-gtfs-rt","commit_stats":null,"previous_names":["catenarytransit/amtrak-gtfs-rt"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/catenarytransit/amtrak-gtfs-rt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/catenarytransit%2Famtrak-gtfs-rt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/catenarytransit%2Famtrak-gtfs-rt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/catenarytransit%2Famtrak-gtfs-rt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/catenarytransit%2Famtrak-gtfs-rt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/catenarytransit","download_url":"https://codeload.github.com/catenarytransit/amtrak-gtfs-rt/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/catenarytransit%2Famtrak-gtfs-rt/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31584569,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"online","status_checked_at":"2026-04-09T02:00:06.848Z","response_time":112,"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":[],"created_at":"2025-12-12T14:14:42.166Z","updated_at":"2026-04-09T03:31:57.157Z","avatar_url":"https://github.com/catenarytransit.png","language":"Rust","funding_links":["https://opencollective.com/catenarymaps"],"categories":[],"sub_categories":[],"readme":"# amtrak-gtfs-rt\nDecrypts Amtrak's GTFS-RT\n\nA valid Amtrak GTFS structure must be passed into the function to work.\n\nHere's an example of some working code!\n\nThe latest version of prost should be used along with the `gtfs-realtime` crate library.\n\n```rust \nextern crate amtrak_gtfs_rt;\n\nuse prost::Message;\nuse gtfs_structures::Gtfs;\n\n#[tokio::main]\nasync fn main() {\n    let gtfs = Gtfs::from_url_async(\"https://content.amtrak.com/content/gtfs/GTFS.zip\")\n    .await\n    .unwrap();\n\n    let client = reqwest::Client::new();\n    loop {\n        let amtrak_gtfs_rt = amtrak_gtfs_rt::fetch_amtrak_gtfs_rt(\u0026gtfs, \u0026client).await.unwrap();\n\n        //extract the binary data\n        let vehicle_data = amtrak_gtfs_rt.vehicle_positions.encode_to_vec();\n        let trip_data = amtrak_gtfs_rt.trip_updates.encode_to_vec();\n\n        std::thread::sleep(std::time::Duration::from_millis(500));\n    }\n}\n```\n\nThis software package decrypts the Amtrak track-a-train json data and performs lookups of trip information in the GTFS schedule to match each vehicle with it's route_id and trip_id.\n\nPull requests are welcome!\n\n## Capital Corridor Exception\nNote that the Metropolitan Transportation Commission also publishes Capital Corridor in their own feed.\nhttps://511.org/open-data/transit provides Capital Corridor as \"CC\". This data refreshes more often (and is closer in location \u0026 time), and shows locomotive numbers.\nFor this reason, you may wish to remove Capital Corridor from this feed.\nThus, we've included a function `filter_capital_corridor()` which takes in any `gtfs_rt::FeedMessage` and removes CC vehicles and trips.\n\n## San Joaquins update 2025 Feb\n\nAmtrak no longer publishes San Joaquins together with all the other GTFS feeds. However, the trip ids are the same as the train number and the route ID is `GR`, and thus, this realtime feed is intended to work with both GTFS files.\n\n\n### Test functions for amtrak alerts\n`cargo test --package amtrak-gtfs-rt --lib -- amtrak_alerts::tests::test_generate_alerts_feed_real --nocapture`","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcatenarytransit%2Famtrak-gtfs-rt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcatenarytransit%2Famtrak-gtfs-rt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcatenarytransit%2Famtrak-gtfs-rt/lists"}