Query Dataset
query_datasetQuery 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).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| $q | No | Full-text search across the whole row. | |
| $group | No | Group-by field(s) for aggregation. | |
| $limit | No | Rows to return (default 50). | |
| $order | No | Sort, e.g. "date desc". | |
| $where | No | SQL-like filter, e.g. "date > '2024-01-01'". | |
| $offset | No | Pagination offset (default 0). | |
| $select | No | Columns or aggregates, e.g. "date, safety_general_aviation". | |
| datasetId | Yes | Socrata 4x4 id, e.g. "crem-w557". |