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

# Market Data API — Prices, Charts, and Token Info

> GET /market-data endpoints return real-time token prices, OHLCV candlestick chart data, and trending tokens across all supported networks.

The Market Data API provides real-time and historical price information for any token tracked by Big Brain Ape. You can fetch a token's current price, pull OHLCV candlestick data for charting, or surface trending tokens across supported networks — all from a single, consistent interface.

<Note>
  Basic price data (`GET /market-data`) does not require authentication. Extended fields such as on-chain volume breakdowns, holder analytics, and whale activity require a valid Bearer token with the `read` scope.
</Note>

***

## GET /market-data

Fetch the current price and 24-hour market statistics for a specific token. This endpoint is publicly accessible for basic price data; pass your Bearer token to unlock extended market metrics.

### Query Parameters

<ParamField query="token" type="string" required>
  The token to look up. Accepts a ticker symbol (e.g. `SOL`) or a full contract address.
</ParamField>

<ParamField query="network" type="string">
  Restrict the lookup to a specific network. Accepted values: `solana`, `ethereum`, `base`, `arbitrum`. Useful when a token exists on multiple chains.
</ParamField>

<ParamField query="currency" type="string" default="USD">
  The fiat currency used for price and market cap values. Defaults to `USD`.
</ParamField>

### Example Request

```bash theme={null}
curl 'https://api.bigbrainape.com/v1/market-data?token=SOL&currency=USD'
```

### Example Response

```json theme={null}
{
  "success": true,
  "data": {
    "token": "SOL",
    "price": 144.32,
    "currency": "USD",
    "change24h": 5.21,
    "volume24h": 1234567890,
    "marketCap": 68000000000
  },
  "timestamp": "2024-01-15T14:32:00Z"
}
```

### Response Fields

<ResponseField name="data.token" type="string">
  The ticker symbol of the requested token.
</ResponseField>

<ResponseField name="data.price" type="number">
  The current market price expressed in the requested `currency`.
</ResponseField>

<ResponseField name="data.currency" type="string">
  The currency code used for all monetary values in this response.
</ResponseField>

<ResponseField name="data.change24h" type="number">
  Percentage price change over the past 24 hours. Negative values indicate a price decrease.
</ResponseField>

<ResponseField name="data.volume24h" type="number">
  Total trading volume over the past 24 hours, in the requested `currency`.
</ResponseField>

<ResponseField name="data.marketCap" type="number">
  Current market capitalisation of the token, in the requested `currency`.
</ResponseField>

***

## GET /market-data/chart

Retrieve OHLCV (Open, High, Low, Close, Volume) candlestick data for a token over a specified time range. Use this endpoint to power trading charts or backtest strategies.

**Required scope:** `read`

### Query Parameters

<ParamField query="token" type="string" required>
  The token to retrieve chart data for. Accepts a ticker symbol or contract address.
</ParamField>

<ParamField query="timeframe" type="string" required>
  The duration of each candle. Accepted values: `1m`, `5m`, `15m`, `1h`, `4h`, `1d`.
</ParamField>

<ParamField query="from" type="string">
  Start of the time range as an ISO 8601 UTC timestamp (e.g. `2024-01-01T00:00:00Z`). Defaults to 24 hours before `to`.
</ParamField>

<ParamField query="to" type="string">
  End of the time range as an ISO 8601 UTC timestamp. Defaults to the current time.
</ParamField>

<ParamField query="network" type="string">
  Restrict data to a specific network. Accepted values: `solana`, `ethereum`, `base`, `arbitrum`.
</ParamField>

### Example Request

```bash theme={null}
curl 'https://api.bigbrainape.com/v1/market-data/chart?token=SOL&timeframe=1h&from=2024-01-15T00:00:00Z&to=2024-01-15T06:00:00Z' \
  -H 'Authorization: Bearer YOUR_API_KEY'
```

### Example Response

```json theme={null}
{
  "success": true,
  "data": {
    "token": "SOL",
    "timeframe": "1h",
    "currency": "USD",
    "candles": [
      {
        "timestamp": "2024-01-15T00:00:00Z",
        "open": 138.20,
        "high": 140.55,
        "low": 137.80,
        "close": 139.90,
        "volume": 82340500
      },
      {
        "timestamp": "2024-01-15T01:00:00Z",
        "open": 139.90,
        "high": 143.10,
        "low": 139.50,
        "close": 142.45,
        "volume": 94120300
      },
      {
        "timestamp": "2024-01-15T02:00:00Z",
        "open": 142.45,
        "high": 145.00,
        "low": 141.80,
        "close": 144.32,
        "volume": 110875000
      }
    ]
  },
  "timestamp": "2024-01-15T14:32:00Z"
}
```

