# Birdeye API in Python: keys, OHLCV, limits and costs

URL: https://fincodelabs.com/en/blog/birdeye-api · Publisher: Fincode (Fincode Yazılım ve Teknoloji A.Ş.), Istanbul, Turkey · Category: Exchange APIs · Published: 2026-11-27 · Updated: 2026-11-27

Birdeye API read 27 Nov 2026: X-API-KEY and x-chain headers, price and OHLCV endpoints, compute-unit pricing, plan limits and tested Python.

**Short answer:** The **Birdeye API** is a REST API for Solana and multi-chain token prices and OHLCV candles, called with an `X-API-KEY` header. Requests go to `https://public-api.birdeye.so` with the network in an `x-chain` header. As its documentation read on 27 November 2026 states, the free Standard package includes 30,000 compute units a month at 1 request per second, and paid packages start at $39 a month.

Sources are Birdeye's own pages at data.birdeye.so, read on 27 November 2026, plus live calls made that day without a key, so keyed calls were tested only up to the authentication error. This describes an API, not a token, and is no view on what to trade.

The documentation contains text addressed to automated readers: every page tells the reader to fetch an index file first, and the error page tells the reader to check entitlements "before rotating the key or recommending a plan change". It was read as page content, not followed as instructions.

## Birdeye API key: how authentication works

You need a key for every call on the standard route: create it in the Security tab of the Birdeye Data dashboard and send it in the `X-API-KEY` header.

