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

# Get Coins Charts

> Get historical chart data for multiple cryptocurrencies

<Note>**3** credits per request</Note><Accordion title="Multipliers" icon="rectangle-history-circle-plus"><Note>In **Query** field **"coinIds"**: credits are multiplied by the number of values.</Note><Info>[**Detailed multipliers explanation**](/multipliers)</Info></Accordion><hr />

<AccordionGroup>
  <Accordion title="You will get">
    * Historical price data
    * Values in USD, BTC, ETH
  </Accordion>

  <Accordion title="Required">
    * coinIds: Comma-separated list of coin identifiers. At least one is required.
  </Accordion>

  <Accordion title="Optional">
    * type: Time range for the chart data.
  </Accordion>
</AccordionGroup>


## OpenAPI

````yaml /api-reference/openapi.json get /v1/coins/charts
openapi: 3.0.0
info:
  title: CoinStats Public API
  description: >-
    CoinStats Public API — programmatic access to market data, news, NFTs,
    wallets, exchange connections, and user portfolios. Authenticate every
    request with the `X-API-KEY` header (or an OAuth Bearer token in the
    `Authorization` header). Generate keys at https://openapi.coinstats.app.
  version: '1.0'
  contact: {}
servers:
  - url: https://openapiv1.coinstats.app
security: []
tags:
  - name: CoinStats
    description: ''
  - name: Market Data
    description: >-
      The Market Data section of the API provides endpoints to access a wide
      range of market-related information, including cryptocurrency coins,
      ticker data, and fiat currency rates. This category offers comprehensive
      data to help users monitor and analyze the cryptocurrency market, track
      prices, and gain insights into market trends
  - name: News
    description: >-
      The News section of the API allows you to access news articles and updates
      related to cryptocurrencies and the blockchain industry. It provides
      valuable information from various sources to keep you informed about the
      latest developments
  - name: NFTs
    description: >-
      The NFT section of the API provides endpoints to interact with
      Non-Fungible Tokens (NFTs), which are unique digital assets stored on a
      blockchain. These endpoints allow you to retrieve information about NFTs,
      including collections, assets, trending NFTs, and specific assets
      associated with wallet addresses.
  - name: Wallet Data
    description: >-
      The Wallet section of the API provides a comprehensive set of endpoints to
      manage and interact with wallets. It enables users to retrieve wallet
      balances, monitor syncing status, fetch transaction data, and synchronize
      wallet information with the blockchain. By integrating these endpoints
      into your application, you can offer robust wallet functionality to your
      users.
  - name: Exchange Connection
    description: >-
      The Exchange Connection section of the API provides a comprehensive set of
      endpoints to manage and interact with exchanges. It enables users to
      retrieve exchange balances, monitor syncing status, fetch transaction
      data. By integrating these endpoints into your application, you can offer
      robust exchange portfolio tracking functionality to your users.
  - name: User Portfolio
    description: >-
      The Portfolio section of the API provides a comprehensive set of endpoints
      to manage and interact with Share Portfolios. It enables users to retrieve
      current Portfolio Coins and Transactions.
  - name: Usage
    description: The Usage section provides account-level API usage data.
  - name: Status
    description: The Status section provides API availability checks.
