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

# Vaults.fyi API Overview

> The vaults.fyi V2 API — comprehensive DeFi vault data and transaction execution across 20+ networks.

## Base URL

```
https://api.vaults.fyi/v2
```

## Authentication

Every request must include your API key as a header:

```bash theme={null}
x-api-key: YOUR_API_KEY
```

All API keys have access to all endpoints. Rate limits depend on your plan — see [Plans & Pricing](/plans/overview), or contact support to increase your limit.

## Networks

The API tracks vaults across 20+ EVM-compatible networks. Networks can be identified by name or CAIP-2 identifier:

| Name          | Chain ID | CAIP-2          |
| ------------- | -------- | --------------- |
| `arbitrum`    | 42161    | `eip155:42161`  |
| `avalanche`   | 43114    | `eip155:43114`  |
| `base`        | 8453     | `eip155:8453`   |
| `berachain`   | 80094    | `eip155:80094`  |
| `bsc`         | 56       | `eip155:56`     |
| `celo`        | 42220    | `eip155:42220`  |
| `etherlink`   | 42793    | `eip155:42793`  |
| `gnosis`      | 100      | `eip155:100`    |
| `hyperliquid` | 999      | `eip155:999`    |
| `ink`         | 57073    | `eip155:57073`  |
| `katana`      | 747474   | `eip155:747474` |
| `linea`       | 59144    | `eip155:59144`  |
| `mainnet`     | 1        | `eip155:1`      |
| `mega-eth`    | 4326     | `eip155:4326`   |
| `monad`       | 143      | `eip155:143`    |
| `optimism`    | 10       | `eip155:10`     |
| `plasma`      | 9745     | `eip155:9745`   |
| `polygon`     | 137      | `eip155:137`    |
| `swellchain`  | 1923     | `eip155:1923`   |
| `unichain`    | 130      | `eip155:130`    |
| `worldchain`  | 480      | `eip155:480`    |

Use `GET /v2/networks` for the complete current list.

## APY values

All APY fields are **raw decimals**. Multiply by 100 to display as a percentage:

```js theme={null}
// API returns: 0.0543
// Display as:  5.43%
const displayApy = (rawApy * 100).toFixed(2) + '%';
```

## Pagination

All list endpoints use offset pagination with `page` (zero-indexed) and `perPage`:

```bash theme={null}
GET /v2/detailed-vaults?page=0&perPage=50   # first page
GET /v2/detailed-vaults?page=1&perPage=50   # second page
```

The response includes `nextPage` — it is `null` when you are on the last page.

## Error responses

| Status | Meaning                                 |
| ------ | --------------------------------------- |
| `400`  | Invalid parameters                      |
| `401`  | Missing or invalid API key              |
| `403`  | API key has exhausted available credits |
| `404`  | Resource not found                      |
| `429`  | Rate limit exceeded                     |
| `500`  | Internal server error                   |
| `503`  | Service temporarily unavailable         |

Error bodies follow this shape:

```json theme={null}
{
  "statusCode": 400,
  "error": "Bad Request",
  "message": "Descriptive error message"
}
```

Some authentication errors omit `statusCode`; always key your handling off the HTTP status code first.

## Quick start

Fetch the top 5 USDC vaults by 7-day APY on Ethereum mainnet:

```bash theme={null}
curl -H "x-api-key: YOUR_API_KEY" \
  "https://api.vaults.fyi/v2/detailed-vaults\
?allowedAssets=USDC\
&allowedNetworks=mainnet\
&minTvl=1000000\
&sortBy=apy7day\
&sortOrder=desc\
&perPage=5"
```

Check a user's idle assets and suggest vaults to deposit into:

```bash theme={null}
# Step 1 — find idle assets
curl -H "x-api-key: YOUR_API_KEY" \
  "https://api.vaults.fyi/v2/portfolio/idle-assets/0xYourWallet"

# Step 2 — get ranked deposit suggestions
curl -H "x-api-key: YOUR_API_KEY" \
  "https://api.vaults.fyi/v2/portfolio/best-deposit-options/0xYourWallet\
?onlyTransactional=true&maxVaultsPerAsset=3"
```

<script type="application/ld+json" dangerouslySetInnerHTML={{__html: `{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Docs","item":"https://docs.vaults.fyi"},{"@type":"ListItem","position":2,"name":"API Reference","item":"https://docs.vaults.fyi/api-reference/overview"}]}`}} />