The Authentication and Quickstart pages read on 27 November 2026 give the same pattern: base URL `https://public-api.birdeye.so`, header `X-API-KEY`, and header `x-chain` naming the network. The OpenAPI spec lists 18 `x-chain` values, with `solana` as the default. The Quickstart says the account limit is shared across keys and that whitelist and blacklist rules can be set per key. Anyone holding the key can spend your compute units, so keep it out of front-end code; the general rules are in the [API key security guide](https://fincodelabs.com/en/blog/api-key-security-trading-bots).

On 27 November 2026 a request without a key and one with a made-up key both returned HTTP 401 `{"success":false,"message":"Unauthorized"}`. The error page reserves 403 for a valid key that the package or a whitelist rule does not allow on that route.

## Birdeye API pricing: packages and compute units

Birdeye bills by compute units (CU): each package includes a monthly CU allowance, and every call consumes a fixed or size-dependent number of units.

**Birdeye Data packages, pricing page read 27 November 2026 (USD a month)**

| Package | Base price | Included CU | Rate limit | Per extra 1M CU |
| --- | --- | --- | --- | --- |
| Standard | $0 | 30,000 | 1 rps | no extra CU |
| Lite | $39 | 2,500,000 | 15 rps | $15 |
| Starter | $99 | 8 million | 15 rps | $12 |
| Starter Plus | $125 | 10 million | 15 rps | $12 |
| Premium | $199 | 20 million | 50 rps | $9.90 |
| Business | $499 | 60 million | 100 rps | $6.90 |
| Business B-15 / B-30 / B-50 | $899 / $1,350 / $2,050 | 150M / 300M / 500M | 150 rps | $4.50 / $3.50 / $3.50 |

Growth AutoScale (from $699 for 100 million CU) and Enterprise are custom; the page says prices may change. Costs per call that day:

**CU cost per call, read 27 November 2026**

| Endpoint | CU per call | Calls per 30,000 CU |
| --- | --- | --- |
| `GET /defi/price` | 3 | 10,000 |
| `GET /defi/token_overview` | 18 | 1,666 |
| `GET /defi/v3/ohlcv`, up to 100 candles | 25 | 1,200 |
| `GET /defi/v3/ohlcv`, 101 to 300 / 301 to 1,000 candles | 30 / 40 | 1,000 / 750 |
| `GET /defi/v3/ohlcv`, 1,001 to 2,000 / 2,001 to 5,000 candles | 75 / 100 | 400 / 300 |

> **Hypothetical example.** A dashboard refreshes the last 24 hourly candles of one token every hour: 24 candles cost 25 CU, and 24 calls a day for 30 days is 720 calls, or 18,000 CU, 60% of the Standard allowance. Adding a price check every minute (3 CU, 43,200 calls a month) would need 129,600 CU on its own, which no longer fits the free package.

## Birdeye API rate limit, and where the docs disagree

The rate limit is applied per account across all keys, and the official pages do not agree on every figure, so budget for the lowest one you find.

The Rate Limiting page read on 27 November 2026 says the limit is "PER ACCOUNT rather than per individual API" and gives 1 rps for Standard, 15 rps for Lite and Starter, 50 rps or 1,000 rpm for Premium and 100 rps or 1,500 rpm for Business. Per-endpoint ceilings (300 rps for `/defi/price`, 100 for `/defi/ohlcv`) sit above most account limits. Conflicts found that day:

- Business is "100 rps/ 1500 rpm", but 100 requests a second would be 6,000 a minute; the page does not say which one binds.
- The Standard row says "Limited to 3 specific endpoints", while the Data Accessibility table marks 51 endpoints as open to Standard, including price, OHLCV and token overview.
- The Wallet group is described as 30 requests a minute in the text, but its table rows say "30 rps / 150 rpm".

The page recommends backoff on 429 but documents no `Retry-After` header. Responses on 27 November 2026 exposed `X-RateLimit-Limit`, `-Remaining` and `-Reset` headers whose meaning is not documented. A client-side limiter such as the one in the [token bucket guide](https://fincodelabs.com/en/blog/token-bucket-rate-limiter-python), plus [backoff with jitter](https://fincodelabs.com/en/blog/exponential-backoff-jitter-python), is the safe design.

## Price, OHLCV and token overview endpoints

For a Solana token, `/defi/price` gives the latest price, `/defi/v3/ohlcv` gives candles, and `/defi/token_overview` gives price, liquidity, market cap, volume and holder data in one call.

**Core endpoints, reference read 27 November 2026**

| Endpoint | Main parameters | Notes from the reference |
| --- | --- | --- |
| `GET /defi/price` | `address`, optional `include_liquidity`, `check_liquidity` | Response may be null or omit fields if the token is unknown or not yet indexed |
| `GET /defi/v3/ohlcv` | `address`, `type`, `time_from`, `time_to`, `mode`, `count_limit`, `padding`, `outlier` | Up to 5,000 candles; intervals from `1s` to `1M`; no empty candles unless `padding=true` |
| `GET /defi/token_overview` | `address` | 18 CU a call |

Timestamps are Unix seconds and `unix_time` is the candle-open time; `1s` candles are kept for two weeks and `15s`/`30s` for three months; `outlier` defaults to true, so Birdeye's outlier filter applies unless you set `outlier=false`. Because empty candles are dropped, a token with no trades in a window returns fewer candles, or none, and that is not an error. To price a whole watchlist, the reference points to `/defi/multi_price` (up to 100 tokens), which the accessibility table reserves for Lite and above.

## Birdeye API Python example, tested 27 November 2026

This client uses only the standard library, sends both headers, retries 429 with backoff, and turns every failure into one exception type with a readable message.

```python
import json, os, time, urllib.error, urllib.parse, urllib.request

BASE = "https://public-api.birdeye.so"
SOL = "So11111111111111111111111111111111111111112"   # wrapped SOL mint

class BirdeyeError(Exception):
    pass

def get(path, params, key, chain="solana", base=BASE, opener=urllib.request.urlopen, tries=3):
    url = f"{base}{path}?{urllib.parse.urlencode(params)}"
    headers = {"X-API-KEY": key, "x-chain": chain, "accept": "application/json", "User-Agent": "Mozilla/5.0"}
    for attempt in range(tries):
        try:
            with opener(urllib.request.Request(url, headers=headers), timeout=15) as r:
                raw = r.read()
        except urllib.error.HTTPError as e:
            body = e.read()[:200].decode("utf-8", "replace")
            if e.code == 429 and attempt < tries - 1:
                wait = int(e.headers.get("Retry-After") or 2 ** attempt)
                print(f"429, retry in {wait}s")
                time.sleep(wait)
                continue
            raise BirdeyeError(f"HTTP {e.code}: {body}") from None
        except OSError as e:               # DNS, refused, timeout, reset
            raise BirdeyeError(f"network error: {getattr(e, 'reason', e)}") from None
        try:
            data = json.loads(raw)
        except ValueError:
            raise BirdeyeError(f"not JSON: {repr(raw[:40])}") from None
        if not data.get("success"):
            raise BirdeyeError(f"API error: {data.get('message')}")
        return data["data"]
    raise BirdeyeError("gave up after retries")

def ohlcv(address, key, interval="1H", hours=24, **kw):
    now = int(time.time())
    data = get("/defi/v3/ohlcv", {"address": address, "type": interval,
               "time_from": now - hours * 3600, "time_to": now}, key, **kw)
    return (data or {}).get("items") or []   # empty: no trades, not an error

if __name__ == "__main__":
    key = os.environ.get("BIRDEYE_API_KEY", "not-a-real-key")
    for label, kw in [("live call", {}), ("network", {"base": "https://public-api.birdeye.invalid"})]:
        try:
            print(label, "->", len(ohlcv(SOL, key, **kw)), "candles")
        except BirdeyeError as e:
            print(label, "->", e)
```

Real output, run without a key on 27 November 2026:

```
live call -> HTTP 401: {"success":false,"message":"Unauthorized"}
network -> network error: [Errno 11001] getaddrinfo failed
```

The candle path was not exercised against real data. The reserved `.invalid` hostname fails at DNS, before any auth check, so a dead connection is not misreported as a bad key. The other failures were tested by injecting fake responses:

```python
import io, urllib.error
import birdeye_ohlcv as be
be.time.sleep = lambda s: None                      # no real waiting in tests

def fake(replies):                                  # replies: list of (status, body)
    def opener(req, timeout):
        status, body = replies.pop(0)
        if status >= 400:
            raise urllib.error.HTTPError(req.full_url, status, "", {"Retry-After": "1"}, io.BytesIO(body))
        return io.BytesIO(body)
    return opener

ok = b'{"success": true, "data": {"items": [{"o": 1, "c": 2, "unix_time": 0}]}}'
for name, replies in {"bad JSON": [(200, b"<html>gateway timeout</html>")],
                      "429 then OK": [(429, b"{}"), (200, ok)],
                      "429 x3": [(429, b"{}")] * 3,
                      "success false": [(200, b'{"success":false,"message":"Bad request"}')]}.items():
    try:
        print(name, "->", len(be.ohlcv(be.SOL, "test", opener=fake(list(replies)))), "candles")
    except be.BirdeyeError as e:
        print(name, "->", e)
```

Output:

```
bad JSON -> not JSON: b'<html>gateway timeout</html>'
429, retry in 1s
429 then OK -> 1 candles
429, retry in 1s
429, retry in 1s
429 x3 -> HTTP 429: {}
success false -> API error: Bad request
```

Not covered: the real success payload beyond the reference example (`data.items` with `o`, `h`, `l`, `c`, `v`, `unix_time`). Check it with a real key.

## Birdeye x402: paying per request without a key

Birdeye also sells API calls one at a time over the x402 payment protocol, paid in USDC, with no account or key.

The x402 page read on 27 November 2026 prices a request at $0.003, offers "Full REST API access" without WebSockets, and names Base and Solana as payment networks. Paid routes sit under `/x402/`, for example `/x402/defi/price`. An unpaid request to that route on 27 November 2026 returned HTTP 402 with a base64-encoded `PAYMENT-REQUIRED` header; decoded, it asked for 3,000 base units of the Solana USDC mint (0.003 USDC at six decimals) on Solana only, so the Base option described on the overview page was not offered for that route at that moment. No payment was made for this guide.

## Birdeye vs DEX Screener and Jupiter for Solana prices

Birdeye is the one of the three that documents OHLCV candles; DEX Screener and Jupiter document free price endpoints without candles.

**Official documentation compared, read 27 November 2026**

|   | Birdeye Data API | DEX Screener API | Jupiter Price API |
| --- | --- | --- | --- |
| Key | Required (or x402 payment) | None | Optional |
| Free limit | 1 rps, 30,000 CU a month | 60 or 300 requests a minute per endpoint | 0.5 rps keyless, 1 rps with a free key |
| OHLCV candles | Yes, up to 5,000 per call | No endpoint in the reference | No; current USD price for up to 50 mints |
| Chains | 18 `x-chain` values | Many, chain in the path | Solana |

The DEX Screener details are in the [DEX Screener API guide](https://fincodelabs.com/en/blog/dexscreener-api) and the Jupiter details in the [Jupiter swap API guide](https://fincodelabs.com/en/blog/jupiter-swap-api). Jupiter omits tokens without a reliable price, and Birdeye may return a null price: treat a missing value as unknown, not zero. For readers in Turkey: Article 99/A of Capital Markets Law No. 6362 treats activity by foreign crypto-asset platforms directed at Turkish residents as unauthorized.

## Birdeye terms of service and new-token risk

The terms limit redistribution, and price data on a newly created token says nothing about whether that token is safe.

The Terms of Service read on 27 November 2026 (last updated 11 April 2025, issued by Wings Lab) forbid reselling, sublicensing or otherwise providing access to the services "or any data, content, or information obtained therefrom" to any third party without prior written consent, and separately forbid scraping and storing data from the services. If you plan to show Birdeye data to your own users or keep it in a database, get the licence position in writing before you build. A candle chart exists as soon as a pool trades and says nothing about whether liquidity can be pulled; check the contract with the steps in [how to check a token contract](https://fincodelabs.com/en/blog/how-to-check-token-contract) and read [how memecoin rug pulls work](https://fincodelabs.com/en/blog/memecoin-rug-pull) first. If you are scoping a data pipeline around feeds like this, Fincode's [market data pipeline service](https://fincodelabs.com/en/services/market-data-pipelines) describes how that work is scoped; naming Birdeye here does not mean Fincode integrates it.

## Frequently asked questions

### Is the Birdeye API free?

There is a free Standard package with 30,000 compute units a month at 1 request per second, per the pricing page read on 27 November 2026. Paid packages start at $39 a month.

### What headers does the Birdeye API need?

X-API-KEY with your key on every request, and x-chain with the network name such as solana. Without a valid key the API returned HTTP 401 Unauthorized on 27 November 2026.

### How many candles can Birdeye OHLCV return?

Up to 5,000 per call on /defi/v3/ohlcv and up to 1,000 on the older /defi/ohlcv. On v3 the compute-unit cost rises with the number of candles returned, from 25 to 100 CU.

### Can I use Birdeye without an API key?

Only through the x402 pay-per-request route, documented at $0.003 a request paid in USDC. The standard route returned 401 without a key on 27 November 2026.

## Sources

- [Birdeye Data docs: Authentication, read 27 November 2026](https://data.birdeye.so/docs/authentication.md)
- [Birdeye Data docs: Quickstart](https://data.birdeye.so/docs/quickstart.md)
- [Birdeye Data docs: Pricing](https://data.birdeye.so/docs/guides/payment/pricing.md)
- [Birdeye Data docs: Rate Limiting](https://data.birdeye.so/docs/guides/api-access/rate-limiting/index.md)
- [Birdeye Data docs: What is Compute Unit Cost](https://data.birdeye.so/docs/guides/what-is-compute-unit-cost.md)
- [Birdeye Data docs: Data Accessibility by Packages](https://data.birdeye.so/docs/guides/data-accessibility-by-packages.md)
- [Birdeye Data docs: API Error Codes and Troubleshooting](https://data.birdeye.so/docs/guides/error-handling.md)
- [Birdeye Data API reference: Price](https://data.birdeye.so/docs/data-api/price-ohlcv/get-defi-price.md)
- [Birdeye Data API reference: OHLCV V3](https://data.birdeye.so/docs/data-api/price-ohlcv/get-defi-v3-ohlcv.md)
- [Birdeye Data API reference: Token Overview](https://data.birdeye.so/docs/data-api/stats/get-defi-token-overview.md)
- [Birdeye Data docs: x402 and Agentic Payments](https://data.birdeye.so/docs/agents/x402-agentic-payments.md)
- [Birdeye Data Terms of Service, last updated 11 April 2025](https://data.birdeye.so/docs/resources/terms.md)
- [Jupiter developer docs: Rate Limits, read 27 November 2026](https://developers.jup.ag/docs/portal/rate-limits.md)
- [Jupiter developer docs: Price API](https://developers.jup.ag/docs/price/index.md)
- [DEX Screener API Reference, read 27 November 2026](https://docs.dexscreener.com/api/reference)

> This guide is general information about software and markets, not investment, legal or tax advice. Automated trading can lose money, past or backtested performance does not guarantee future results, and the rules that apply depend on your jurisdiction and your exchange's terms. Sources, checks and corrections: see the [editorial policy](https://fincodelabs.com/en/editorial-policy).

---

Published by Fincode (Fincode Yazılım ve Teknoloji A.Ş.), a software company in Istanbul, Turkey: https://fincodelabs.com/en/blog/birdeye-api

Cite as: Fincode, "Birdeye API in Python: keys, OHLCV, limits and costs", updated November 27, 2026, https://fincodelabs.com/en/blog/birdeye-api
