Bts
v0.2.1U.S. Bureau of Transportation Statistics (BTS) — data.bts.gov open-data portal (Socrata platform).
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
search_datasets
Search datasets published on the U.S. Bureau of Transportation Statistics open-data portal (data.bts.gov). Returns each dataset's Socrata 4x4 id (e.g. "crem-w557"), name, and description. Use the id with dataset_columns and query_dataset. BTS covers aviation (passenger counts, on-time performance, air fares, airline financials), freight movement, transit ridership, border crossings, and transportation safety. Example queries: "aviation", "border crossing", "transit", "freight".
| Parameter | Type | Description |
|---|---|---|
q * | string | Full-text search query, e.g. "aviation" or "border crossing". |
limit | number | Max datasets to return (default 20). |
offset | number | Pagination offset (default 0). |
dataset_columns
List the columns of a data.bts.gov dataset: field name (used in SoQL $select/$where), human label, and data type (number, text, calendar_date, etc.). Call this before query_dataset so you know which fields exist. datasetId is the Socrata 4x4 code from search_datasets.
| Parameter | Type | Description |
|---|---|---|
datasetId * | string | Socrata 4x4 id, e.g. "crem-w557". |
query_dataset
Query rows from a data.bts.gov dataset using SoQL. datasetId is the Socrata 4x4 code from search_datasets. SoQL clauses: $select (columns / aggregates like "count(*)" or "avg(air_fare)"), $where (SQL-like filter, e.g. "date > '2024-01-01' AND state='TX'"), $order ("date desc"), $group, $q (full-text across the row). Use dataset_columns first to learn field names. Returns an array of row objects keyed by field name. Default $limit is 50 (Socrata max per page is 50000).
| Parameter | Type | Description |
|---|---|---|
datasetId * | string | Socrata 4x4 id, e.g. "crem-w557". |
$group | string | Group-by field(s) for aggregation. |
$limit | number | Rows to return (default 50). |
$offset | number | Pagination offset (default 0). |
$order | string | Sort, e.g. "date desc". |
$q | string | Full-text search across the whole row. |
$select | string | Columns or aggregates, e.g. "date, safety_general_aviation". |
$where | string | SQL-like filter, e.g. "date > '2024-01-01'". |