Skip to content

Unofficial async API for the STCP (Serviço de Transportes Coletivos do Porto), the city's public transportation system.

License

Notifications You must be signed in to change notification settings

ruitcatarino/stcp-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

STCP API

License: MIT

Overview

The STCP API is an unofficial API for the STCP, offering access to real-time departure times. It is designed to work with HTTP queries made by the SMSBus application since STCP does not provide a free access API for real-time departure monitoring.

Current Endpoints

/stops/<paragem>

  • Method: GET
  • Example Request
  • Response:
    [
      ["200", "BOLHAO-", "apassar-"],
      ["207", "CAMPANHA-P", "15:08-1min"],
      ["204", "H.S.JOAO", "15:11-4min"],
      ["503", "BOAVISTAB.S", "15:12-5min"],
      ["200", "BOLHAO-", "15:18-11min"],
    ]

/docs

Interactive API docs

Installation

git clone https://github.com/ruitcatarino/stcp-api
cd stcp-api

Python

pip3 install -r requirements.txt
uvicorn main:app

Poetry

poetry run uvicorn main:app --reload

Docker

docker pull ruitcatarino/stcp-api
docker run -p 8000:8000 ruitcatarino/stcp-api

Docker from source

docker build -t stcp-api .
docker run -p 8000:8000 stcp-api

Built With

Contributing

Feel free to submit a pull request or an issue!

License

This project is open-source and available under the MIT License. You are free to use, modify, and distribute it in accordance with the license terms.

About

Unofficial async API for the STCP (Serviço de Transportes Coletivos do Porto), the city's public transportation system.

Resources

License

Stars

Watchers

Forks