Programmatic Data Access
API endpoints, authentication, and access patterns for real-time transport data sources
Programmatic Access to Transport Data Sources
Last updated: 2026-02-09 Status: Research document -- API endpoints and access policies should be verified before integration Purpose: Document API availability, authentication, endpoints, downloads, and licensing for 5 key real-time/near-real-time transport data sources
Table of Contents
- UNECE Transport Statistics (PXWeb)
- Africa Transport Observatory (ATO)
- OpenSky Network (Aviation ADS-B)
- AISHub / MarineTraffic (Maritime AIS)
- GBFS Feeds (Shared Mobility)
- Comparison Matrix
1. UNECE Transport Statistics (PXWeb)
Overview
The UNECE Statistical Database provides annual transport statistics for 56 UNECE member states (Europe, Central Asia, North America) covering road, rail, inland waterway, and pipeline transport. The database is built on PXWeb, a standard API framework developed by Statistics Sweden and used by dozens of national statistical institutes across Europe.
API Availability
| Aspect | Details |
|---|---|
| API type | REST API (PXWeb API v1) |
| Base URL | https://w3.unece.org/PXWeb2015/api/v1/en/STAT/ |
| URL pattern | {base}/api/v1/{lang}/{database}/{levels}/{table}.px |
| Methods | GET (browse/list tables), POST (query data with JSON body) |
| Response formats | JSON, JSON-stat, JSON-stat2, CSV, XLSX, PC-Axis (.px) |
| Max values per call | Up to 100,000 data cells per request |
API Documentation
- PXWeb API general documentation: https://pxdata.stat.fi/api1.html
- SCB (Sweden) API description PDF: https://pxdata.stat.fi/API-description_SCB.pdf
- PXWebApi 2.0 (newer version, launched Oct 2025 at SCB): https://www.scb.se/en/services/open-data-api/pxwebapi/pxapi-2.0
- UNECE Statistical Database portal: https://w3.unece.org/PXWeb/en
- UNECE legacy database interface: https://w3.unece.org/PXWeb2015/pxweb/en/STAT/
Authentication
- None required. The API is freely accessible without authentication.
- Rate limits: PXWebApi 2.0 (at SCB) enforces max 30 requests per 10 seconds and 150,000 data cells per GET. The UNECE instance likely has similar limits but these are not publicly documented.
Key Endpoints / Data Available
Transport data is organized under the path STAT__40-TRTRANS:
| Endpoint Path Segment | Data |
|---|---|
02-TRROAD/ | Road transport -- passenger-km, bus/coach statistics, road network length |
05-TRRAIL/ | Rail transport -- freight tonne-km, passenger-km, rail network |
08-TRINLAND/ | Inland waterway transport |
10-TRPIPE/ | Pipeline transport |
12-TRSAFETY/ | Road traffic accidents and fatalities |
15-TRVEHICLE/ | Vehicle fleet statistics |
Example API call (browse tables):
GET https://w3.unece.org/PXWeb2015/api/v1/en/STAT/STAT__40-TRTRANS__02-TRROAD
Example API call (query data):
POST https://w3.unece.org/PXWeb2015/api/v1/en/STAT/STAT__40-TRTRANS__02-TRROAD/04_en_TRRoadPassgKm_r.px
Content-Type: application/json
{
"query": [
{
"code": "Country",
"selection": {
"filter": "item",
"values": ["826"]
}
}
],
"response": {
"format": "json-stat2"
}
}
Direct Download Options
- Tables can be exported via the web interface in CSV, XLSX, and PC-Axis formats
- The API itself supports CSV and XLSX as response formats (set
"format": "csv"in POST body) - No single bulk download of the entire transport statistics database
GitHub Repos / Client Libraries
- R package
pxweb: https://ropengov.github.io/pxweb/ (CRAN) -- works with any PXWeb API including UNECE - R package
PxWebApiData: https://cran.r-project.org/web/packages/PxWebApiData/ -- simpler wrapper - Python: No official client; use
requestslibrary with the REST API directly - PXWeb source (Statistics Sweden): The PXWeb platform is developed by SCB but the UNECE instance source is not publicly available
License
- Free for all uses. UNECE statistical data is publicly available without restrictions. Standard UN terms of use apply (attribution expected).
2. Africa Transport Observatory (ATO)
Overview
The Africa Transport Observatory (ATO) at ato.africa is a continental transport data platform operated by the African Union Commission with technical support from the SSATP (Sub-Saharan Africa Transport Policy Program) at the World Bank. It aims to be the central repository for transport statistics across all 54 AU member states.
API Availability
| Aspect | Details |
|---|---|
| API type | None available. No public API exists. |
| Web interface | Dashboard-style portal with maps, charts, and country profiles |
| Data download | Very limited; some indicators downloadable via the web UI |
| Programmatic access | Not supported as of February 2026 |
Important clarification: The domain ato.africa hosts the African Trade Observatory (an AfCFTA trade data instrument run by the African Union and ITC), not a transport observatory. The SSATP-led transport observatory work appears to be folded into corridor-specific monitoring systems rather than a single unified platform.
Related Platforms and Data Sources
The SSATP ecosystem includes several related initiatives, none of which currently offer programmatic access:
| Platform | URL | Focus | API |
|---|---|---|---|
| SSATP | https://www.ssatp.org/ | African transport policy programme | No |
| African Road Safety Observatory (ARSO) | via SSATP | Road safety data for Africa | No (Dropbox-based) |
| Corridor Transport Observatories | Various | Trade corridor performance (Northern Corridor, Maputo, etc.) | No |
| Africa Information Highway | https://dataportal.opendataforafrica.org/ | Pan-African data portal (includes some transport) | Yes -- has API explorer |
| Data Transport | https://data-transport.org/ | African mobility data (GTFS, mapping) | Partial downloads |
Best Alternative for Programmatic Access to African Transport Data
The Africa Information Highway Portal (by the African Development Bank) is the closest alternative with an actual API:
- API Explorer: https://dataportal.opendataforafrica.org/dev/explorer
- Covers energy, transport, ICT, water, and ports across Africa
- Includes some transport indicators that would otherwise come from ATO
Documentation
- SSATP Corridor Transport Observatory Guidelines (PDF): https://documents1.worldbank.org/curated/en/295971468191647427/pdf/854750NWP0SSAT0Box382155B00PUBLIC0y.pdf
- SSATP publications page: https://www.ssatp.org/publications
Authentication
- N/A (no API)
Direct Download Options
- Country profiles and corridor reports downloadable as PDF from SSATP
- Africa Road Safety Observatory data shared via Dropbox
- No structured data downloads (CSV/JSON) from a transport-specific observatory
GitHub Repos
- None identified for ATO or SSATP transport data platforms
License
- Not clearly defined. African Union / World Bank data policies would apply.
Assessment
The ATO/SSATP transport data ecosystem has the weakest programmatic access of all sources reviewed. This represents a significant gap for any global transport intelligence system. Integration would require either:
- Web scraping (fragile, not recommended)
- Partnership agreement for direct data access
- Using the Africa Information Highway API as a proxy for some indicators
3. OpenSky Network (Aviation ADS-B)
Overview
The OpenSky Network is a community-based ADS-B (Automatic Dependent Surveillance-Broadcast) receiver network that collects and provides aircraft position and flight data. It is the largest open-access source of live and historical aviation tracking data, with 2,500+ volunteer receivers worldwide.
API Availability
| Aspect | Details |
|---|---|
| API type | REST API (v1.4.0) |
| Base URL | https://opensky-network.org/api |
| Auth server | https://auth.opensky-network.org/auth/realms/opensky-network/protocol/openid-connect/token |
| Response format | JSON |
| Historical data | Trino SQL interface for bulk historical queries |
API Documentation
- REST API docs: https://openskynetwork.github.io/opensky-api/rest.html
- Python API docs: https://openskynetwork.github.io/opensky-api/python.html
- Full documentation index: https://openskynetwork.github.io/opensky-api/
- API landing page: https://opensky-network.org/data/api
- Trino historical data: https://opensky-network.org/data/trino
Authentication
| Access Level | Method | Details |
|---|---|---|
| Anonymous | None | Limited access, reduced resolution |
| Registered user | OAuth2 client credentials | Free registration; create API client in account settings to get client_id and client_secret |
| Active contributor | OAuth2 + ADS-B receiver | Users with an ADS-B receiver that is >= 30% online |
OAuth2 token request:
curl -X POST "https://auth.opensky-network.org/auth/realms/opensky-network/protocol/openid-connect/token" \
-d "grant_type=client_credentials" \
-d "client_id=YOUR_CLIENT_ID" \
-d "client_secret=YOUR_CLIENT_SECRET"
Note: All accounts created since mid-March 2025 must use OAuth2. Legacy username/password auth is being phased out.
Rate Limits
| User Type | API Credits/Day | Data History | Time Resolution |
|---|---|---|---|
| Anonymous | Very limited | Real-time only | 10 seconds |
| Registered | Lower allocation | Up to 1 hour in the past | 10 seconds |
| Active contributor | 8,000 credits/day | Up to 1 hour in the past | 5 seconds |
- Header
X-Rate-Limit-Remainingshows remaining credits - HTTP 429 returned when limit reached;
X-Rate-Limit-Retry-After-Secondsindicates wait time
Key Endpoints
| Endpoint | Method | Description |
|---|---|---|
/states/all | GET | All aircraft state vectors (position, velocity, heading, altitude) |
/states/own | GET | State vectors from your own sensors only |
/flights/all?begin={t1}&end={t2} | GET | All flights within a time interval |
/flights/aircraft?icao24={addr}&begin={t1}&end={t2} | GET | Flights for a specific aircraft |
/flights/arrival?airport={icao}&begin={t1}&end={t2} | GET | Arrivals at a specific airport |
/flights/departure?airport={icao}&begin={t1}&end={t2} | GET | Departures from a specific airport |
/tracks/all?icao24={addr}&time={t} | GET | Flight track (waypoints) for a specific aircraft |
Example -- get all current aircraft states:
curl "https://opensky-network.org/api/states/all" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"
Example -- get all states in a bounding box (Europe):
curl "https://opensky-network.org/api/states/all?lamin=45.8389&lomin=5.9962&lamax=47.8229&lomax=10.5226"
Direct Download / Bulk Data Options
| Method | Access | Description |
|---|---|---|
| Trino SQL interface | Registered (research use) | Full historical dataset via SQL-like queries (Trino + Minio) |
| Zenodo datasets | Public | Curated datasets (e.g., COVID-19 air traffic) -- CC BY licensed |
| Monday snapshots | Public | Full state vector data for every Monday, 10-second intervals |
| Data formats | -- | CSV, Avro, JSON (hourly files) |
- Trino access is available to university-affiliated researchers, government organizations, and aviation authorities
- Zenodo dataset: https://zenodo.org/records/7923702
GitHub Repos
| Repository | Description |
|---|---|
| openskynetwork/opensky-api | Python and Java API bindings + documentation |
| URL: https://github.com/openskynetwork/opensky-api | |
| pyopensky | Alternative Python library for OpenSky (by Xavier Olive) |
| URL: https://github.com/open-aviation/pyopensky | Docs: https://mode-s.org/pyopensky/ |
| traffic | Python library for air traffic analysis (uses OpenSky) |
| URL: https://github.com/open-aviation/traffic |
License
- API & data: Free for non-commercial / academic use. Commercial use requires agreement.
- API client code: GNU General Public License v3.0 (GPLv3)
- Zenodo datasets: Creative Commons Attribution (CC BY)
- Terms of use: https://opensky-network.org/about/terms-of-use
4. AISHub / MarineTraffic (Maritime AIS)
4a. AISHub
Overview
AISHub is a community-based AIS data exchange network. Members contribute raw AIS data from their receivers and in return get access to the aggregated worldwide AIS feed from all other contributors. It is the maritime equivalent of the OpenSky model.
API Availability
| Aspect | Details |
|---|---|
| API type | REST API (XML/JSON/CSV webservice) |
| Base URL | https://data.aishub.net/ws.php |
| Response formats | XML, JSON, CSV |
| Compression | None, zip, gzip, bzip2 |
API Documentation
- API page: https://www.aishub.net/api
- Third-party documentation: https://publicapi.dev/ais-hub-api
Authentication
| Aspect | Details |
|---|---|
| Model | Reciprocal data sharing -- you must contribute AIS data to access the API |
| API key | Called "username" -- request at aishub@astrapaging.com |
| Requirements | Own an AIS receiver, contribute raw NMEA data via UDP |
| Quality threshold | Coverage of >= 10 vessels (7-day avg), >= 90% uptime (7-day avg) |
| Cost | Free for all qualifying contributors |
Rate Limits
- Maximum 1 API request per minute
Key Endpoints / Parameters
The API is a single endpoint with parameters:
| Parameter | Description |
|---|---|
username | API key / username |
format | 1 (XML), 2 (JSON), 3 (CSV) |
output | json, xml, csv |
compress | 0 (none), 1 (zip), 2 (gzip), 3 (bzip2) |
latmin, latmax, lonmin, lonmax | Bounding box filter |
mmsi | Filter by specific vessel MMSI |
Example:
https://data.aishub.net/ws.php?username=YOUR_KEY&format=1&output=json&compress=0&latmin=45&latmax=46&lonmin=-1&lonmax=0
Data Fields
Returns standard AIS position report data: MMSI, timestamp, latitude, longitude, course over ground (COG), speed over ground (SOG), heading, navigation status, vessel name, IMO number, call sign, vessel type, dimensions.
Direct Download
- No bulk historical downloads
- Real-time data only through API
- Raw NMEA feed available to members
GitHub Repos
- aishub-api-public: https://github.com/lagersmit/aishub-api-public (community wrapper)
License
- Free for contributors; no explicit open data license
- Data is shared under the reciprocal contribution model
4b. MarineTraffic (by Kpler)
Overview
MarineTraffic is the world's largest commercial maritime data platform, now part of Kpler. It provides comprehensive vessel tracking, port data, and maritime intelligence via a suite of paid API services.
API Availability
| Aspect | Details |
|---|---|
| API type | REST API |
| Base URL | https://services.marinetraffic.com/api/exportvessel/ (varies by endpoint) |
| Response formats | JSON, XML, CSV |
| Model | Commercial / paid |
API Documentation
- Official API docs: https://servicedocs.marinetraffic.com/
- API services overview: https://support.marinetraffic.com/en/articles/9552659-api-services
- Setup guide: https://help.marinetraffic.com/hc/en-us/articles/205115108-Set-up-your-API-Services
Authentication
- API key required (obtained after purchasing a subscription plan)
- Key passed as URL parameter:
?v=8&api_key=YOUR_KEY&...
Pricing
- Commercial, subscription-based. Prices vary by:
- Endpoint / service type
- Response detail level (simple / extended / full)
- AIS data source (terrestrial / satellite)
- Number of tracked vessels
- Request frequency
- Volume discounts available (e.g., 25+ vessels)
- No free tier for API access (the website has a free tier for manual browsing)
- Contact sales for pricing: https://www.marinetraffic.com/en/online-services/plans/comparison-list
Key API Services (Endpoints)
| Service Code | Name | Description |
|---|---|---|
| PS01 | Vessel Historical Track | Historical position data for a vessel |
| PS02 | Fleet Vessel Positions | Current positions of a defined fleet |
| PS06 | Vessel Positions in Area | All vessels in a bounding box |
| PS07 | Single Vessel Positions | Current position of a single vessel |
| VD02 | Vessel Particulars | Static vessel data (name, type, dimensions, flag) |
| EV01 | Port Calls | Port call events (arrivals/departures) |
| VI06 | Port Congestion | Vessel congestion metrics at ports |
Example:
https://services.marinetraffic.com/api/exportvessel/v:8/YOUR_API_KEY/timespan:60/protocol:json
Direct Download
- No bulk data downloads via API (query-based only)
- Historical data available as paid data products
- MarineTraffic Data Services (via Kpler): https://www.kpler.com/product/maritime/data-services
GitHub Repos
- Marine-Traffic-API (Python): https://pypi.org/project/Marine-Traffic-API/ / https://github.com/amphinicy/marine-traffic-client-api
- MarineTraffic.NET (C#): https://github.com/sandrock/MarineTraffic.NET
License
- Proprietary / commercial. All data subject to MarineTraffic/Kpler terms of service. Not open data.
Maritime AIS Comparison
| Feature | AISHub | MarineTraffic |
|---|---|---|
| Cost | Free (contribute data) | Paid (subscription) |
| Coverage | Depends on contributors (~thousands of stations) | Global (terrestrial + satellite AIS) |
| Historical data | No | Yes (paid) |
| Satellite AIS | No (terrestrial only) | Yes |
| Rate limit | 1 req/min | Depends on plan |
| Data richness | Basic AIS fields | Enriched (port calls, voyages, ETA, risk) |
| Reliability | Community-dependent | Enterprise SLA |
5. GBFS Feeds (Shared Mobility)
Overview
The General Bikeshare Feed Specification (GBFS) is the open data standard for shared mobility (bikeshare, scooter share, car share, etc.). It defines a set of JSON endpoints that operators publish to make real-time availability data publicly accessible. GBFS is maintained by MobilityData and is used by 900+ shared mobility systems worldwide.
API Availability
GBFS is not a single API but a specification that each operator implements. Access is decentralized.
| Aspect | Details |
|---|---|
| Spec type | REST / JSON feeds (read-only) |
| Current version | v3.0 (also widely deployed: v2.3, v2.2) |
| Discovery | Each system publishes a gbfs.json auto-discovery file |
| Authentication | Typically none -- feeds are public by design |
| Rate limits | Varies by operator; data should not be stale by more than 5 minutes |
Documentation
- GBFS specification (current): https://gbfs.org/documentation/reference/
- GBFS spec on GitHub: https://github.com/MobilityData/gbfs/blob/master/gbfs.md
- Get started guide: https://gbfs.org/learn/guide/
- v3.0 spec: https://github.com/MobilityData/gbfs/blob/v3.0/gbfs.md
- FAQ: https://gbfs.org/learn/faq/
Feed Discovery -- The systems.csv Catalog
The master catalog of all known GBFS feeds worldwide is maintained by MobilityData:
| Resource | URL |
|---|---|
| systems.csv (raw) | https://github.com/MobilityData/gbfs/blob/master/systems.csv |
| systems.csv (direct download) | https://raw.githubusercontent.com/MobilityData/gbfs/master/systems.csv |
| Mobility Database website | https://mobilitydatabase.org/ |
| Mobility Database API | https://api.mobilitydatabase.org/v1/metadata |
The systems.csv file contains columns:
Country Code,Name(system name),Location(city),System ID,URL(operator website),Auto-Discovery URL(thegbfs.jsonendpoint)
Authentication
- GBFS feeds: No authentication required for most feeds. The specification mandates public access.
- Mobility Database API: Requires a free access token (sign up at mobilitydatabase.org)
Key GBFS Endpoints (per system)
Each GBFS system publishes a gbfs.json file that links to the following feeds:
| Endpoint | Required? | Description |
|---|---|---|
gbfs.json | Yes | Auto-discovery file listing all available feeds |
system_information.json | Yes | System name, operator, timezone, license, contact |
station_information.json | If docked | All stations: ID, name, lat/lon, capacity |
station_status.json | If docked | Real-time: available bikes/docks per station |
vehicle_status.json (v3.0) / free_bike_status.json (v2.x) | If dockless | Real-time: all available dockless vehicles with location |
vehicle_types.json | If applicable | Vehicle type definitions (e-bike, scooter, etc.) |
system_regions.json | Optional | Geographic regions within the system |
system_pricing_plans.json | Optional | Pricing information |
geofencing_zones.json | Optional | Operating zones, no-ride zones, speed zones |
Example -- discover a system's feeds (Citi Bike NYC):
curl https://gbfs.citibikenyc.com/gbfs/gbfs.json
Example -- get station status:
curl https://gbfs.citibikenyc.com/gbfs/en/station_status.json
Direct Download Options
- systems.csv can be downloaded directly from GitHub for the full catalog
- Individual feeds are JSON and can be polled/scraped
- No single bulk download of all feeds (each system is independent)
- The Mobility Database API provides a programmatic way to discover and catalog feeds
GitHub Repos
| Repository | Description |
|---|---|
| MobilityData/gbfs | GBFS specification + systems.csv catalog |
| https://github.com/MobilityData/gbfs | |
| MobilityData/gbfs-validator | GBFS feed validator tool |
| https://github.com/MobilityData/gbfs-validator | |
| MobilityData/mobility-feed-api | Mobility Database website and API source code |
| https://github.com/MobilityData/mobility-feed-api |
License
- GBFS specification: Creative Commons Attribution 3.0 (CC BY 3.0)
- GBFS validator: Apache License 2.0
- Individual feed data: Varies by operator. If
license_idandlicense_urlare blank insystem_information.json, data defaults to Creative Commons Universal Public Domain Dedication (CC0). The specification recommends open data licensing. - systems.csv catalog: CC BY 3.0
6. Comparison Matrix
Access Model Comparison
| Source | API Available | Auth Required | Free Access | Real-Time | Historical |
|---|---|---|---|---|---|
| UNECE PXWeb | Yes (REST) | No | Yes | No (annual stats) | Yes (time series) |
| ATO / SSATP | No | N/A | N/A | No | No |
| OpenSky Network | Yes (REST) | Yes (OAuth2) | Yes (with limits) | Yes | Yes (Trino) |
| AISHub | Yes (REST) | Yes (contribute data) | Yes (reciprocal) | Yes | No |
| MarineTraffic | Yes (REST) | Yes (API key) | No (paid only) | Yes | Yes (paid) |
| GBFS | Yes (per-system) | No (mostly) | Yes | Yes | No (current state only) |
Data Richness Comparison
| Source | Transport Mode | Coverage | Update Frequency | Data Format |
|---|---|---|---|---|
| UNECE PXWeb | Road, rail, waterway, pipeline | 56 countries (Europe, C. Asia, N. America) | Annual | JSON-stat, CSV, XLSX |
| ATO / SSATP | All modes (aspirational) | 54 African countries | Irregular | Dashboard only |
| OpenSky Network | Aviation | Global (ADS-B coverage) | Real-time (5-10 sec) | JSON, CSV, Avro |
| AISHub | Maritime | Global (terrestrial AIS) | Real-time (1 min polling) | JSON, XML, CSV |
| MarineTraffic | Maritime | Global (terrestrial + satellite AIS) | Real-time | JSON, XML, CSV |
| GBFS | Shared mobility (bike, scooter, car) | 900+ systems worldwide | Real-time (< 5 min) | JSON |
Integration Effort Estimate
| Source | Effort | Notes |
|---|---|---|
| UNECE PXWeb | Low | Standard PXWeb API; well-documented; existing R/Python tooling |
| ATO / SSATP | High | No API; requires partnership or alternative data sources |
| OpenSky Network | Low-Medium | Well-documented REST API; OAuth2 setup; rate limits to manage |
| AISHub | Medium | Requires AIS receiver contribution; simple API once access granted |
| MarineTraffic | Low (but costly) | Well-documented commercial API; budget required |
| GBFS | Medium | Simple per-feed access; challenge is aggregating 900+ systems |
This document complements the platform profiles in /research/databases-platforms/ by focusing specifically on programmatic access patterns for real-time and near-real-time data sources that could feed into a Global Transport Intelligence System.