### Response Fields

<ResponseField name="data.token" type="string">
  The ticker symbol of the token this chart data belongs to.
</ResponseField>

<ResponseField name="data.timeframe" type="string">
  The candle duration used in this response.
</ResponseField>

<ResponseField name="data.currency" type="string">
  The currency used for all price and volume values.
</ResponseField>

<ResponseField name="data.candles" type="array">
  Ordered list of OHLCV candles, from oldest to newest.

  <Expandable title="candle item fields">
    <ResponseField name="timestamp" type="string">
      ISO 8601 UTC timestamp marking the open of this candle.
    </ResponseField>

    <ResponseField name="open" type="number">
      Token price at the start of the candle period.
    </ResponseField>

    <ResponseField name="high" type="number">
      Highest price reached during the candle period.
    </ResponseField>

    <ResponseField name="low" type="number">
      Lowest price reached during the candle period.
    </ResponseField>

    <ResponseField name="close" type="number">
      Token price at the end of the candle period.
    </ResponseField>

    <ResponseField name="volume" type="number">
      Total trading volume during the candle period, in the requested `currency`.
    </ResponseField>
  </Expandable>
</ResponseField>

<Tip>
  For live charting, request the most recent candles by omitting `from` and `to` and polling at the same interval as your chosen `timeframe`.
</Tip>

***

## GET /market-data/trending

Retrieve the most-talked-about and highest-momentum tokens across Big Brain Ape's tracked networks. Use this endpoint to surface breakout tokens, populate a trending feed, or feed discovery features in your application.

### Query Parameters

<ParamField query="network" type="string">
  Filter trending tokens to a specific network. Accepted values: `solana`, `ethereum`, `base`, `arbitrum`. Omit to return trending tokens from all networks.
</ParamField>

<ParamField query="limit" type="number" default="10">
  Number of trending tokens to return. Defaults to `10`, maximum `50`.
</ParamField>

### Example Request

```bash theme={null}
curl 'https://api.bigbrainape.com/v1/market-data/trending?network=solana&limit=5' \
  -H 'Authorization: Bearer YOUR_API_KEY'
```

### Example Response

```json theme={null}
{
  "success": true,
  "data": {
    "network": "solana",
    "updatedAt": "2024-01-15T14:00:00Z",
    "tokens": [
      {
        "rank": 1,
        "token": "BONK",
        "price": 0.0000142,
        "change24h": 38.50,
        "volume24h": 520000000,
        "network": "solana"
      },
      {
        "rank": 2,
        "token": "JTO",
        "price": 3.84,
        "change24h": 14.20,
        "volume24h": 210000000,
        "network": "solana"
      },
      {
        "rank": 3,
        "token": "PYTH",
        "price": 0.61,
        "change24h": 9.80,
        "volume24h": 95000000,
        "network": "solana"
      }
    ]
  },
  "timestamp": "2024-01-15T14:32:00Z"
}
```

### Response Fields

<ResponseField name="data.network" type="string">
  The network filter applied to this trending list, or `all` if no network was specified.
</ResponseField>

<ResponseField name="data.updatedAt" type="string">
  ISO 8601 UTC timestamp indicating when the trending rankings were last recalculated.
</ResponseField>

<ResponseField name="data.tokens" type="array">
  Ordered list of trending tokens, from highest-ranked to lowest.

  <Expandable title="token item fields">
    <ResponseField name="rank" type="number">
      The token's position in the trending list, starting at `1`.
    </ResponseField>

    <ResponseField name="token" type="string">
      The ticker symbol of the trending token.
    </ResponseField>

    <ResponseField name="price" type="number">
      Current market price in USD.
    </ResponseField>

    <ResponseField name="change24h" type="number">
      Percentage price change over the past 24 hours.
    </ResponseField>

    <ResponseField name="volume24h" type="number">
      Total 24-hour trading volume in USD.
    </ResponseField>

    <ResponseField name="network" type="string">
      The network on which this token is primarily traded.
    </ResponseField>
  </Expandable>
</ResponseField>
