> ## Documentation Index
> Fetch the complete documentation index at: https://aisa.one/docs/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> - Base URLs: models `https://api.aisa.one/v1` (Gemini GenerateContent: `https://api.aisa.one/v1beta`); data APIs `https://api.aisa.one/apis/v1`. The `servers` of each operation in https://aisa.one/openapi.yaml is authoritative.
> - Auth: `Authorization: Bearer $AISA_API_KEY`. Never print, log, or commit the key.
> - MCP (preferred for agents): `https://mcp.aisa.one/mcp`, signed in with OAuth, so there is no key to paste.
> - Agent Skill: `npx skills add AIsa-team/agent-skills --skill aisa`. Fallback with the AIsa CLI: `aisa skills install aisa`.
> - Spending: docs, https://aisa.one/models, https://aisa.one/api, `/v1/models`, and MCP `search`, `list_categories`, `get_details`, `batch_quote`, and the `account` operation are free. Quote the exact calls before running them (MCP `batch_quote`, CLI `aisa quote --json`). If the quote reports `auto_execute_eligible: true`, run it unless the user set a tighter limit or asked only for a quote. Otherwise, tell the user in one message the planned calls, the quoted price, and a total USD budget for the task, then wait for approval. Direct HTTP calls follow the stricter rule at https://aisa.one/docs/get-started/cli.md#direct-http-fallback. Do not make paid calls to test availability. Full rule: https://aisa.one/llms.txt

# Query dataset

> Any question that needs actual records or aggregates from an open-data dataset (permit lookups by address or number, inspection results, 311 requests by type, counts by category). Get the portal and 4x4 from search_datasets and field names from describe_dataset first.

## 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](https://aisa.one/docs/openapi/socrata-com.json)

Effective request declaration (including authentication and referenced schemas):