paths:
  /v1/coins/charts:
    get:
      tags:
        - Market Data
      summary: Get historical chart data for multiple cryptocurrencies
      operationId: get-coins-charts
      parameters:
        - name: period
          required: true
          in: query
          description: Time period for the chart data.
          schema:
            default: 24h
            example: 24h
            type: string
            enum:
              - all
              - 24h
              - 1w
              - 1m
              - 3m
              - 6m
              - 1y
        - name: coinIds
          required: true
          in: query
          description: Comma-separated list of coin identifiers to fetch chart data for
          schema:
            default: bitcoin,ethereum
            example: bitcoin,ethereum,dogecoin
            type: string
      responses:
        '200':
          description: Get Historical global avg price charts for multiple coins.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/CoinsChartsResponseDto'
        '400':
          description: Bad Request
          content:
            application/json:
              example:
                statusCode: 400
                message: Bad Request
                requestId: 11111111-2222-3333-4444-555555555555
                path: <requested-endpoint>
        '401':
          description: Unauthorized
          content:
            application/json:
              example:
                statusCode: 401
                message: Unauthorized
                requestId: 11111111-2222-3333-4444-555555555555
                path: <requested-endpoint>
        '403':
          description: Forbidden
          content:
            application/json:
              example:
                statusCode: 403
                message: Forbidden
                requestId: 11111111-2222-3333-4444-555555555555
                path: <requested-endpoint>
        '404':
          description: Not Found
          content:
            application/json:
              example:
                statusCode: 404
                message: Not Found
                requestId: 11111111-2222-3333-4444-555555555555
                path: <requested-endpoint>
        '409':
          description: Conflict (for some endpoints)
          content:
            application/json:
              example:
                statusCode: 409
                message: Transactions not synced
                requestId: 11111111-2222-3333-4444-555555555555
                path: <requested-endpoint>
        '429':
          description: Too Many Requests
          content:
            application/json:
              example:
                statusCode: 429
                message: Rate limit exceeded
                requestId: 11111111-2222-3333-4444-555555555555
                path: <requested-endpoint>
        '503':
          description: Service Unavailable
          content:
            application/json:
              example:
                statusCode: 503
                message: Service Unavailable. Please Contact Support
      security:
        - X-API-KEY: []
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl --request GET \
              --url 'https://openapiv1.coinstats.app/v1/coins/charts?period=24h&coinIds=bitcoin,ethereum,dogecoin' \
              --header 'X-API-KEY: <api-key>'
        - lang: python
          label: Python
          source: >-
            import requests


            url =
            "https://openapiv1.coinstats.app/v1/coins/charts?period=24h&coinIds=bitcoin,ethereum,dogecoin"


            headers = {"X-API-KEY": "<api-key>"}


            response = requests.request("GET", url, headers=headers)


            print(response.json())
        - lang: javascript
          label: JavaScript
          source: >-
            const options = {method: 'GET', headers: {'X-API-KEY':
            '<api-key>'}};


            fetch('https://openapiv1.coinstats.app/v1/coins/charts?period=24h&coinIds=bitcoin,ethereum,dogecoin',
            options)
              .then((response) => response.json())
              .then((response) => console.log(response))
              .catch((err) => console.error(err));
        - lang: php
          label: PHP
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://openapiv1.coinstats.app/v1/coins/charts?period=24h&coinIds=bitcoin,ethereum,dogecoin",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "X-API-KEY: <api-key>"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: go
          label: Go
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n)\n\nfunc main() {\n\n\turl := \"https://openapiv1.coinstats.app/v1/coins/charts?period=24h&coinIds=bitcoin,ethereum,dogecoin\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"X-API-KEY\", \"<api-key>\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := io.ReadAll(res.Body)\n\n\tfmt.Println(string(body))\n}"
        - lang: java
          label: Java
          source: >-
            HttpResponse<String> response =
            Unirest.get("https://openapiv1.coinstats.app/v1/coins/charts?period=24h&coinIds=bitcoin,ethereum,dogecoin")
              .header("X-API-KEY", "<api-key>")
              .asString();
components:
  schemas:
    CoinsChartsResponseDto:
      type: object
      properties:
        coinId:
          type: string
          description: Unique identifier of the cryptocurrency
          example: bitcoin
        chart:
          type: array
          description: >-
            Array of historical price data points. Each data point is an array
            containing:

            1. TIMESTAMP - Unix timestamp in seconds

            2. USD - Price in USD

            3. BTC - Price in Bitcoin

            4. ETH - Price in Ethereum
          items:
            type: array
            items:
              type: number
          example:
            - - 1438905600
              - 2.83162
              - 0.0101411
              - 1
            - - 1438992000
              - 2.7976
              - 0.0100039
              - 1
            - - 1439078400
              - 2.8091
              - 0.0102231
              - 1
        errorMessage:
          type: string
          description: >-
            Error message if data fetching failed for this specific coin. This
            allows partial success responses where some coins data is available
            while others failed.
          example: ERR_COIN_CHART_NOT_FOUND
      required:
        - coinId
        - chart
  securitySchemes:
    X-API-KEY:
      type: apiKey
      in: header
      name: X-API-KEY
      description: >-
        API key required to access the endpoints. Generate one from your
        dashboard at https://openapi.coinstats.app and pass it in the
        `X-API-KEY` request header. Never expose your key in client-side code.

````