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

# Crypto Treasury Holdings Historical Chart Data by ID

> To query historical cryptocurrency holdings chart of public companies and governments by entity ID and coin 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

* Find entity IDs via [Entities List](/demo/reference/entities-list) and coin IDs via [Coins List](/demo/reference/coins-list).

* Data available from August 2020 onwards.

* Historical access varies by plan:

  | Plan               | Maximum period | `days` values                       |
  | ------------------ | -------------- | ----------------------------------- |
  | Demo / Keyless API | 1 year         | `7, 14, 30, 90, 180, 365`           |
  | Basic              | 2 years        | `7, 14, 30, 90, 180, 365, 730`      |
  | Analyst and above  | Full           | `7, 14, 30, 90, 180, 365, 730, max` |

  To access longer historical periods, subscribe to a [paid plan](https://www.coingecko.com/en/api/pricing).

* `include_empty_intervals=false` (default): only intervals with transactions. Set to `true` to return all intervals, filled with the most recent data.

* Equivalent page on [CoinGecko Strategy Treasury](https://www.coingecko.com/en/treasuries/companies/strategy).

<CacheInfo rate="5 minutes" />

#### SDK Examples

<CodeGroup>
  ```typescript TypeScript theme={null}
  const response = await client.publicTreasury.getHoldingChart('bitcoin', {
    entity_id: 'strategy',
    days: '365',
  });

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

  ```python Python theme={null}
  response = client.public_treasury.get_holding_chart(
    "bitcoin",
    entity_id="strategy",
    days="365",
  )

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


## OpenAPI

````yaml openapi-specs/demo-api.json get /public_treasury/{entity_id}/{coin_id}/holding_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:
  /public_treasury/{entity_id}/{coin_id}/holding_chart:
    get:
      summary: Crypto Treasury Holdings Historical Chart Data by ID
      description: >-
        To query historical cryptocurrency holdings chart of public companies
        and governments by entity ID and coin ID
      operationId: public-treasury-entity-chart
      parameters:
        - name: entity_id
          in: path
          required: true
          description: |-
            Public company or government entity ID. 
            *refers to [`/entities/list`](/reference/entities-list).
          schema:
            type: string
            default: strategy
        - name: coin_id
          in: path
          required: true
          description: |-
            Coin ID. 
            e.g. `bitcoin`, `ethereum`, `solana`, `binancecoin`
          schema:
            type: string
            default: bitcoin
        - name: days
          in: query
          required: true
          description: |-
            Data up to number of days ago. 
            Valid values: `7`, `14`, `30`, `90`, `180`, `365`
          schema:
            type: string
            default: '365'
        - name: include_empty_intervals
          in: query
          required: false
          description: |-
            Include empty intervals with no transaction data. 
            Default: `false`
          schema:
            type: boolean
      responses:
        '200':
          description: Crypto treasury holdings historical chart data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicTreasuryEntityChart'
              example:
                holdings:
                  - - 1748736000000
                    - 580955
                  - - 1749340800000
                    - 582000
                holding_value_in_usd:
                  - - 1748736000000
                    - 60818730878.617355
                  - - 1749340800000
                    - 61506606585.45032
components:
  schemas:
    PublicTreasuryEntityChart:
      type: object
      required:
        - holdings
        - holding_value_in_usd
      properties:
        holdings:
          type: array
          description: Historical holdings data as [timestamp, amount] pairs
          items:
            type: array
            items:
              type: number
        holding_value_in_usd:
          type: array
          description: Historical holdings value in USD as [timestamp, value_usd] pairs
          items:
            type: array
            items:
              type: number
  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)

````