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

# REST API overview

> Read Shield Swap markets, routes, indexed activity, balances, and transaction input schemas over HTTPS.

Use the REST API when your application needs indexed data or current transaction input schemas without reading every protocol mapping itself.

```text theme={"languages":{"custom":["/languages/leo.tmLanguage.json"]}}
https://api.swap.shield.fi
```

Mainnet is the documentation default. The network selector in the upper-right corner changes REST, WebSocket, OpenAPI, and example URLs across the site. A selection is stored in the browser and persists across pages and reloads.

The API does not sign, prove, submit, or reconcile Shield transactions for your application.

## What the API provides

* pool and token discovery
* current pool state, statistics, trades, and candles
* indexed swaps, positions, and balances
* routes with up to three hops
* revisioned protocol state, route topology, fee tiers, tick spacings, and compliance controls
* transaction input schemas for the configured Shield Swap deployment
* live update notifications over WebSocket

## Access model

The API has three access levels.

| Access       | Use it for                                                                             | Credential                                   |
| ------------ | -------------------------------------------------------------------------------------- | -------------------------------------------- |
| Public       | Pool metadata, token metadata, and compliance reads                                    | None                                         |
| Application  | Routes, history, positions, swaps, balances, configuration, and schemas                | Invited wallet session or `ss_...` API token |
| Session-only | API-token management, token management, code redemption, and administrative operations | Browser wallet session and CSRF token        |

An API token covers the data and trading surface. It does not grant administrative privileges.

## Choose the next page

| Goal                              | Start here                                       |
| --------------------------------- | ------------------------------------------------ |
| Confirm the API is reachable      | [List pools](./quickstart)                       |
| Authenticate a browser or backend | [Authentication](./authentication)               |
| Build a market-data service       | [Build a trading bot](./trading-bot)             |
| Subscribe to indexed changes      | [WebSocket feed](./websocket)                    |
| Handle pagination and retries     | [Pagination and errors](./pagination-and-errors) |

## Service endpoints

| Service              | URL                                       |
| -------------------- | ----------------------------------------- |
| REST                 | `https://api.swap.shield.fi`              |
| WebSocket            | `wss://ws.swap.shield.fi/ws`              |
| OpenAPI              | `https://api.swap.shield.fi/openapi.json` |
| Standalone reference | `https://api.swap.shield.fi/docs/`        |

## Exact values

Financial values use JSON strings. Preserve token amounts, liquidity, fees, revisions, and field identifiers exactly. Do not pass them through JavaScript `number` or localized number formatting.

Routing and indexed state can change before a Shield transaction finalizes. Apply your own price limit, minimum output, deadline, record checks, and final-state reconciliation.
