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

# Global Market Cap Chart Data

> To query historical global market cap and volume data by number of days away from now

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;
};

export const PlanExclusivity = ({tier}) => {
  if (tier === "enterprise") {
    return <Callout icon="crown" color="#FFC107" iconType="regular">
        <strong>Enterprise Only</strong><br />This endpoint is exclusively available to <strong>Enterprise</strong> plan.<br /><a href="https://www.coingecko.com/en/api/enterprise">→ Contact sales</a>
      </Callout>;
  }
  if (tier === "analyst_above") {
    return <Callout icon="briefcase" color="#FFC107" iconType="regular">
        <strong>Analyst Plan and Above</strong><br />This endpoint is only available to <strong>Analyst, Lite, Pro, and Enterprise</strong> plan.<br /><a href="https://www.coingecko.com/en/api/pricing">→ View pricing</a>
      </Callout>;
  }
  if (tier === "basic_above") {
    return <Callout icon="briefcase" color="#FFC107" iconType="regular">
        <strong>Basic Plan and Above</strong><br />This endpoint is only available to <strong>Basic, Analyst, Lite, Pro, and Enterprise</strong> plan.<br /><a href="https://www.coingecko.com/en/api/pricing">→ View pricing</a>
      </Callout>;
  }
  throw new Error(`PlanExclusivity: invalid tier "${tier}". Use "basic_above", "analyst_above", or "enterprise".`);
};

#### Notes

* Auto-granularity:
  * 1 day = **hourly** data
  * 2 days and above = **daily** data
* Equivalent page on [CoinGecko Global Charts](https://www.coingecko.com/en/global-charts).

<Note>
  The last completed UTC day (00:00) is available 5 minutes after midnight (00:05 UTC). Cache always expires at 00:05 UTC.
</Note>

<PlanExclusivity tier="analyst_above" />

<CacheInfo rate="60 seconds" />

#### SDK Examples

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

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

  ```python Python theme={null}
  response = client.global_.market_cap_chart.get(
    days="1",
  )

  print(response.model_dump_json(indent=2))
  ```
</CodeGroup>


## OpenAPI

````yaml openapi-specs/pro-api.json get /global/market_cap_chart
openapi: 3.0.0
info:
  title: CoinGecko Pro API
  version: 3.0.0
servers:
  - url: https://pro-api.coingecko.com/api/v3
security:
  - headerAuth: []
  - queryAuth: []
paths:
  /global/market_cap_chart:
    get:
      summary: Global Market Cap Chart Data
      description: >-
        To query historical global market cap and volume data by number of days
        away from now
      operationId: global-market-cap-chart
      parameters:
        - 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'
              - max
        - name: vs_currency
          in: query
          required: false
          description: >-
            Target currency of market cap. 

            Default: `usd` 

            *refers to
            [`/simple/supported_vs_currencies`](/reference/simple-supported-currencies).
          schema:
            type: string
      responses:
        '200':
          description: Global market cap chart data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GlobalMarketCapChart'
              example:
                market_cap_chart:
                  market_cap:
                    - - 1779796800798
                      - 2655918998143.8896
                    - - 1779800404411
                      - 2654923308819.0776
                  volume:
                    - - 1779796800798
                      - 72758388801.76349
                    - - 1779800404411
                      - 73764769476.6961
components:
  schemas:
    GlobalMarketCapChart:
      type: object
      required:
        - market_cap_chart
      properties:
        market_cap_chart:
          type: object
          required:
            - market_cap
            - volume
          properties:
            market_cap:
              type: array
              description: Market cap data as [timestamp, market_cap] pairs
              items:
                type: array
                items:
                  type: number
            volume:
              type: array
              description: Volume data as [timestamp, volume] pairs
              items:
                type: array
                items:
                  type: number
  securitySchemes:
    headerAuth:
      type: apiKey
      in: header
      name: x-cg-pro-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_pro_api_key
      description: >-
        Learn how to [set up your API
        key](https://docs.coingecko.com/docs/setting-up-your-api-key)

````