https://github.com/juliuste/comboios
Comboios de Portugal (CP, Portugese Railways) API client.
https://github.com/juliuste/comboios
library public-transport railway
Last synced: 10 months ago
JSON representation
Comboios de Portugal (CP, Portugese Railways) API client.
- Host: GitHub
- URL: https://github.com/juliuste/comboios
- Owner: juliuste
- License: isc
- Archived: true
- Created: 2017-11-04T14:18:49.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2020-10-12T16:10:47.000Z (over 5 years ago)
- Last Synced: 2025-04-06T19:36:58.409Z (10 months ago)
- Topics: library, public-transport, railway
- Language: JavaScript
- Size: 153 KB
- Stars: 50
- Watchers: 6
- Forks: 9
- Open Issues: 2
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# comboios
JavaScript client for the Portugese 🇵🇹 [Comboios de Portugal (CP)](https://www.cp.pt/) railway API. Complies with the friendly public transport format. Inofficial, using *CP* endpoints. Ask them for permission before using this module in production.
[](https://www.npmjs.com/package/comboios)
[](https://travis-ci.org/juliuste/comboios)
[](license)
## Installation
```shell
npm install comboios
```
## Usage
```javascript
const comboios = require('comboios')
```
This package contains data in the [*Friendly Public Transport Format*](https://github.com/public-transport/friendly-public-transport-format).
- [`stations()`](docs/stations.md) - to get a list of operated stations such as `Lisboa - Oriente` or `Viana do Castelo`
- [`journeys(origin, destination, opt)`](docs/journeys.md) - to get routes between stations
- [`stopovers(station, opt)`](docs/stopovers.md) - to get departures and arrivals at a given station
- [`trip(id)`](docs/trip.md) - to get all stopovers for a given trip (train)
## See also
- [build-cp-gtfs](https://github.com/juliuste/build-cp-gtfs) - Generate CP GTFS using this module
- [european-transport-operators](https://github.com/public-transport/european-transport-operators) - List of european long-distance transport operators, available API endpoints, GTFS feeds and client modules.
## Contributing
If you found a bug or want to propose a feature, feel free to visit [the issues page](https://github.com/juliuste/comboios/issues).