STCP API
Unofficial API to retrieve STCP information for public transit buses in Porto, Portugal.
Retrieves static data about routes, stops, locations, and real-time estimates of bus arrivals.
Since it's based on a non-official API, it may stop working in the future. Confirmed working as of 1 December 2025.
See the files at stcp/routes.py, stcp/stops.py and stcp/util.py for the complete documentation, and examples.md for usage examples.
Available operations
Routes
| Function | Description |
|---|---|
| get_routes | list of all STCP routes. |
| get_route_directions | list of directions (usually 2) of a route. |
| get_route_stops | list of all stops of a route in a direction. |
| get_route_services | the service days of a route. |
| get_route_schedule | schedule of a route in a direction. |
| get_route_real_time | all buses running on a given route and their next stop. |
Stops
| Function | Description |
|---|---|
| get_stops | list of all stops. |
| get_stop_data | data about a stop and its routes |
| get_stop_schedule | schedule of stop |
| get_stop_real_time | real-time list of buses passing through a stop soon (up to one hour from the current time). |
Utilities
| Function | Description |
|---|---|
| get_route_data | combines route_directions, route_stops in all directions, and route_services . |
| get_stop_route_departures | gets a map of upcoming departures of a stop, grouped by route. |
| get_full_route_times | gets the current times for a given route. |
Metadata
Release files for stcp-api 2.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| stcp_api-2.0.3.tar.gz | 43.1 kB | Without provenance | Details for stcp_api-2.0.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| stcp_api-2.0.3-py3-none-any.whl | Python 3 | none | any | Details for stcp_api-2.0.3-py3-none-any.whl |
Total release size: 74.7 kB
Release files / stcp_api-2.0.3.tar.gz
| Download URL | stcp_api-2.0.3.tar.gz |
|---|---|
| Size | 43.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c8a01b8aa1788008abcec63c33bd07d43c9a879a55a02135e3ec93e3765ef19d
|
|
BLAKE2b-256 checksum How to use checksums |
d3d7625ed4afffa963e1fd4de9c74c97f9ea3246091d1200eedc8183fd4f37bb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.0
|
Release files / stcp_api-2.0.3-py3-none-any.whl
| Download URL | stcp_api-2.0.3-py3-none-any.whl |
|---|---|
| Size | 31.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
07728d9fbf053b7e36161e8578db0bca7c33d25187b4d8e7b7a36d73ca3099a7
|
|
BLAKE2b-256 checksum How to use checksums |
c1683fc99a7a455106595ca87a116a95fe16be31b89af9ba970d4cd51d5ebdae
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.0
|
Security for stcp-api 2.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.