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

# Data availability

> Before pulling data: which years/months exist for a reporter, how many records each dataset has, when it was first and last released, which HS edition it uses. Also to resolve dataset_code values for dataset_metadata.

## Request contract

* **Method and path:** POST /apis/v1/comtradeplus-un-org/trade-statistics/data-availability
* **Availability:** enabled
* **Request URL template:** `https://api.aisa.one/apis/v1/comtradeplus-un-org/trade-statistics/data-availability`

[Complete OpenAPI definition](https://aisa.one/docs/openapi/comtradeplus-un-org.json)

Effective request declaration (including authentication and referenced schemas):

```json theme={null}
{
  "operationId": "comtradeplus-un-org.trade-statistics.data-availability",
  "method": "POST",
  "path": "/apis/v1/comtradeplus-un-org/trade-statistics/data-availability",
  "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": {
              "period": "2012,2013,2014,2015,2016,2017,2018,2019",
              "reporter_code": "156"
            }
          }
        },
        "schema": {
          "additionalProperties": true,
          "properties": {
            "classification": {
              "default": "HS",
              "description": "Product classification in the URL path: HS (as reported, any HS edition), H0-H6 (a specific HS edition), S1-S4 (SITC), BE/BE5 (BEC), EB/EB10/EB02/EBS (EBOPS, services).\n\nProvider reference: allowed values [\"HS\", \"H6\", \"H5\", \"H4\", \"H3\", \"H2\", \"H1\", \"H0\", \"S4\", \"S3\", \"S2\", \"S1\", \"BE\", \"BE5\", \"EB\", \"EB10\", \"EB02\", \"EBS\"]; default \"HS\".",
              "type": "string",
              "x-alexandria-option-metadata": {
                "in": "body",
                "oneOf": [
                  "HS",
                  "H6",
                  "H5",
                  "H4",
                  "H3",
                  "H2",
                  "H1",
                  "H0",
                  "S4",
                  "S3",
                  "S2",
                  "S1",
                  "BE",
                  "BE5",
                  "EB",
                  "EB10",
                  "EB02",
                  "EBS"
                ]
              }
            },
            "freq_code": {
              "default": "A",
              "description": "Frequency: A annual (period YYYY), M monthly (period YYYYMM).\n\nProvider reference: allowed values [\"A\", \"M\"]; default \"A\".",
              "type": "string",
              "x-alexandria-option-metadata": {
                "in": "body",
                "oneOf": [
                  "A",
                  "M"
                ]
              }
            },
            "period": {
              "description": "Period(s) YYYY or YYYYMM, comma-separated; omit for every period. Pattern: ^\\d{4}(\\d{2})?(,\\d{4}(\\d{2})?)*$.",
              "type": "string",
              "x-alexandria-option-metadata": {
                "in": "body"
              }
            },
            "reporter_code": {
              "description": "UN M49 numeric reporter code(s), comma-separated (156 China, 842 USA, 276 Germany). Look codes up with reference_codes table=Reporters. Pattern: ^\\d{1,4}(,\\d{1,4})*$.",
              "type": "string"
            },
            "tariffline": {
              "description": "Query the tariffline dataset catalogue instead of the standard one.",
              "type": "boolean",
              "x-alexandria-option-metadata": {
                "in": "body"
              }
            },
            "type_code": {
              "default": "C",
              "description": "Type of trade: C commodities (goods), S services.\n\nProvider reference: allowed values [\"C\", \"S\"]; default \"C\".",
              "type": "string",
              "x-alexandria-option-metadata": {
                "in": "body",
                "oneOf": [
                  "C",
                  "S"
                ]
              }
            }
          },
          "required": [
            "reporter_code"
          ],
          "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/comtradeplus-un-org.json POST /apis/v1/comtradeplus-un-org/trade-statistics/data-availability
openapi: 3.1.0
info:
  description: ''
  title: UN Comtrade (comtradeplus.un.org)
  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:
    comtradeplus-un-org:
      description: ''
      title: UN Comtrade (comtradeplus.un.org)
      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: e3ef36bfa048f007a414dd876a78e26bb544fcd89067d4e79db632b2316176c1
        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/comtradeplus-un-org/trade-statistics/data-availability
    - /apis/v1/comtradeplus-un-org/trade-statistics/dataset-metadata
    - /apis/v1/comtradeplus-un-org/trade-statistics/mbs-series
    - /apis/v1/comtradeplus-un-org/trade-statistics/recent-releases
    - /apis/v1/comtradeplus-un-org/trade-statistics/reference-codes
    - /apis/v1/comtradeplus-un-org/trade-statistics/tariffline-data
    - /apis/v1/comtradeplus-un-org/trade-statistics/trade-data
    - /apis/v1/comtradeplus-un-org/trade-statistics/world-share
  x-aisa-document:
    composer_version: '31'
    document_hash: sha256:61d97ae3b5b006713a2f879e337298ca98fef5bc3c20e018a8778f9b6ea4616f
    facts_hash: e3ef36bfa048f007a414dd876a78e26bb544fcd89067d4e79db632b2316176c1
    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: comtradeplus-un-org
servers:
  - url: https://api.aisa.one
security:
  - bearerAuth: []
paths:
  /apis/v1/comtradeplus-un-org/trade-statistics/data-availability:
    post:
      tags:
        - UN Comtrade (comtradeplus.un.org)
      summary: Data availability
      description: >-
        Before pulling data: which years/months exist for a reporter, how many
        records each dataset has, when it was first and last released, which HS
        edition it uses. Also to resolve dataset_code values for
        dataset_metadata.
      operationId: comtradeplus-un-org.trade-statistics.data-availability
      requestBody:
        content:
          application/json:
            examples:
              provider:
                summary: >-
                  Official provider example; checked against AIsa request
                  constraints
                value:
                  period: 2012,2013,2014,2015,2016,2017,2018,2019
                  reporter_code: '156'
            schema:
              additionalProperties: true
              properties:
                classification:
                  default: HS
                  description: >-
                    Product classification in the URL path: HS (as reported, any
                    HS edition), H0-H6 (a specific HS edition), S1-S4 (SITC),
                    BE/BE5 (BEC), EB/EB10/EB02/EBS (EBOPS, services).


                    Provider reference: allowed values ["HS", "H6", "H5", "H4",
                    "H3", "H2", "H1", "H0", "S4", "S3", "S2", "S1", "BE", "BE5",
                    "EB", "EB10", "EB02", "EBS"]; default "HS".
                  type: string
                  x-alexandria-option-metadata:
                    in: body
                    oneOf:
                      - HS
                      - H6
                      - H5
                      - H4
                      - H3
                      - H2
                      - H1
                      - H0
                      - S4
                      - S3
                      - S2
                      - S1
                      - BE
                      - BE5
                      - EB
                      - EB10
                      - EB02
                      - EBS
                freq_code:
                  default: A
                  description: >-
                    Frequency: A annual (period YYYY), M monthly (period
                    YYYYMM).


                    Provider reference: allowed values ["A", "M"]; default "A".
                  type: string
                  x-alexandria-option-metadata:
                    in: body
                    oneOf:
                      - A
                      - M
                period:
                  description: >-
                    Period(s) YYYY or YYYYMM, comma-separated; omit for every
                    period. Pattern: ^\d{4}(\d{2})?(,\d{4}(\d{2})?)*$.
                  type: string
                  x-alexandria-option-metadata:
                    in: body
                reporter_code:
                  description: >-
                    UN M49 numeric reporter code(s), comma-separated (156 China,
                    842 USA, 276 Germany). Look codes up with reference_codes
                    table=Reporters. Pattern: ^\d{1,4}(,\d{1,4})*$.
                  type: string
                tariffline:
                  description: >-
                    Query the tariffline dataset catalogue instead of the
                    standard one.
                  type: boolean
                  x-alexandria-option-metadata:
                    in: body
                type_code:
                  default: C
                  description: |-
                    Type of trade: C commodities (goods), S services.

                    Provider reference: allowed values ["C", "S"]; default "C".
                  type: string
                  x-alexandria-option-metadata:
                    in: body
                    oneOf:
                      - C
                      - S
              required:
                - reporter_code
              type: object
        required: true
      responses:
        '200':
          content:
            application/json:
              examples:
                provider:
                  description: Published by the provider on 2026-10-19.
                  summary: Official provider example
                  value:
                    count: 8
                    datasets:
                      - classification_code: H4
                        dataset_code: '20156201201092100'
                        first_released: '2013-05-22T23:19:21.98'
                        freq_code: A
                        is_original_classification: true
                        last_released: '2013-05-22T23:19:21.98'
                        length_cmd_code: null
                        period: '2012'
                        reporter_code: 156
                        reporter_desc: China
                        reporter_iso: CHN
                        total_records: 696476
                        type_code: C
                      - classification_code: H4
                        dataset_code: '20156201301092100'
                        first_released: '2014-06-17T16:53:27.77'
                        freq_code: A
                        is_original_classification: true
                        last_released: '2014-06-17T16:53:27.77'
                        length_cmd_code: null
                        period: '2013'
                        reporter_code: 156
                        reporter_desc: China
                        reporter_iso: CHN
                        total_records: 709963
                        type_code: C
                      - classification_code: H4
                        dataset_code: '20156201401092100'
                        first_released: '2015-05-07T15:34:46.78'
                        freq_code: A
                        is_original_classification: true
                        last_released: '2017-06-28T16:19:59.03'
                        length_cmd_code: null
                        period: '2014'
                        reporter_code: 156
                        reporter_desc: China
                        reporter_iso: CHN
                        total_records: 730672
                        type_code: C
                      - classification_code: H4
                        dataset_code: '20156201501092100'
                        first_released: '2016-05-25T20:53:01.2733333'
                        freq_code: A
                        is_original_classification: true
                        last_released: '2017-06-29T02:31:54.9566667'
                        length_cmd_code: null
                        period: '2015'
                        reporter_code: 156
                        reporter_desc: China
                        reporter_iso: CHN
                        total_records: 2894591
                        type_code: C
                      - classification_code: H4
                        dataset_code: '20156201601092100'
                        first_released: '2017-05-26T04:00:52.57'
                        freq_code: A
                        is_original_classification: true
                        last_released: '2021-12-13T20:23:32.8933333'
                        length_cmd_code: null
                        period: '2016'
                        reporter_code: 156
                        reporter_desc: China
                        reporter_iso: CHN
                        total_records: 2991492
                        type_code: C
                      - classification_code: H5
                        dataset_code: '20156201701182100'
                        first_released: '2018-08-16T14:55:42.4666667'
                        freq_code: A
                        is_original_classification: true
                        last_released: '2018-08-16T14:55:42.4666667'
                        length_cmd_code: null
                        period: '2017'
                        reporter_code: 156
                        reporter_desc: China
                        reporter_iso: CHN
                        total_records: 3086454
                        type_code: C
                      - classification_code: H5
                        dataset_code: '20156201801182100'
                        first_released: '2019-11-03T17:39:20.5066667'
                        freq_code: A
                        is_original_classification: true
                        last_released: '2022-06-08T05:01:46.5066667'
                        length_cmd_code: null
                        period: '2018'
                        reporter_code: 156
                        reporter_desc: China
                        reporter_iso: CHN
                        total_records: 787828
                        type_code: C
                      - classification_code: H5
                        dataset_code: '20156201901182100'
                        first_released: '2020-10-27T04:41:22.7'
                        freq_code: A
                        is_original_classification: true
                        last_released: '2022-05-21T09:34:45.3933333'
                        length_cmd_code: null
                        period: '2019'
                        reporter_code: 156
                        reporter_desc: China
                        reporter_iso: CHN
                        total_records: 811658
                        type_code: C
                    observed_at_ms: 1792433666111
                    request:
                      classification: HS
                      freq_code: A
                      period: 2012,2013,2014,2015,2016,2017,2018,2019
                      reporter_code: '156'
                      type_code: C
                    source_url: >-
                      https://comtradeapi.un.org/public/v1/getDA/C/A/HS?reporterCode=156&period=2012%2C2013%2C2014%2C2015%2C2016%2C2017%2C2018%2C2019
              schema:
                not:
                  type: 'null'
                x-aisa-schema-completeness: documented-fields-only
          description: >-
            Which datasets UN Comtrade holds for a reporter, frequency,
            classification and period(s), with record counts, the HS edition
            actually reported and release dates (GET /public/v1/getDA or, with
            tariffline=true, /public/v1/getDATariffline). An empty list is a
            legitimate answer: nothing published for that selection.


            The response contains the tool result directly.


            | Documented field | Provider type | Description |

            | --- | --- | --- |

            | `count` | number |  |

            | `datasets` | object[] |  |

            | `observed_at_ms` | number | Unix milliseconds when this result was
            fetched. |

            | `request` | object | The selection as sent upstream (defaults
            filled in). |

            | `source_url` | string | The comtradeapi.un.org request that
            produced this result. |



            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.