Skip to main content
POST
Query dataset

Request contract

  • Method and path: POST /apis/v1/socrata-com/open-data/query-dataset
  • Availability: enabled
  • Request URL template: https://api.aisa.one/apis/v1/socrata-com/open-data/query-dataset
Complete OpenAPI definition Effective request declaration (including authentication and referenced schemas):

Cost and request rules

Usage-based pricing. Default request estimate: $0.0005 USD. The final charge depends on actual usage. Your account price may differ; use a request quote where supported.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
dataset_id
string
required

The dataset's Socrata 4x4 id (for example ydr8-5enu, from search_datasets) or a dataset URL on the same portal: /d/, ///, /resource/.json.

portal
string
required

The portal: its hostname (data.cityofchicago.org, data.ny.gov, www.dallasopendata.com) or any URL on it. Must be a Socrata domain served by the Socrata Discovery API (US or EU region); anything else fails with invalid_input not_socrata_portal before the host is contacted.

group
string

SoQL $group, e.g. permit_type (with an aggregate in select).

limit
number
default:100

Rows per page (1-1000). A page is also cut at about 1 MB of row data; continue from next_offset.

Provider reference: minimum 1; maximum 1000; default 100.

offset
number
default:0

Row offset (next_offset of the previous page).

Provider reference: minimum 0; maximum 100000000; default 0.

order
string

SoQL $order, e.g. issue_date DESC. Defaults to the row id :id for stable paging (none for aggregates).

q
string

Full-text search across the dataset's text columns.

select
string

SoQL $select without the keyword: columns, aliases, aggregates. E.g. permit_, permit_type, issue_date or permit_type, count(*) AS n.

where
string

SoQL $where without the keyword. String literals in single quotes ('O''Hare' escapes a quote). E.g. issue_date >= '2024-01-01' AND permit_type = 'PERMIT - NEW CONSTRUCTION', within_circle(location, 41.88, -87.63, 500).

Response

Query rows of a dataset on any Socrata portal through its SODA 2.1 endpoint with SoQL: select (columns, aliases, aggregates), where (comparisons, like, between, in, date and spatial functions), order, group and full-text q, paged with limit (1-1000) and offset. Rows come back as published (numbers and dates as strings, geometry as GeoJSON) with the returned field names and types; pages are cut at about 1 MB of row data with next_offset to continue. The portal must be a Socrata domain (else invalid_input not_socrata_portal); an unknown dataset is not_found; SoQL the portal rejects (unknown column, syntax) is invalid_input at the offending field; an empty page is a successful result.

The response contains the tool result directly.

The provider identifies rows as the primary payload key.

The provider does not publish a field list for this tool.

These are the provider's documented fields. Field requiredness, nullability and nested object structures are specified only where the descriptions explicitly say so.