All the available data about the major public transportation providers of Portugal from GTFS (General Transit Feed Specification) to a rest API.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
The project will not work without the following prerequisites:
Optional
- Postman - The api only accepts post requests, postman is a good tool to test api's.
Install with
npm install
Start the development server
npm run dev
Important
By default, importing data is disabled by the env variable SKIP_IMPORT=true
.
On your very first run, you may want to remove this variable, in order to get some data.
Try it out
Go to http://localhost:3000 to check that the app is running.
Open Postman and send an empty POST to http://localhost:3000/api/v1/agencies
to get all the available providers.
Build a production ready package with
npm run build
And start the production package with
npm start
- Comboios de Portugal - agency_key: 'cp'
- Metro de Lisboa - agency_key: 'metro-lisboa'
- Carris - agency_key: 'carris'
- Fertagus- agency_key: 'fertagus'
- Soflusa - agency_key: 'soflusa'
- Sulfertagus - agency_key: 'sulfertagus'
- Transtejo - agency_key: 'transtejo'
- Rodoviรกria de Lisboa - agency_key: 'rodoviaria-de-lisboa'
- Transportes Sul do Tejo - agency_key: 'tst'
- STCP - Sociedade de Transportes Colectivos do Porto - agency_key: 'stcp'
- Metro do Porto - agency_key: 'metro-porto'
Querying for an agency POST /agencies
// Get one agency by agency key
fetch('http://localhost:3000/api/v1/agencies', {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
query: { agency_key: 'metro-lisboa' }
})
})
.then(res => res.json())
.then(resp => console.log(resp))
// Will log details about the agency.
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
We use SemVer for versioning. For the versions available, see the tags on this repository.
This project is licensed under the MIT License - see the LICENSE.md file for details