> ## 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 Coin ID

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

* Results are sorted by total holdings in descending order.
* Equivalent page on [CoinGecko Bitcoin Treasuries](https://www.coingecko.com/en/treasuries/bitcoin).

<CacheInfo rate="5 minutes" />

#### SDK Examples

<CodeGroup>
  ```typescript TypeScript theme={null}
  const response = await client.publicTreasury.getCoinID('bitcoin', {
    entity: 'companies',
  });

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

  ```python Python theme={null}
  response = client.public_treasury.get_coin_id(
    "bitcoin",
    entity="companies",
  )

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


## OpenAPI

````yaml openapi-specs/demo-api.json get /{entity}/public_treasury/{coin_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:
  /{entity}/public_treasury/{coin_id}:
    get:
      summary: Crypto Treasury Holdings by Coin ID
      description: >-
        To query public companies' and governments' cryptocurrency holdings by
        coin ID
      operationId: companies-public-treasury
      parameters:
        - name: entity
          in: path
          required: true
          description: Public company or government entity.
          schema:
            type: string
            default: companies
            enum:
              - companies
              - governments
        - name: coin_id
          in: path
          required: true
          description: |-
            Coin ID. 
            e.g. `bitcoin`, `ethereum`, `solana`, `binancecoin`
          schema:
            type: string
            default: bitcoin
        - name: per_page
          in: query
          required: false
          description: |-
            Total results per page. 
            Default value: 250 
            Valid values: 1...250
          schema:
            type: integer
        - name: page
          in: query
          required: false
          description: |-
            Page through results. 
            Default value: 1
          schema:
            type: integer
        - name: order
          in: query
          required: false
          description: |-
            Sort order for results. 
            Default: `total_holdings_usd_desc`
          schema:
            type: string
            enum:
              - total_holdings_usd_desc
              - total_holdings_usd_asc
      responses:
        '200':
          description: Public companies or governments crypto treasury holdings data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicTreasury'
              example:
                total_holdings: 1272129.0267804659
                total_value_usd: 97225044888.65527
                market_cap_dominance: 6.06
                companies:
                  - name: Strategy
                    symbol: MSTR.US
                    country: US
                    total_holdings: 843738
                    total_entry_value_usd: 63870055699
                    total_current_value_usd: 64484706340.107254
                    percentage_of_total_supply: 4.018
                  - name: XXI
                    symbol: XXI.US
                    country: US
                    total_holdings: 43514
                    total_entry_value_usd: 0
                    total_current_value_usd: 3325662126.967645
                    percentage_of_total_supply: 0.207
components:
  schemas:
    PublicTreasury:
      oneOf:
        - title: CompanyTreasury
          type: object
          required:
            - total_holdings
            - total_value_usd
            - market_cap_dominance
            - companies
          properties:
            total_holdings:
              type: number
              description: Total crypto holdings
            total_value_usd:
              type: number
              description: Total crypto holdings value in USD
            market_cap_dominance:
              type: number
              description: Market cap dominance percentage
            companies:
              type: array
              description: List of companies holding crypto
              items:
                type: object
                required:
                  - name
                  - symbol
                  - country
                  - total_holdings
                  - total_entry_value_usd
                  - total_current_value_usd
                  - percentage_of_total_supply
                properties:
                  name:
                    type: string
                    description: Company name
                  symbol:
                    type: string
                    nullable: true
                    description: Company ticker symbol
                  country:
                    type: string
                    description: Country code
                  total_holdings:
                    type: number
                    description: Total crypto holdings
                  total_entry_value_usd:
                    type: number
                    description: Total entry value in USD
                  total_current_value_usd:
                    type: number
                    description: Total current value of crypto holdings in USD
                  percentage_of_total_supply:
                    type: number
                    description: Percentage of total crypto supply
        - title: GovernmentTreasury
          type: object
          required:
            - total_holdings
            - total_value_usd
            - market_cap_dominance
            - governments
          properties:
            total_holdings:
              type: number
              description: Total crypto holdings
            total_value_usd:
              type: number
              description: Total crypto holdings value in USD
            market_cap_dominance:
              type: number
              description: Market cap dominance percentage
            governments:
              type: array
              description: List of governments holding crypto
              items:
                type: object
                required:
                  - name
                  - symbol
                  - country
                  - total_holdings
                  - total_entry_value_usd
                  - total_current_value_usd
                  - percentage_of_total_supply
                properties:
                  name:
                    type: string
                    description: Government name
                  symbol:
                    type: string
                    nullable: true
                    description: Government ticker symbol
                  country:
                    type: string
                    description: Country code
                  total_holdings:
                    type: number
                    description: Total crypto holdings
                  total_entry_value_usd:
                    type: number
                    description: Total entry value in USD
                  total_current_value_usd:
                    type: number
                    description: Total current value of crypto holdings in USD
                  percentage_of_total_supply:
                    type: number
                    description: Percentage of total crypto supply
  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)

````