```json theme={null}
{
  "operationId": "socrata-com.open-data.query-dataset",
  "method": "POST",
  "path": "/apis/v1/socrata-com/open-data/query-dataset",
  "servers": [
    {
      "url": "https://api.aisa.one"
    }
  ],
  "parameters": [],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "requestBody": {
    "content": {
      "application/json": {
        "examples": {
          "provider": {
            "summary": "Official provider example; checked against AIsa request constraints",
            "value": {
              "dataset_id": "ydr8-5enu",
              "limit": 5,
              "portal": "data.cityofchicago.org",
              "select": "id, permit_, permit_type, issue_date, street_number, street_direction, street_name",
              "where": "permit_ = '100084789'"
            }
          }
        },
        "schema": {
          "additionalProperties": true,
          "properties": {
            "dataset_id": {
              "description": "The dataset's Socrata 4x4 id (for example ydr8-5enu, from search_datasets) or a dataset URL on the same portal: /d/<id>, /<Category>/<Name>/<id>, /resource/<id>.json.",
              "type": "string"
            },
            "group": {
              "description": "SoQL $group, e.g. `permit_type` (with an aggregate in select).",
              "type": "string",
              "x-alexandria-option-metadata": {
                "in": "body"
              }
            },
            "limit": {
              "default": 100,
              "description": "Rows per page (1-1000). A page is also cut at about 1 MB of row data; continue from next_offset.\n\nProvider reference: minimum 1; maximum 1000; default 100.",
              "type": "number",
              "x-alexandria-option-metadata": {
                "in": "body",
                "max": 1000,
                "min": 1
              }
            },
            "offset": {
              "default": 0,
              "description": "Row offset (next_offset of the previous page).\n\nProvider reference: minimum 0; maximum 100000000; default 0.",
              "type": "number",
              "x-alexandria-option-metadata": {
                "in": "body",
                "max": 100000000,
                "min": 0
              }
            },
            "order": {
              "description": "SoQL $order, e.g. `issue_date DESC`. Defaults to the row id `:id` for stable paging (none for aggregates).",
              "type": "string",
              "x-alexandria-option-metadata": {
                "in": "body"
              }
            },
            "portal": {
              "description": "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.",
              "type": "string"
            },
            "q": {
              "description": "Full-text search across the dataset's text columns.",
              "type": "string",
              "x-alexandria-option-metadata": {
                "in": "body"
              }
            },
            "select": {
              "description": "SoQL $select without the keyword: columns, aliases, aggregates. E.g. `permit_, permit_type, issue_date` or `permit_type, count(*) AS n`.",
              "type": "string",
              "x-alexandria-option-metadata": {
                "in": "body"
              }
            },
            "where": {
              "description": "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)`.",
              "type": "string",
              "x-alexandria-option-metadata": {
                "in": "body"
              }
            }
          },
          "required": [
            "dataset_id",
            "portal"
          ],
          "type": "object"
        }
      }
    },
    "required": true
  },
  "x-aisa-status": "enabled",
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "scheme": "bearer",
        "type": "http"
      }
    }
  }
}
```

## 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.


## OpenAPI

````yaml openapi/socrata-com.json POST /apis/v1/socrata-com/open-data/query-dataset
openapi: 3.1.0
info:
  description: ''
  title: Socrata open-data portals
  version: '1'
  x-aisa-capabilities:
    idempotency: Idempotency-Key
    max_price: X-AISA-Max-Price-USD
    quote:
      header: X-AISA-Cost-Mode
      value: quote
  x-aisa-catalogs:
    socrata-com:
      description: ''
      title: Socrata open-data portals
      x-aisa-capabilities:
        idempotency: Idempotency-Key
        max_price: X-AISA-Max-Price-USD
        quote:
          header: X-AISA-Cost-Mode
          value: quote
      x-aisa-document:
        facts_hash: 625f83db9201183eb89bace8adb584a6724e12d212fef3b0c7babc8d8a32dd58
        generator_version: '3'
        protocol_version: '1'
        schema_version: '1'
      x-aisa-plans:
        builder: 1
        display_plan: payg
        payg: 1
        similarweb_payg: 1
        team: 1
        version: e70a0959cd1b93b84ae16dffd7a538273ddb9c1d46277b82823c37ff1b6bc0fb
  x-aisa-configured-paths:
    - /apis/v1/socrata-com/open-data/describe-dataset
    - /apis/v1/socrata-com/open-data/query-dataset
    - /apis/v1/socrata-com/open-data/search-datasets
  x-aisa-document:
    composer_version: '31'
    document_hash: sha256:3dfb9a955563f2f34f1a891721ecdd7aebf6a6244e923909dd4fa86ed1093201
    facts_hash: 625f83db9201183eb89bace8adb584a6724e12d212fef3b0c7babc8d8a32dd58
    generator_version: '3'
    protocol_version: '1'
    response_pending: []
    schema_version: '1'
  x-aisa-plans:
    builder: 1
    display_plan: payg
    payg: 1
    similarweb_payg: 1
    team: 1
    version: e70a0959cd1b93b84ae16dffd7a538273ddb9c1d46277b82823c37ff1b6bc0fb
  x-aisa-provider: socrata-com
servers:
  - url: https://api.aisa.one
security:
  - bearerAuth: []
paths:
  /apis/v1/socrata-com/open-data/query-dataset:
    post:
      tags:
        - Socrata open-data portals
      summary: Query dataset
      description: >-
        Any question that needs actual records or aggregates from an open-data
        dataset (permit lookups by address or number, inspection results, 311
        requests by type, counts by category). Get the portal and 4x4 from
        search_datasets and field names from describe_dataset first.
      operationId: socrata-com.open-data.query-dataset
      requestBody:
        content:
          application/json:
            examples:
              provider:
                summary: >-
                  Official provider example; checked against AIsa request
                  constraints
                value:
                  dataset_id: ydr8-5enu
                  limit: 5
                  portal: data.cityofchicago.org
                  select: >-
                    id, permit_, permit_type, issue_date, street_number,
                    street_direction, street_name
                  where: permit_ = '100084789'
            schema:
              additionalProperties: true
              properties:
                dataset_id:
                  description: >-
                    The dataset's Socrata 4x4 id (for example ydr8-5enu, from
                    search_datasets) or a dataset URL on the same portal:
                    /d/<id>, /<Category>/<Name>/<id>, /resource/<id>.json.
                  type: string
                group:
                  description: >-
                    SoQL $group, e.g. `permit_type` (with an aggregate in
                    select).
                  type: string
                  x-alexandria-option-metadata:
                    in: body
                limit:
                  default: 100
                  description: >-
                    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.
                  type: number
                  x-alexandria-option-metadata:
                    in: body
                    max: 1000
                    min: 1
                offset:
                  default: 0
                  description: |-
                    Row offset (next_offset of the previous page).

                    Provider reference: minimum 0; maximum 100000000; default 0.
                  type: number
                  x-alexandria-option-metadata:
                    in: body
                    max: 100000000
                    min: 0
                order:
                  description: >-
                    SoQL $order, e.g. `issue_date DESC`. Defaults to the row id
                    `:id` for stable paging (none for aggregates).
                  type: string
                  x-alexandria-option-metadata:
                    in: body
                portal:
                  description: >-
                    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.
                  type: string
                q:
                  description: Full-text search across the dataset's text columns.
                  type: string
                  x-alexandria-option-metadata:
                    in: body
                select:
                  description: >-
                    SoQL $select without the keyword: columns, aliases,
                    aggregates. E.g. `permit_, permit_type, issue_date` or
                    `permit_type, count(*) AS n`.
                  type: string
                  x-alexandria-option-metadata:
                    in: body
                where:
                  description: >-
                    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)`.
                  type: string
                  x-alexandria-option-metadata:
                    in: body
              required:
                - dataset_id
                - portal
              type: object
        required: true
      responses:
        '200':
          content:
            application/json:
              examples:
                provider:
                  description: Published by the provider on 2026-10-09T17:17:18Z.
                  summary: Official provider example
                  value:
                    columns:
                      - datatype: text
                        field_name: id
                      - datatype: text
                        field_name: permit_
                      - datatype: text
                        field_name: permit_type
                      - datatype: floating_timestamp
                        field_name: issue_date
                      - datatype: number
                        field_name: street_number
                      - datatype: text
                        field_name: street_direction
                      - datatype: text
                        field_name: street_name
                    count: 1
                    data_last_modified: Fri, 09 Oct 2026 12:07:11 GMT
                    dataset_id: ydr8-5enu
                    limit: 5
                    next_offset: null
                    observed_at_ms: 1791566245239
                    offset: 0
                    portal: data.cityofchicago.org
                    rows:
                      - id: '1634695'
                        issue_date: '2006-01-03T00:00:00.000'
                        permit_: '100084789'
                        permit_type: PERMIT - SIGNS
                        street_direction: 'N'
                        street_name: MILWAUKEE AVE
                        street_number: '1576'
                    source_url: >-
                      https://data.cityofchicago.org/resource/ydr8-5enu.json?%24select=id%2C+permit_%2C+permit_type%2C+issue_date%2C+street_number%2C+street_direction%2C+street_name&%24where=permit_+%3D+%27100084789%27&%24order=%3Aid&%24limit=5
              schema:
                not:
                  type: 'null'
                x-aisa-schema-completeness: documented-fields-only
          description: >-
            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.
        default:
          content:
            application/json:
              schema: {}
          description: >-
            Error response; upstream passthrough responses may use provider
            formats
components:
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.