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

# Launchpad API

> Read launchpad coins, trades, holder counts, and quotes over HTTP with a read-only Launchpad API key.

The Launchpad API is a read-only HTTP API for the OneSwap Launchpad. It serves the same coins,
prices, trades, holder counts, and indicative quotes as the website. It cannot
trade. If you work in TypeScript, the [Launchpad SDK](https://docs.oneswap.cc/guides/launchpad-sdk.md) wraps this API
for you.

## Base URL

| Network | Base URL |
| - | - |
| Mainnet | `https://api.oneswap.cc/swapv2/api/launchpad/v1` |
| Devnet | `https://devnet.api.oneswap.cc/swapv2/api/launchpad/v1` |

## Authentication

Every request needs a Launchpad API key. Sign in to OneSwap, open **Developer**, and under
**Launchpad API keys** click **Generate key**. See
[Get a Launchpad API key](https://docs.oneswap.cc/guides/launchpad-sdk.md#get-a-launchpad-api-key) for the details.

Send the key in the `x-launchpad-key` header, or as a bearer token:

```bash theme={null}
curl https://api.oneswap.cc/swapv2/api/launchpad/v1/coins \
  -H "x-launchpad-key: $ONESWAP_LAUNCHPAD_KEY"

curl https://api.oneswap.cc/swapv2/api/launchpad/v1/coins \
  -H "Authorization: Bearer $ONESWAP_LAUNCHPAD_KEY"
```

> [!WARNING]
>
> Keep the key on a server. Anyone with the key can spend its rate limit.

## Endpoints

All endpoints are `GET`. Any other method returns `405`.

| Endpoint | Query | Returns |
| - | - | - |
| `/config` | | `{ enabled, network, capabilities, paused? }` |
| `/coins` | `sort`, `lane`, `limit`, `cursor` | `{ coins, nextCursor }` |
| `/coins/{coinId}` | | `{ coin }` |
| `/coins/{coinId}/trades` | `limit`, `cursor` | `{ trades, nextCursor }` |
| `/coins/{coinId}/holders` | | `{ holderCount, holderData }` |
| `/coins/{coinId}/quote` | `side`, `amount` or `tokensOut` | `{ quote }` |
| `/trades/recent` | | `{ trades }` |

### List coins

```bash theme={null}
curl "https://api.oneswap.cc/swapv2/api/launchpad/v1/coins?sort=volume&lane=new&limit=20" \
  -H "x-launchpad-key: $ONESWAP_LAUNCHPAD_KEY"
```

* `sort` is `recent` (default), `volume`, or `mcap`.
* `lane` is `new`, `stretch`, or `graduated`.
* Prices, market caps, and volumes are in CC.
* To get the next page, pass `nextCursor` as `cursor`. A `null` `nextCursor` means there are
  no more pages.

### Read one coin

```bash theme={null}
curl https://api.oneswap.cc/swapv2/api/launchpad/v1/coins/$COIN_ID \
  -H "x-launchpad-key: $ONESWAP_LAUNCHPAD_KEY"
```

`coin` includes its bonding-curve state (`curve`), recent trades, and `holderCount`.
After graduation, `liquidityMigrated` turns `true` once the coin trades on its pool.

`imageUrl`, `websiteUrl`, `xUrl`, and `telegramUrl` show the coin's current image and links. The
creator can change them after launch, so read them again rather than caching them forever. A
link the creator removes is an empty string.

### Trades and holder count

```bash theme={null}
curl "https://api.oneswap.cc/swapv2/api/launchpad/v1/coins/$COIN_ID/trades?limit=50" \
  -H "x-launchpad-key: $ONESWAP_LAUNCHPAD_KEY"

curl https://api.oneswap.cc/swapv2/api/launchpad/v1/coins/$COIN_ID/holders \
  -H "x-launchpad-key: $ONESWAP_LAUNCHPAD_KEY"

curl https://api.oneswap.cc/swapv2/api/launchpad/v1/trades/recent \
  -H "x-launchpad-key: $ONESWAP_LAUNCHPAD_KEY"
```

* Trades come newest first.
* Holders are a count only. No addresses, usernames, or balances are returned.
* Check `holderData.status` before you trust `holderCount`. It is `complete`, `partial`, or
  `unavailable`. After graduation, holder data can be `unavailable` because pool holdings are
  not indexed.

### Quotes

```bash theme={null}
# Spend 25 CC
curl "https://api.oneswap.cc/swapv2/api/launchpad/v1/coins/$COIN_ID/quote?side=buy&amount=25" \
  -H "x-launchpad-key: $ONESWAP_LAUNCHPAD_KEY"

# Receive exactly 1,000,000 tokens
curl "https://api.oneswap.cc/swapv2/api/launchpad/v1/coins/$COIN_ID/quote?side=buy&tokensOut=1000000" \
  -H "x-launchpad-key: $ONESWAP_LAUNCHPAD_KEY"

# Sell 500,000 tokens
curl "https://api.oneswap.cc/swapv2/api/launchpad/v1/coins/$COIN_ID/quote?side=sell&amount=500000" \
  -H "x-launchpad-key: $ONESWAP_LAUNCHPAD_KEY"
```

* For a buy, `amount` is the CC to spend. For a sell, `amount` is the tokens to sell.
* `tokensOut` works for buys only.

Quotes are indicative. They are not tied to a wallet and do not include the network fee. To
trade, use the [Trader SDK](https://docs.oneswap.cc/guides/trader-sdk.md#trade-launchpad-coins).

## Rate limits

Each key has its own per-minute limit, 120 requests a minute by default. Every response carries
these headers:

| Header | Meaning |
| - | - |
| `X-RateLimit-Limit` | Requests allowed per minute for this key. |
| `X-RateLimit-Remaining` | Requests left in the current minute. |
| `Retry-After` | On a `429`, the seconds to wait before retrying. |

Contact OneSwap if you need a higher limit.

## Errors

Errors return JSON with `error` (a message) and `code`:

```json theme={null}
{ "error": "Invalid or revoked Launchpad API key.", "code": "LAUNCHPAD_API_KEY_INVALID" }
```

| Status | Code | When |
| - | - | - |
| `401` | `LAUNCHPAD_API_KEY_REQUIRED` | No key was sent. |
| `401` | `LAUNCHPAD_API_KEY_INVALID` | The key is wrong or revoked. |
| `403` | `LAUNCHPAD_ACCESS_RESTRICTED` | The key's account cannot read the launchpad yet. |
| `400` | `LAUNCHPAD_INVALID_REQUEST`, `LAUNCHPAD_INVALID_QUOTE` | A parameter is invalid. |
| `404` | `LAUNCHPAD_NOT_FOUND` | The coin does not exist or is withheld from public reads. |
| `404` | `NOT_FOUND` | The endpoint does not exist. |
| `405` | `METHOD_NOT_ALLOWED` | The method is not `GET`. |
| `409` | `LAUNCHPAD_LIQUIDITY_MIGRATING` | The coin's liquidity is still moving to its pool. |
| `429` | `RATE_LIMITED` | The key, or your IP address, used up its per-minute limit. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.