A lightweight, Express-based TypeScript API for working with GTFS (General Transit Feed Specification) data.
Developed by Kaizen Kaku Co., Ltd.
GTFS-Node provides an easy way to upload and access GTFS data through a RESTful API. Perfect for transit application developers, urban planners, and anyone working with public transportation data.
The API supports all standard GTFS files, including agencies, stops, routes, trips, stop times, transfers, shapes, and calendars.
- 🚄 Simple API for accessing GTFS data components
- 📁 Support for multiple datasets within a single instance
- 🗂️ File Upload API for organizing GTFS data
- 🧩 TypeScript support with complete type definitions
- 🔍 MTA Subway data included as an example
- Node.js (v14+)
- pnpm
- Clone the repository:
git clone https://github.com/yourusername/gtfs-node.git
cd gtfs-node- Install dependencies:
pnpm install- Start the development server:
pnpm devFor production use:
pnpm startThe server will start on port 3000 by default (configurable via the PORT environment variable).
Place your GTFS .txt files in the data/xxx, where 'xxx' is your GTFS data.
The repository includes MTA Subway GTFS data as an example, located in the data/mta directory.
All data endpoints accept a ?dataset= query parameter to specify which dataset to use.
POST /upload
Upload GTFS files to create or update a dataset.
GET /api/agencies # Get all agencies
GET /api/stops # Get all stops
GET /api/routes # Get all routes
GET /api/trips # Get all trips
GET /api/stop-times # Get all stop times
GET /api/transfers # Get all transfers
GET /api/shapes # Get all shapes
GET /api/calendar # Get calendar data
# Get all stops from the MTA Subway dataset
curl http://localhost:3000/api/stops?dataset=mtaGTFS data is organized in the following structure:
data/
├── mta/ # MTA Subway example
│ ├── agency.txt
│ ├── stops.txt
│ └── ...
└── custom-dataset/ # Your custom datasets
├── agency.txt
├── stops.txt
└── ...
Contributions are welcome! Please feel free to submit a Pull Request. Check out the Issues tab to find ways to contribute.
This project is licensed under the MIT License - see the LICENSE file for details.
Copyright (c) 2025 Kaizen Kaku Co., Ltd.