Data · SQL API

Query the data over HTTPS.

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.

Get a key

  • 60 requests a minutePer key, to any endpoint.
  • 1,000 queries a dayAnd 10 minutes of query time. Repeat queries come from a cache and don’t count.
  • 10,000 rows an answerEach query stops after 30 seconds. Aggregate in SQL for bigger questions.
  • Want everything?The Parquet files stay free to download, with no key and no limit beyond fair use.

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.

Use it

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.

Read the API guide · OpenAPI description