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

# Exchange Volume Chart by ID

> To query the historical volume chart data with time in UNIX and trading volume data in BTC based on exchange's ID

export const CacheInfo = ({publicRate, paidRate, rate}) => {
  const fmt = v => v === 0 ? 'Real-time (Cacheless)' : `Every ${v}`;
  if (rate !== undefined) {
    return <Callout icon="clock-rotate-left" color="#2196F3" iconType="regular">
        <strong>Cache / Update Frequency:</strong><br />{fmt(rate)}
      </Callout>;
  }
  if (publicRate !== undefined && paidRate !== undefined) {
    return <Callout icon="clock-rotate-left" color="#2196F3" iconType="regular">
        <strong>Cache / Update Frequency:</strong><ul><li>{fmt(paidRate)} (Paid API)</li><li>{fmt(publicRate)} (Demo / Keyless API)</li></ul>
      </Callout>;
  }
  return null;
};

#### Notes

* Also works for derivatives exchanges (e.g. `bitmex`, `binance_futures`).
* Volume is provided in BTC. Use [Exchange Rates](/demo/reference/exchange-rates) to convert to other currencies.
* Auto-granularity (cannot be adjusted):
  * 1 day = 10-minutely
  * 7, 14 days = hourly
  * 30 days and above = daily

<CacheInfo rate="60 seconds" />

#### SDK Examples

<CodeGroup>
  ```typescript TypeScript theme={null}
  const response = await client.exchanges.volumeChart.get('binance', {
    days: '1',
  });

  console.log(JSON.stringify(response, null, 2));
  ```

  ```python Python theme={null}
  response = client.exchanges.volume_chart.get(
    "binance",
    days="1",
  )

  print(response)
  ```
</CodeGroup>


## OpenAPI

````yaml openapi-specs/demo-api.json get /exchanges/{id}/volume_chart
openapi: 3.0.0
info:
  title: CoinGecko Demo API
  version: 3.0.0
servers:
  - url: https://api.coingecko.com/api/v3
security:
  - headerAuth: []
  - queryAuth: []
paths:
  /exchanges/{id}/volume_chart:
    get:
      summary: Exchange Volume Chart by ID
      description: >-
        To query the historical volume chart data with time in UNIX and trading
        volume data in BTC based on exchange's ID
      operationId: exchanges-id-volume-chart
      parameters:
        - name: id
          in: path
          required: true
          description: >-
            Exchange ID or derivative exchange ID. 

            *refers to [`/exchanges/list`](/reference/exchanges-list) or
            [`/derivatives/exchanges/list`](/reference/derivatives-exchanges-list).
          schema:
            type: string
            default: binance
        - name: days
          in: query
          required: true
          description: Data up to number of days ago.
          schema:
            type: string
            default: '1'
            enum:
              - '1'
              - '7'
              - '14'
              - '30'
              - '90'
              - '180'
              - '365'
      responses:
        '200':
          description: Exchange volume chart data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExchangeVolumeChart'
              example:
                - - 1779719400000
                  - '76327.6889417086372104'
                - - 1779720000000
                  - '76335.761747668369059'
components:
  schemas:
    ExchangeVolumeChart:
      type: array
      description: Volume chart data points as [timestamp, volume_in_btc] pairs
      items:
        type: array
        items:
          oneOf:
            - type: number
            - type: string
  securitySchemes:
    headerAuth:
      type: apiKey
      in: header
      name: x-cg-demo-api-key
      description: >-
        Learn how to [set up your API
        key](https://docs.coingecko.com/docs/setting-up-your-api-key)
    queryAuth:
      type: apiKey
      in: query
      name: x_cg_demo_api_key
      description: >-
        Learn how to [set up your API
        key](https://docs.coingecko.com/docs/setting-up-your-api-key)

````