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

# Big Brain Ape REST API — Overview and Getting Started

> The Big Brain Ape REST API lets you automate trading, manage your portfolio, configure price alerts, and access real-time market data programmatically.

The Big Brain Ape REST API gives you programmatic access to the full power of the platform — from executing token swaps and reading live market data to managing your portfolio and configuring price alerts. Every feature available in the dashboard is also available through the API, so you can build automated strategies, integrate data into your own tools, and react to market events in real time.

## Base URL

All API requests are made to the following base URL:

```
https://api.bigbrainape.com/v1
```

Every endpoint path in this documentation is appended to this base URL. For example, the portfolio endpoint is available at `https://api.bigbrainape.com/v1/portfolio`.

## What you can do with the API

* **Execute token swaps programmatically** — submit swap orders, set slippage tolerances, and confirm transactions without touching the dashboard. (`POST /trades`)
* **Fetch real-time and historical market data** — retrieve live prices, OHLCV candles, liquidity depth, and volume statistics for any supported token. (`GET /market-data`)
* **Read and manage your portfolio** — query current holdings, historical performance, and unrealised PnL across all connected wallets. (`GET /portfolio`)
* **Create, list, and delete alerts** — set price and volume triggers and receive webhook or email notifications when conditions are met. (`POST /alerts`, `GET /alerts`, `DELETE /alerts/{id}`)
* **Manage your API keys** — list and generate API keys programmatically from your own tooling. (`GET /auth/api-keys`, `POST /auth/api-keys`)

## Request format

All requests that include a body must send JSON. Set the `Content-Type` header on every such request:

```
Content-Type: application/json
```

Query parameters (for `GET` requests) are passed as standard URL query strings. Path parameters are embedded directly in the endpoint URL.

## Response format

Every successful response from the API returns a JSON object with the following top-level shape:

```json theme={null}
{
  "success": true,
  "data": { ... },
  "timestamp": "2024-01-15T14:32:00Z"
}
```

The `data` field contains the resource or result specific to the endpoint you called. The `timestamp` field reflects the UTC time the response was generated on the server.

## Error response format

When a request fails, `success` is `false` and the response includes an `error` object describing what went wrong:

```json theme={null}
{
  "success": false,
  "error": {
    "code": "INVALID_TOKEN",
    "message": "The token symbol provided is not supported."
  }
}
```

Use the `code` field to handle errors programmatically — it is a stable string identifier that will not change between API versions. The `message` field is human-readable and intended for logging or display.

## Explore the API

<CardGroup cols={2}>
  <Card title="Authentication" icon="key" href="/api/authentication">
    Learn how to generate API keys and authenticate your requests using Bearer tokens.
  </Card>

  <Card title="Rate Limits" icon="gauge-high" href="/api/rate-limits">
    Understand plan-based rate limits, response headers, and backoff strategies.
  </Card>

  <Card title="Portfolio" icon="chart-pie" href="/api/portfolio">
    Read current holdings, historical performance, and PnL across your wallets.
  </Card>

  <Card title="Trades" icon="arrows-rotate" href="/api/trades">
    Execute token swaps and query your trade history programmatically.
  </Card>

  <Card title="Market Data" icon="chart-line" href="/api/market-data">
    Retrieve real-time prices, OHLCV candles, and liquidity statistics for any token.
  </Card>

  <Card title="Alerts" icon="bell" href="/api/alerts">
    Create, list, and delete price and volume alerts with webhook or email delivery.
  </Card>
</CardGroup>
