> For the complete documentation index, see [llms.txt](https://docs.novamp.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.novamp.io/developers/errors.md).

# Errors & Rate Limits

The Novamp Public Data API uses standard HTTP status codes and a simple, predictable rate-limit model. It's a read plane, so there are no signed decisions or idempotency keys to manage — just clean GETs.

> **Switch on the HTTP status code. Back off on `429` using `Retry-After`.**

{% hint style="info" %}
Because the data API is read-only, errors are straightforward: a bad or wrong-chain lookup is a `404`, and too many requests is a `429`. There is nothing to "fail closed" on — retries are always safe.
{% endhint %}

## Status codes

| Status | Meaning                              | Your action                      |
| ------ | ------------------------------------ | -------------------------------- |
| `200`  | Success                              | Parse the JSON body              |
| `400`  | Malformed request (bad query params) | Fix the request                  |
| `404`  | Unknown token, or wrong-chain lookup | Check the `chainId`/address pair |
| `429`  | Rate limited                         | Back off using `Retry-After`     |
| `5xx`  | Transient server/indexer error       | Retry with backoff               |

The most common surprise is a `404` from a chain-scoped read: `/api/tokens/:chainId/:address` only resolves a token whose `chainId` matches the indexer serving it. Querying an Ethereum token (`1`) against the BNB origin (`56`) returns `404`. Prefer the branded host so routing is handled for you — see [Environments](/developers/environments.md).

## Response shape

Successful list endpoints return a consistent envelope:

```json
{
  "tokens": [],
  "count": 0,
  "limit": 100,
  "offset": 0,
  "ethUsd": { "rate": "3200.00", "source": "chainlink", "asOf": "2026-07-21T00:00:00Z" }
}
```

* Money values are **string decimals** — parse them as decimals, not floats.
* Unknown values are `null`, never omitted.

## Rate limits

* **Per-IP token bucket** — roughly **10 req/sec sustained** with bursts up to \~120.
* Over-limit requests return `429` with a `Retry-After` header (seconds).
* `/health` and the logo proxy are exempt.

```ts
async function getJson<T>(url: string, max = 3): Promise<T> {
  for (let attempt = 0; ; attempt++) {
    const res = await fetch(url);
    if (res.ok) return (await res.json()) as T;
    const retryable = res.status === 429 || (res.status >= 500 && res.status < 600);
    if (!retryable || attempt >= max) {
      throw new Error(`request failed: ${res.status}`);
    }
    const retryAfter = Number(res.headers.get("retry-after")) || 2 ** attempt;
    await new Promise((r) => setTimeout(r, retryAfter * 1000));
  }
}
```

## Pagination & caching

* **Pagination:** `?limit=` (default 100, max 500), `?offset=`.
* **CORS:** `Access-Control-Allow-Origin: *` on all public GETs.
* **Caching:** token endpoints `max-age=20`; DEX adapter `max-age=5`; logos immutable (\~1 year). Respect these to stay well under the rate limit.

## Continue exploring

* [🧑‍💻 Developer Overview](/developers/overview.md)
* [🧩 Integration Examples](/developers/integration-examples.md)
* [📡 Public Data API](/developers/public-api.md)
* [🛡️ Identity Protection](/developers/identity-protection.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.novamp.io/developers/errors.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
