> ## 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 by Entity ID

> To query public companies' and governments' cryptocurrency holdings by entity 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;
};

<Tip>
  Equivalent page on [CoinGecko Bitcoin Treasuries](https://www.coingecko.com/en/treasuries/bitcoin).
</Tip>

<CacheInfo rate="5 minutes" />

#### SDK Examples

<CodeGroup>
  ```typescript TypeScript theme={null}
  const response = await client.publicTreasury.getEntityID('strategy');

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

  ```python Python theme={null}
  response = client.public_treasury.get_entity_id("strategy")

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


## OpenAPI

````yaml openapi-specs/demo-api.json get /public_treasury/{entity_id}
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}:
    get:
      summary: Crypto Treasury Holdings by Entity ID
      description: >-
        To query public companies' and governments' cryptocurrency holdings by
        entity ID
      operationId: public-treasury-entity
      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: holding_amount_change
          in: query
          required: false
          description: >-
            Include holding amount change for specified timeframes,
            comma-separated if querying more than 1 timeframe. 

            Valid values: `7d`, `14d`, `30d`, `90d`, `1y`, `ytd`
          schema:
            type: string
        - name: holding_change_percentage
          in: query
          required: false
          description: >-
            Include holding change percentage for specified timeframes,
            comma-separated if querying more than 1 timeframe. 

            Valid values: `7d`, `14d`, `30d`, `90d`, `1y`, `ytd`
          schema:
            type: string
      responses:
        '200':
          description: Public company or government crypto treasury holdings data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicTreasuryEntity'
              example:
                name: Strategy
                id: strategy
                type: company
                symbol: MSTR.US
                country: US
                website_url: https://www.strategy.com/
                twitter_screen_name: Strategy
                total_treasury_value_usd: 64383151578.86817
                unrealized_pnl: 513095879.8681717
                m_nav: 1.03
                total_asset_value_per_share_usd: 179.74079167746558
                holdings:
                  - coin_id: bitcoin
                    amount: 843738
                    percentage_of_total_supply: 4.018
                    amount_per_share: 0.002355494137353434
                    entity_value_usd_percentage: 100
                    current_value_usd: 64383151578.86817
                    total_entry_value_usd: 63870055699
                    average_entry_value_usd: 75698.9203982753
                    unrealized_pnl: 513095879.8681717
                    holding_amount_change:
                      7d: 0
                      14d: 24869
                      30d: 28677
                      90d: 126016
                      1y: 263488
                      ytd: 171238
                    holding_change_percentage:
                      7d: 0
                      14d: 3.037
                      30d: 3.518
                      90d: 17.558
                      1y: 45.409
                      ytd: 25.463
components:
  schemas:
    PublicTreasuryEntity:
      type: object
      required:
        - name
        - id
        - type
        - symbol
        - country
        - website_url
        - twitter_screen_name
        - total_treasury_value_usd
        - unrealized_pnl
        - m_nav
        - total_asset_value_per_share_usd
        - holdings
      properties:
        name:
          type: string
          description: Entity name
        id:
          type: string
          description: Entity ID
        type:
          type: string
          description: 'Entity type: company or government'
        symbol:
          type: string
          nullable: true
          description: Stock market ticker symbol
        country:
          type: string
          description: Country code
        website_url:
          type: string
          description: Official website URL
        twitter_screen_name:
          type: string
          description: Official Twitter handle
        total_treasury_value_usd:
          type: number
          description: Total current value of all holdings in USD
        unrealized_pnl:
          type: number
          description: Unrealized profit and loss (current value minus total entry value)
        m_nav:
          type: number
          description: Market to net asset value ratio
        total_asset_value_per_share_usd:
          type: number
          description: Total asset value per share in USD
        holdings:
          type: array
          description: List of cryptocurrency assets held by the entity
          items:
            type: object
            required:
              - coin_id
              - amount
              - percentage_of_total_supply
              - amount_per_share
              - entity_value_usd_percentage
              - current_value_usd
              - total_entry_value_usd
              - average_entry_value_usd
              - unrealized_pnl
            properties:
              coin_id:
                type: string
                description: Coin ID
              amount:
                type: number
                description: Amount of cryptocurrency held
              percentage_of_total_supply:
                type: number
                description: Percentage of total crypto supply
              amount_per_share:
                type: number
                description: Amount of cryptocurrency per share
              entity_value_usd_percentage:
                type: number
                description: Percentage of entity's total treasury value
              current_value_usd:
                type: number
                description: Current value of holdings in USD
              total_entry_value_usd:
                type: number
                description: Total entry cost in USD
              average_entry_value_usd:
                type: number
                description: Average entry cost per unit in USD
              unrealized_pnl:
                type: number
                description: Unrealized profit and loss for this holding
              holding_amount_change:
                type: object
                description: Holding amount changes over different timeframes
                properties:
                  7d:
                    type: number
                    x-stainless-naming:
                      python:
                        property_name: period_7d
                  14d:
                    type: number
                    x-stainless-naming:
                      python:
                        property_name: period_14d
                  30d:
                    type: number
                    x-stainless-naming:
                      python:
                        property_name: period_30d
                  90d:
                    type: number
                    x-stainless-naming:
                      python:
                        property_name: period_90d
                  1y:
                    type: number
                    x-stainless-naming:
                      python:
                        property_name: period_1y
                  ytd:
                    type: number
              holding_change_percentage:
                type: object
                description: Holding change percentages over different timeframes
                properties:
                  7d:
                    type: number
                    x-stainless-naming:
                      python:
                        property_name: period_7d
                  14d:
                    type: number
                    x-stainless-naming:
                      python:
                        property_name: period_14d
                  30d:
                    type: number
                    x-stainless-naming:
                      python:
                        property_name: period_30d
                  90d:
                    type: number
                    x-stainless-naming:
                      python:
                        property_name: period_90d
                  1y:
                    type: number
                    x-stainless-naming:
                      python:
                        property_name: period_1y
                  ytd:
                    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)

````