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

# Get candles

> Backtests and price history, e.g. 1-minute BTC-USD candles between two dates: call with `granularity: 60`, `start`, `end`, `max_candles: 3000`, then follow `next_start` until it is null.

## 请求规范

* **方法与路径:** POST /apis/v1/api-exchange-coinbase-com/markets/get-candles
* **可用状态:** enabled
* **请求 URL 模板:** `https://api.aisa.one/apis/v1/api-exchange-coinbase-com/markets/get-candles`

[完整 OpenAPI 定义](https://aisa.one/docs/openapi/zh/api-exchange-coinbase-com.json)

有效请求声明（包括认证和引用的 schema）：

```json theme={null}
{
  "operationId": "api-exchange-coinbase-com.markets.get-candles",
  "method": "POST",
  "path": "/apis/v1/api-exchange-coinbase-com/markets/get-candles",
  "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": {
              "end": "2026-08-22",
              "granularity": 86400,
              "product_id": "BTC-USD",
              "start": "2026-07-24"
            }
          }
        },
        "schema": {
          "additionalProperties": true,
          "properties": {
            "end": {
              "description": "Inclusive range end, same forms as `start`. Defaults to now.",
              "type": "string",
              "x-alexandria-option-metadata": {
                "in": "body"
              }
            },
            "granularity": {
              "default": 60,
              "description": "Bucket length in seconds: 60, 300, 900, 3600, 21600 or 86400.\n\nProvider reference: allowed values [\"60\", \"300\", \"900\", \"3600\", \"21600\", \"86400\"]; default 60.",
              "type": "number",
              "x-alexandria-option-metadata": {
                "in": "body",
                "oneOf": [
                  "60",
                  "300",
                  "900",
                  "3600",
                  "21600",
                  "86400"
                ]
              }
            },
            "max_candles": {
              "default": 300,
              "description": "Upper bound on buckets fetched in this call (300 per upstream request; requests are made sequentially to respect the 10 req/s public limit).\n\nProvider reference: minimum 1; maximum 3000; default 300.",
              "type": "number",
              "x-alexandria-option-metadata": {
                "in": "body",
                "max": 3000,
                "min": 1
              }
            },
            "product_id": {
              "description": "Trading pair id `BASE-QUOTE` as listed by `list_products`, e.g. `BTC-USD`, `USELESS-USD`. Case-insensitive; the canonical upper-case id is returned. Pattern: ^[A-Za-z0-9]{1,20}-[A-Za-z0-9]{1,20}$.",
              "type": "string"
            },
            "start": {
              "description": "Inclusive range start: RFC 3339 (`2026-07-24T00:00:00Z`) or a date (`2026-07-24`, midnight UTC). Defaults to `end` minus `max_candles` buckets.",
              "type": "string",
              "x-alexandria-option-metadata": {
                "in": "body"
              }
            }
          },
          "required": [
            "product_id"
          ],
          "type": "object"
        }
      }
    },
    "required": true
  },
  "x-aisa-status": "enabled",
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "scheme": "bearer",
        "type": "http"
      }
    }
  }
}
```

## 费用与请求规则

按实际用量收费。 默认请求预估费用：\$0.0005 USD。 最终费用以实际用量为准。 账户适用价格可能不同；支持报价的接口可按实际请求获取报价。


## OpenAPI

````yaml openapi/zh/api-exchange-coinbase-com.json POST /apis/v1/api-exchange-coinbase-com/markets/get-candles
openapi: 3.1.0
info:
  description: ''
  title: Coinbase Exchange
  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:
    api-exchange-coinbase-com:
      description: ''
      title: Coinbase Exchange
      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: 98886532755d0ccfd5be075974252658edca439cb28857f87a5c351a56feb1aa
        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/api-exchange-coinbase-com/markets/get-candles
    - /apis/v1/api-exchange-coinbase-com/markets/get-currency
    - /apis/v1/api-exchange-coinbase-com/markets/get-order-book
    - /apis/v1/api-exchange-coinbase-com/markets/get-product
    - /apis/v1/api-exchange-coinbase-com/markets/get-ticker
    - /apis/v1/api-exchange-coinbase-com/markets/get-wrapped-asset
    - /apis/v1/api-exchange-coinbase-com/markets/list-currencies
    - /apis/v1/api-exchange-coinbase-com/markets/list-products
    - /apis/v1/api-exchange-coinbase-com/markets/list-trades
    - /apis/v1/api-exchange-coinbase-com/markets/list-volume-summary
  x-aisa-document:
    composer_version: '31'
    document_hash: sha256:a32c032110fa3d3617775b7ea1a06dd6c914c876620f35c756423088b2831b02
    facts_hash: 98886532755d0ccfd5be075974252658edca439cb28857f87a5c351a56feb1aa
    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: api-exchange-coinbase-com
servers:
  - url: https://api.aisa.one
security:
  - bearerAuth: []
paths:
  /apis/v1/api-exchange-coinbase-com/markets/get-candles:
    post:
      tags:
        - Coinbase Exchange
      summary: Get candles
      description: >-
        Backtests and price history, e.g. 1-minute BTC-USD candles between two
        dates: call with `granularity: 60`, `start`, `end`, `max_candles: 3000`,
        then follow `next_start` until it is null.
      operationId: api-exchange-coinbase-com.markets.get-candles
      requestBody:
        content:
          application/json:
            examples:
              provider:
                summary: >-
                  Official provider example; checked against AIsa request
                  constraints
                value:
                  end: '2026-08-22'
                  granularity: 86400
                  product_id: BTC-USD
                  start: '2026-07-24'
            schema:
              additionalProperties: true
              properties:
                end:
                  description: Inclusive range end, same forms as `start`. Defaults to now.
                  type: string
                  x-alexandria-option-metadata:
                    in: body
                granularity:
                  default: 60
                  description: >-
                    Bucket length in seconds: 60, 300, 900, 3600, 21600 or
                    86400.


                    Provider reference: allowed values ["60", "300", "900",
                    "3600", "21600", "86400"]; default 60.
                  type: number
                  x-alexandria-option-metadata:
                    in: body
                    oneOf:
                      - '60'
                      - '300'
                      - '900'
                      - '3600'
                      - '21600'
                      - '86400'
                max_candles:
                  default: 300
                  description: >-
                    Upper bound on buckets fetched in this call (300 per
                    upstream request; requests are made sequentially to respect
                    the 10 req/s public limit).


                    Provider reference: minimum 1; maximum 3000; default 300.
                  type: number
                  x-alexandria-option-metadata:
                    in: body
                    max: 3000
                    min: 1
                product_id:
                  description: >-
                    Trading pair id `BASE-QUOTE` as listed by `list_products`,
                    e.g. `BTC-USD`, `USELESS-USD`. Case-insensitive; the
                    canonical upper-case id is returned. Pattern:
                    ^[A-Za-z0-9]{1,20}-[A-Za-z0-9]{1,20}$.
                  type: string
                start:
                  description: >-
                    Inclusive range start: RFC 3339 (`2026-07-24T00:00:00Z`) or
                    a date (`2026-07-24`, midnight UTC). Defaults to `end` minus
                    `max_candles` buckets.
                  type: string
                  x-alexandria-option-metadata:
                    in: body
              required:
                - product_id
              type: object
        required: true
      responses:
        '200':
          content:
            application/json:
              examples:
                provider:
                  description: Published by the provider on 2026-09-24.
                  summary: Official provider example
                  value:
                    candles:
                      - close: 64083.32
                        high: 65762.78
                        low: 63641
                        open: 65051.24
                        time: 1784851200
                        time_iso: '2026-07-24T00:00:00Z'
                        volume: 7327.49813634
                      - close: 64295.61
                        high: 64387.43
                        low: 63732
                        open: 64083.31
                        time: 1784937600
                        time_iso: '2026-07-25T00:00:00Z'
                        volume: 2180.46852205
                      - close: 65341.07
                        high: 65511.36
                        low: 64229.6
                        open: 64295.61
                        time: 1785024000
                        time_iso: '2026-07-26T00:00:00Z'
                        volume: 2390.56790196
                      - close: 63694.43
                        high: 65705.08
                        low: 63545
                        open: 65341.07
                        time: 1785110400
                        time_iso: '2026-07-27T00:00:00Z'
                        volume: 5069.45269918
                      - close: 63847.12
                        high: 64041.02
                        low: 62645.39
                        open: 63693.44
                        time: 1785196800
                        time_iso: '2026-07-28T00:00:00Z'
                        volume: 6232.18054403
                      - close: 63896.14
                        high: 64665.3
                        low: 63194.45
                        open: 63847.12
                        time: 1785283200
                        time_iso: '2026-07-29T00:00:00Z'
                        volume: 8092.70552294
                      - close: 64721.9
                        high: 65118.08
                        low: 63502.91
                        open: 63896.14
                        time: 1785369600
                        time_iso: '2026-07-30T00:00:00Z'
                        volume: 8025.87127027
                      - close: 62825.9
                        high: 65360
                        low: 62358.96
                        open: 64721.9
                        time: 1785456000
                        time_iso: '2026-07-31T00:00:00Z'
                        volume: 8260.37090197
                      - close: 62764.2
                        high: 63093
                        low: 62209.81
                        open: 62826.69
                        time: 1785542400
                        time_iso: '2026-08-01T00:00:00Z'
                        volume: 3060.55404241
                      - close: 63499.49
                        high: 63730.49
                        low: 62743.87
                        open: 62764.2
                        time: 1785628800
                        time_iso: '2026-08-02T00:00:00Z'
                        volume: 3283.94724012
                      - close: 63466.51
                        high: 64032.43
                        low: 62210.14
                        open: 63499.49
                        time: 1785715200
                        time_iso: '2026-08-03T00:00:00Z'
                        volume: 7086.70328594
                      - close: 64050.51
                        high: 64497.24
                        low: 63250
                        open: 63466.51
                        time: 1785801600
                        time_iso: '2026-08-04T00:00:00Z'
                        volume: 6227.77436334
                      - close: 64603.03
                        high: 64988.78
                        low: 63814.8
                        open: 64050.51
                        time: 1785888000
                        time_iso: '2026-08-05T00:00:00Z'
                        volume: 6932.34404967
                      - close: 64267.3
                        high: 64944.16
                        low: 64087.41
                        open: 64603.02
                        time: 1785974400
                        time_iso: '2026-08-06T00:00:00Z'
                        volume: 4520.43206155
                      - close: 64891.61
                        high: 65348.97
                        low: 64099.35
                        open: 64267.3
                        time: 1786060800
                        time_iso: '2026-08-07T00:00:00Z'
                        volume: 6181.48293213
                      - close: 64908.72
                        high: 65150.16
                        low: 64789.89
                        open: 64891.6
                        time: 1786147200
                        time_iso: '2026-08-08T00:00:00Z'
                        volume: 2494.26436439
                      - close: 64848.69
                        high: 65426
                        low: 64675.22
                        open: 64908.71
                        time: 1786233600
                        time_iso: '2026-08-09T00:00:00Z'
                        volume: 3044.21136585
                      - close: 63911.88
                        high: 65341.83
                        low: 63733.03
                        open: 64848.68
                        time: 1786320000
                        time_iso: '2026-08-10T00:00:00Z'
                        volume: 6197.02944527
                      - close: 63531.75
                        high: 64439.38
                        low: 63158
                        open: 63911.88
                        time: 1786406400
                        time_iso: '2026-08-11T00:00:00Z'
                        volume: 6020.29333133
                      - close: 63411.72
                        high: 64416.3
                        low: 63235.88
                        open: 63531.75
                        time: 1786492800
                        time_iso: '2026-08-12T00:00:00Z'
                        volume: 6570.08215862
                      - close: 63425.35
                        high: 63949.9
                        low: 62772.84
                        open: 63411.71
                        time: 1786579200
                        time_iso: '2026-08-13T00:00:00Z'
                        volume: 5119.66743787
                      - close: 62975.19
                        high: 63561.45
                        low: 62468.21
                        open: 63425.35
                        time: 1786665600
                        time_iso: '2026-08-14T00:00:00Z'
                        volume: 5116.86738135
                      - close: 63018.75
                        high: 63123.68
                        low: 62830.01
                        open: 62975.18
                        time: 1786752000
                        time_iso: '2026-08-15T00:00:00Z'
                        volume: 1233.57820711
                      - close: 62836.66
                        high: 63318.09
                        low: 62631.18
                        open: 63018.75
                        time: 1786838400
                        time_iso: '2026-08-16T00:00:00Z'
                        volume: 1794.19400235
                      - close: 64484.18
                        high: 64588
                        low: 62679.42
                        open: 62836.67
                        time: 1786924800
                        time_iso: '2026-08-17T00:00:00Z'
                        volume: 6069.64648358
                      - close: 64681.33
                        high: 65020
                        low: 63979.36
                        open: 64477.26
                        time: 1787011200
                        time_iso: '2026-08-18T00:00:00Z'
                        volume: 5099.57954731
                      - close: 69300.01
                        high: 70022.44
                        low: 64112.04
                        open: 64681.33
                        time: 1787097600
                        time_iso: '2026-08-19T00:00:00Z'
                        volume: 16917.83327784
                      - close: 73011.87
                        high: 73391.43
                        low: 68853.22
                        open: 69300.01
                        time: 1787184000
                        time_iso: '2026-08-20T00:00:00Z'
                        volume: 16155.04322781
                      - close: 78325.54
                        high: 79500
                        low: 73004.7
                        open: 73010.86
                        time: 1787270400
                        time_iso: '2026-08-21T00:00:00Z'
                        volume: 20245.16913846
                      - close: 77054.44
                        high: 78828.37
                        low: 76471.7
                        open: 78325.54
                        time: 1787356800
                        time_iso: '2026-08-22T00:00:00Z'
                        volume: 5400.20084011
                    count: 30
                    end: '2026-08-22T00:00:00Z'
                    expected_buckets: 30
                    granularity: 86400
                    next_start: null
                    observed_at_ms: 1790268751183
                    product_id: BTC-USD
                    request_count: 1
                    source_url: >-
                      https://api.exchange.coinbase.com/products/BTC-USD/candles?granularity=86400&start=2026-07-24T00%3A00%3A00Z&end=2026-08-22T00%3A00%3A00Z
                    start: '2026-07-24T00:00:00Z'
              schema:
                not:
                  type: 'null'
                x-aisa-schema-completeness: documented-fields-only
          description: >-
            Historical OHLCV candles for one trading pair (`GET
            /products/{product_id}/candles`) at 1m, 5m, 15m, 1h, 6h or 1d
            granularity, oldest first. The exchange serves at most 300 buckets
            per request, so a wider `start`..`end` range is walked in
            consecutive 300-bucket windows, up to `max_candles` (default 300,
            max 3000 = 10 upstream requests) per call; `next_start` continues
            where the call stopped. Buckets without trades are omitted by the
            exchange (thin markets return fewer rows than the window length; a
            `sparse_buckets` warning says so). Values are numbers as the
            exchange sends them.


            The response contains the tool result directly.


            The provider identifies `candles` as the primary payload key.


            | Documented field | Provider type | Description |

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

            | `close` | number |  |

            | `high` | number |  |

            | `low` | number |  |

            | `open` | number |  |

            | `time` | number | Bucket start, Unix seconds, aligned to the
            granularity. |

            | `time_iso` | string | Bucket start, RFC 3339 UTC (derived from
            `time`). |

            | `volume` | number | Base-currency volume traded in the bucket. |



            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.