Introduction
Welcome to the Transit Tracker API Documentation! The API is completely free, as long as it is used without excess. Transit Tracker data is free of charge, but it is mandatory to credit agency data when specified. Credits are registered in the v2/agencies
API, in the license
object.
Bienvenue à la documentation de l'API de Transit Tracker! L'API est complètement gratuite, tant qu'elle est utilisée sans excès. Les données de Transit Tracker sont libre de droit, mais il est obligatoire de créditer les données des agences lorsque spécifié. Les crédits sont inscrit dans l'API v2/agencies
, dans l'objet license
.
Authenticating requests
This API is not authenticated.
Agencies
GET v2/agencies
Example request:
curl --request GET \
--get "https://api.transittracker.ca/v2/agencies" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Accept-Language: en"
$client = new \GuzzleHttp\Client();
$url = 'https://api.transittracker.ca/v2/agencies';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Accept-Language' => 'en',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://api.transittracker.ca/v2/agencies'
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Accept-Language': 'en'
}
response = requests.request('GET', url, headers=headers)
response.json()
Example response (503):
Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
{
"message": "Service Unavailable"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GET v2/agencies/{agency_slug}
Example request:
curl --request GET \
--get "https://api.transittracker.ca/v2/agencies/stm" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Accept-Language: en"
$client = new \GuzzleHttp\Client();
$url = 'https://api.transittracker.ca/v2/agencies/stm';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Accept-Language' => 'en',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://api.transittracker.ca/v2/agencies/stm'
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Accept-Language': 'en'
}
response = requests.request('GET', url, headers=headers)
response.json()
Example response (503):
Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
{
"message": "Service Unavailable"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Alerts
GET v2/alerts
Example request:
curl --request GET \
--get "https://api.transittracker.ca/v2/alerts" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Accept-Language: en"
$client = new \GuzzleHttp\Client();
$url = 'https://api.transittracker.ca/v2/alerts';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Accept-Language' => 'en',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://api.transittracker.ca/v2/alerts'
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Accept-Language': 'en'
}
response = requests.request('GET', url, headers=headers)
response.json()
Example response (503):
Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
{
"message": "Service Unavailable"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GET v2/alerts/{alert_id}
Example request:
curl --request GET \
--get "https://api.transittracker.ca/v2/alerts/2" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Accept-Language: en"
$client = new \GuzzleHttp\Client();
$url = 'https://api.transittracker.ca/v2/alerts/2';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Accept-Language' => 'en',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://api.transittracker.ca/v2/alerts/2'
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Accept-Language': 'en'
}
response = requests.request('GET', url, headers=headers)
response.json()
Example response (503):
Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
{
"message": "Service Unavailable"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GET v2/regions/{region_slug}/alerts
Example request:
curl --request GET \
--get "https://api.transittracker.ca/v2/regions/mtl/alerts" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Accept-Language: en"
$client = new \GuzzleHttp\Client();
$url = 'https://api.transittracker.ca/v2/regions/mtl/alerts';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Accept-Language' => 'en',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://api.transittracker.ca/v2/regions/mtl/alerts'
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Accept-Language': 'en'
}
response = requests.request('GET', url, headers=headers)
response.json()
Example response (503):
Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
{
"message": "Service Unavailable"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Endpoints
GET v2/health
Example request:
curl --request GET \
--get "https://api.transittracker.ca/v2/health" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Accept-Language: en"
$client = new \GuzzleHttp\Client();
$url = 'https://api.transittracker.ca/v2/health';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Accept-Language' => 'en',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://api.transittracker.ca/v2/health'
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Accept-Language': 'en'
}
response = requests.request('GET', url, headers=headers)
response.json()
Example response (503):
Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
{
"message": "Service Unavailable"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GET v2/agencies/{agencySlug}/trips/{tripId}/blocks
Example request:
curl --request GET \
--get "https://api.transittracker.ca/v2/agencies/stm/trips/est/blocks" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Accept-Language: en"
$client = new \GuzzleHttp\Client();
$url = 'https://api.transittracker.ca/v2/agencies/stm/trips/est/blocks';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Accept-Language' => 'en',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://api.transittracker.ca/v2/agencies/stm/trips/est/blocks'
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Accept-Language': 'en'
}
response = requests.request('GET', url, headers=headers)
response.json()
Example response (503):
Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
{
"message": "Service Unavailable"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GET v2/agencies/{agencySlug}/shapes/{shapeId}
Example request:
curl --request GET \
--get "https://api.transittracker.ca/v2/agencies/stm/shapes/omnis" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Accept-Language: en"
$client = new \GuzzleHttp\Client();
$url = 'https://api.transittracker.ca/v2/agencies/stm/shapes/omnis';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Accept-Language' => 'en',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://api.transittracker.ca/v2/agencies/stm/shapes/omnis'
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Accept-Language': 'en'
}
response = requests.request('GET', url, headers=headers)
response.json()
Example response (503):
Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
{
"message": "Service Unavailable"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Landing
GeoJSON ressources used on the landing page
GET v2/landing
Example request:
curl --request GET \
--get "https://api.transittracker.ca/v2/landing" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Accept-Language: en"
$client = new \GuzzleHttp\Client();
$url = 'https://api.transittracker.ca/v2/landing';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Accept-Language' => 'en',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://api.transittracker.ca/v2/landing'
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Accept-Language': 'en'
}
response = requests.request('GET', url, headers=headers)
response.json()
Example response (503):
Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
{
"message": "Service Unavailable"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GET v2/landing/vehicles
Example request:
curl --request GET \
--get "https://api.transittracker.ca/v2/landing/vehicles" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Accept-Language: en"
$client = new \GuzzleHttp\Client();
$url = 'https://api.transittracker.ca/v2/landing/vehicles';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Accept-Language' => 'en',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://api.transittracker.ca/v2/landing/vehicles'
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Accept-Language': 'en'
}
response = requests.request('GET', url, headers=headers)
response.json()
Example response (503):
Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
{
"message": "Service Unavailable"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Link
GET v2/links
Example request:
curl --request GET \
--get "https://api.transittracker.ca/v2/links" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Accept-Language: en"
$client = new \GuzzleHttp\Client();
$url = 'https://api.transittracker.ca/v2/links';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Accept-Language' => 'en',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://api.transittracker.ca/v2/links'
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Accept-Language': 'en'
}
response = requests.request('GET', url, headers=headers)
response.json()
Example response (503):
Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
{
"message": "Service Unavailable"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GET v2/links/{link}
Example request:
curl --request GET \
--get "https://api.transittracker.ca/v2/links/dolor" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Accept-Language: en"
$client = new \GuzzleHttp\Client();
$url = 'https://api.transittracker.ca/v2/links/dolor';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Accept-Language' => 'en',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://api.transittracker.ca/v2/links/dolor'
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Accept-Language': 'en'
}
response = requests.request('GET', url, headers=headers)
response.json()
Example response (503):
Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
{
"message": "Service Unavailable"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Regions
GET v2/regions
Example request:
curl --request GET \
--get "https://api.transittracker.ca/v2/regions" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Accept-Language: en"
$client = new \GuzzleHttp\Client();
$url = 'https://api.transittracker.ca/v2/regions';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Accept-Language' => 'en',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://api.transittracker.ca/v2/regions'
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Accept-Language': 'en'
}
response = requests.request('GET', url, headers=headers)
response.json()
Example response (503):
Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
{
"message": "Service Unavailable"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GET v2/regions/{region_slug}
Example request:
curl --request GET \
--get "https://api.transittracker.ca/v2/regions/mtl" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Accept-Language: en"
$client = new \GuzzleHttp\Client();
$url = 'https://api.transittracker.ca/v2/regions/mtl';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Accept-Language' => 'en',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://api.transittracker.ca/v2/regions/mtl'
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Accept-Language': 'en'
}
response = requests.request('GET', url, headers=headers)
response.json()
Example response (503):
Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
{
"message": "Service Unavailable"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Tags
GET v2/tags
GET v2/tags/{tag_id}
Vehicles
GET v2/agencies/{agency_slug}/vehicles
Example request:
curl --request GET \
--get "https://api.transittracker.ca/v2/agencies/stm/vehicles?geojson=" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Accept-Language: en"
$client = new \GuzzleHttp\Client();
$url = 'https://api.transittracker.ca/v2/agencies/stm/vehicles';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Accept-Language' => 'en',
],
'query' => [
'geojson' => '0',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://api.transittracker.ca/v2/agencies/stm/vehicles'
params = {
'geojson': '0',
}
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Accept-Language': 'en'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()
Example response (503):
Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
{
"message": "Service Unavailable"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GET v2/agencies/{agency}/vehicles.geojson
Example request:
curl --request GET \
--get "https://api.transittracker.ca/v2/agencies/stm/vehicles.geojson" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Accept-Language: en"
$client = new \GuzzleHttp\Client();
$url = 'https://api.transittracker.ca/v2/agencies/stm/vehicles.geojson';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Accept-Language' => 'en',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://api.transittracker.ca/v2/agencies/stm/vehicles.geojson'
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Accept-Language': 'en'
}
response = requests.request('GET', url, headers=headers)
response.json()
Example response (503):
Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
{
"message": "Service Unavailable"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GET v2/agencies/{agency_slug}/vehicles/{vehicle}
Example request:
curl --request GET \
--get "https://api.transittracker.ca/v2/agencies/stm/vehicles/veniam" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Accept-Language: en"
$client = new \GuzzleHttp\Client();
$url = 'https://api.transittracker.ca/v2/agencies/stm/vehicles/veniam';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Accept-Language' => 'en',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://api.transittracker.ca/v2/agencies/stm/vehicles/veniam'
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Accept-Language': 'en'
}
response = requests.request('GET', url, headers=headers)
response.json()
Example response (503):
Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
{
"message": "Service Unavailable"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GET v2/vehicles
Example request:
curl --request GET \
--get "https://api.transittracker.ca/v2/vehicles" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Accept-Language: en"
$client = new \GuzzleHttp\Client();
$url = 'https://api.transittracker.ca/v2/vehicles';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Accept-Language' => 'en',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://api.transittracker.ca/v2/vehicles'
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Accept-Language': 'en'
}
response = requests.request('GET', url, headers=headers)
response.json()
Example response (503):
Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
{
"message": "Service Unavailable"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GET v2/vehicles.geojson
Example request:
curl --request GET \
--get "https://api.transittracker.ca/v2/vehicles.geojson" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Accept-Language: en"
$client = new \GuzzleHttp\Client();
$url = 'https://api.transittracker.ca/v2/vehicles.geojson';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Accept-Language' => 'en',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://api.transittracker.ca/v2/vehicles.geojson'
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Accept-Language': 'en'
}
response = requests.request('GET', url, headers=headers)
response.json()
Example response (503):
Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
{
"message": "Service Unavailable"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GET v2/vehicles/{vehicle_id}
Example request:
curl --request GET \
--get "https://api.transittracker.ca/v2/vehicles/1" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Accept-Language: en"
$client = new \GuzzleHttp\Client();
$url = 'https://api.transittracker.ca/v2/vehicles/1';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Accept-Language' => 'en',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://api.transittracker.ca/v2/vehicles/1'
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Accept-Language': 'en'
}
response = requests.request('GET', url, headers=headers)
response.json()
Example response (503):
Show headers
cache-control: no-cache, private
content-type: application/json
vary: Origin
{
"message": "Service Unavailable"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.