Data · SQL API
Send read-only SQL to api.transitlab.nyc and get rows back as JSON, CSV or Parquet. It runs on our servers against every open table, so there is nothing to download or install. Keys are free.
We keep your email address, when you asked for a key, a scrambled form of your IP address and your country, to stop abuse. We store a fingerprint of the key, not the key itself, so a lost key can’t be sent again: ask for a new one. We count each key’s queries to enforce the limits. Ask us at hello@transitlab.nyc to delete your key. More on our privacy page.
Send the key in the Authorization header and the query as JSON. Name tables as they appear in /v1/tables.
curl https://api.transitlab.nyc/v1/sql \
-H "Authorization: Bearer $TRANSITLAB_API_KEY" \
-H "Content-Type: application/json" \
-d '{"sql": "select route_id, count(*) as stops from subway_stop_events where year = 2026 and month = 10 group by 1 order by 2 desc limit 5"}'
Add "format": "csv" or "parquet" for a file, and "limit" for up to 10,000 rows. Big tables are one file a month: filter on year and month so a query reads only what it needs. The same key works with our MCP server for AI agents.