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

# Compliance & Reporting

> Build tax reporting, fund accounting, and audit pipelines with timestamped historical prices from CoinGecko API

<CardGroup cols={2}>
  <Card title="Set up your API key" icon="key" href="/docs/setting-up-your-api-key" horizontal arrow="true" />

  <Card title="Build faster with AI" icon="robot" href="/ai-integration#coding-agents" horizontal arrow="true" />
</CardGroup>

<Note>
  **TL;DR**<br />

  Use [/coins/\{id}/history](/reference/coins-id-history) for point-in-time tax event prices, [/coins/\{id}/market\_chart/range](/reference/coins-id-market-chart-range) for historical time series, [/coins/\{id}/ohlc/range](/reference/coins-id-ohlc-range) for OHLC benchmarks, and [/simple/price](/reference/simple-price) with `include_last_updated_at` for timestamped NAV snapshots.
</Note>

> Replace `YOUR_API_KEY` in the examples below with your actual key. [Get one here →](https://www.coingecko.com/en/api/pricing)

## Pipeline Setup

<Steps>
  <Step title="Map assets — /coins/list">
    Build a lookup table mapping your internal identifiers to CoinGecko coin IDs and contract addresses.

    <Tabs>
      <Tab title="Pro API">
        ```bash theme={null}
        curl -X GET \
          "https://pro-api.coingecko.com/api/v3/coins/list?include_platform=true" \
          -H "x-cg-pro-api-key: YOUR_API_KEY"
        ```

        > [Coins List →](/reference/coins-list)
      </Tab>

      <Tab title="Demo API">
        ```bash theme={null}
        curl -X GET \
          "https://api.coingecko.com/api/v3/coins/list?include_platform=true" \
          -H "x-cg-demo-api-key: YOUR_API_KEY"
        ```

        > [Coins List →](/demo/reference/coins-list)
      </Tab>
    </Tabs>

    | Key param          | Use                                                                                   |
    | ------------------ | ------------------------------------------------------------------------------------- |
    | `include_platform` | Include contract addresses per platform — essential for reconciling tokens by address |
  </Step>

  <Step title="Validate currencies — /simple/supported_vs_currencies">
    Confirm your reporting currencies are supported before building queries.

    <Tabs>
      <Tab title="Pro API">
        ```bash theme={null}
        curl -X GET \
          "https://pro-api.coingecko.com/api/v3/simple/supported_vs_currencies" \
          -H "x-cg-pro-api-key: YOUR_API_KEY"
        ```

        > [Supported Currencies →](/reference/simple-supported-currencies)
      </Tab>

      <Tab title="Demo API">
        ```bash theme={null}
        curl -X GET \
          "https://api.coingecko.com/api/v3/simple/supported_vs_currencies" \
          -H "x-cg-demo-api-key: YOUR_API_KEY"
        ```

        > [Supported Currencies →](/demo/reference/simple-supported-currencies)
      </Tab>
    </Tabs>

    <Tip>
      Cache this list at pipeline startup. Unsupported currencies return empty results without an error.
    </Tip>
  </Step>
</Steps>

***

## Historical Data

<Steps>
  <Step title="Tax event prices — /coins/{id}/history">
    Fair market value at a specific date — the core endpoint for tax reporting and trade reconciliation.

    <Tabs>
      <Tab title="Pro API">
        ```bash theme={null}
        curl -X GET \
          "https://pro-api.coingecko.com/api/v3/coins/bitcoin/history?date=15-04-2024&localization=false" \
          -H "x-cg-pro-api-key: YOUR_API_KEY"
        ```

        > [Coin Historical Data →](/reference/coins-id-history)
      </Tab>

      <Tab title="Demo API">
        ```bash theme={null}
        curl -X GET \
          "https://api.coingecko.com/api/v3/coins/bitcoin/history?date=15-04-2024&localization=false" \
          -H "x-cg-demo-api-key: YOUR_API_KEY"
        ```

        > [Coin Historical Data →](/demo/reference/coins-id-history)
      </Tab>
    </Tabs>

    Prices are returned in all supported fiat currencies simultaneously — no separate calls needed for multi-jurisdiction reports.

    <Note>
      The `date` parameter uses **dd-mm-yyyy** format (not ISO). Data is a snapshot at **00:00:00 UTC**.
    </Note>
  </Step>

  <Step title="Historical time series — /coins/{id}/market_chart/range">
    Price, market cap, and volume as `[timestamp, value]` arrays for a custom date range — maps directly to database columns.

    <Tabs>
      <Tab title="Pro API">
        ```bash theme={null}
        curl -X GET \
          "https://pro-api.coingecko.com/api/v3/coins/bitcoin/market_chart/range?vs_currency=usd&from=2024-01-01&to=2024-12-31&interval=daily" \
          -H "x-cg-pro-api-key: YOUR_API_KEY"
        ```

        > [Market Chart Range →](/reference/coins-id-market-chart-range)
      </Tab>

      <Tab title="Demo API">
        ```bash theme={null}
        curl -X GET \
          "https://api.coingecko.com/api/v3/coins/bitcoin/market_chart/range?vs_currency=usd&from=2024-01-01&to=2024-12-31&interval=daily" \
          -H "x-cg-demo-api-key: YOUR_API_KEY"
        ```

        > [Market Chart Range →](/demo/reference/coins-id-market-chart-range)
      </Tab>
    </Tabs>

    | Key param     | Use                                                                           |
    | ------------- | ----------------------------------------------------------------------------- |
    | `from` / `to` | ISO dates or UNIX timestamps                                                  |
    | `interval`    | `daily` or `hourly` for consistent data points (paid plans), or omit for auto |

    <Tip>
      For tokens tracked by contract address, use [Contract Market Chart Range](/reference/contract-address-market-chart-range) — same schema, queried by address instead of coin ID.
    </Tip>
  </Step>

  <Step title="OHLC benchmarks — /coins/{id}/ohlc/range">
    Daily or hourly OHLC candles for a custom date range — use closing price as end-of-day valuation, or open/close spread for volatility reporting.

    <Tabs>
      <Tab title="Pro API">
        ```bash theme={null}
        curl -X GET \
          "https://pro-api.coingecko.com/api/v3/coins/ethereum/ohlc/range?vs_currency=usd&from=2024-01-01&to=2024-03-31&interval=daily" \
          -H "x-cg-pro-api-key: YOUR_API_KEY"
        ```

        > [OHLC Range →](/reference/coins-id-ohlc-range)
      </Tab>

      <Tab title="Demo API">
        <Callout icon="key" color="#FFC107" iconType="regular">
          `/coins/{id}/ohlc/range` is not available on the Demo API.<br />
          [Upgrade to Pro →](https://www.coingecko.com/en/api/pricing)
        </Callout>
      </Tab>
    </Tabs>

    Response format: `[timestamp, open, high, low, close]` — consistent five-element arrays.

    <Tip>
      For simpler lookbacks without custom date ranges, use [/coins/\{id}/ohlc](/reference/coins-id-ohlc) with a `days` parameter.
    </Tip>
  </Step>
</Steps>

***

## Daily Snapshots

<Steps>
  <Step title="Timestamped NAV — /simple/price">
    Current prices with `last_updated_at` — the audit timestamp confirming when CoinGecko last updated the price.

    <Tabs>
      <Tab title="Pro API">
        ```bash theme={null}
        curl -X GET \
          "https://pro-api.coingecko.com/api/v3/simple/price?ids=bitcoin,ethereum,solana&vs_currencies=usd,eur&include_market_cap=true&include_last_updated_at=true" \
          -H "x-cg-pro-api-key: YOUR_API_KEY"
        ```

        > [Simple Price →](/reference/simple-price)
      </Tab>

      <Tab title="Demo API">
        ```bash theme={null}
        curl -X GET \
          "https://api.coingecko.com/api/v3/simple/price?ids=bitcoin,ethereum,solana&vs_currencies=usd,eur&include_market_cap=true&include_last_updated_at=true" \
          -H "x-cg-demo-api-key: YOUR_API_KEY"
        ```

        > [Simple Price →](/demo/reference/simple-price)
      </Tab>
    </Tabs>

    ```json theme={null}
    {
      "bitcoin": {
        "usd": 67432.51,
        "eur": 63521.12,
        "usd_market_cap": 1326789012345,
        "last_updated_at": 1712345678
      }
    }
    ```

    | Key param                 | Use                                        |
    | ------------------------- | ------------------------------------------ |
    | `include_last_updated_at` | UNIX timestamp — critical for audit trails |
    | `include_market_cap`      | AUM and exposure reporting                 |
    | `precision`               | Consistent decimal formatting              |

    Schedule this call daily for end-of-day NAV records.
  </Step>
</Steps>
