---
title: Endpoint reference
sidebar_position: 4
description: Every ElectroSwap public API endpoint and what each call costs in credits.
keywords: [api reference, endpoints, openapi, credit cost, electroswap api, rest api]
---

{/* Generated by tools/gen-api-docs.mjs from api-spec/openapi.json. Do not edit; run `yarn api:gen`. */}

import TOCInline from '@theme/TOCInline';

# Endpoint reference

Every endpoint in v1 and what each one costs, on one page, so your browser's find covers the whole surface at once.

Every call is a read-only `GET` that returns JSON and answers for chain **52014** only. Every *metered* call also carries `X-Credits-Cost` and `X-Credits-Remaining` — `account.me` and `openapi.json` are free and carry neither, and nor does an error.

v1 pages with `limit` alone. **No route accepts a `cursor`**, and the `cursor` in a list response is null on every route but `trade.list`, where it is informational.

In the `curl` examples, `0xYOUR_ADDRESS` and `0xYOUR_POOL` are placeholders. Pasted literally they answer `400 invalid_request`, because the address pattern is checked before anything else — substitute a real address first.

<div className="api-reference-toc">
  <TOCInline toc={toc} minHeadingLevel={2} maxHeadingLevel={2} />
</div>

## What each call costs {#cost-table}

**1,000,000 credits = $1.00.**

Every price here is the expensive case, never the cheap one. A price set on the cheap path would under-charge exactly when the call is dearest to serve, and the point of publishing a number is that you can budget against it.

Batching is always cheaper than looping. Twenty addresses through `prices.batch` cost 300 credits; the same twenty as single calls cost 1,000. That is a rule this price list keeps, not a coincidence, so reach for the batch endpoint whenever there is one.

| Operation | Path | Base | Per item | Most it can cost |
| --- | --- | --- | --- | --- |
| `etn.price` | `/prices/etn` | 25 | — | 25 |
| `token.price` | `/prices/{chainId}/{address}` | 50 | — | 50 |
| `prices.batch` | `/prices/{chainId}` | 100 | 10 | 600 |
| `token.get` | `/tokens/{chainId}/{address}` | 100 | — | 100 |
| `token.list` | `/tokens/{chainId}` | 100 | 5 | 600 |
| `token.candles` | `/tokens/{chainId}/{address}/candles` | 100 | 1 | 600 |
| `token.history` | `/tokens/{chainId}/{address}/history` | 200 | — | 200 |
| `pool.list` | `/pools/{chainId}` | 200 | 5 | 700 |
| `trade.list` | `/trades/{chainId}` | 250 | 10 | 500 |
| `nft.stats` | `/nft/stats` | 25 | — | 25 |
| `nft.collections` | `/nft/collections/{chainId}` | 300 | 10 | 800 |
| `nft.collection` | `/nft/collections/{chainId}/{address}` | 500 | — | 500 |
| `nft.assets` | `/nft/collections/{chainId}/{address}/assets` | 400 | 20 | 1,400 |
| `presale.list` | `/presales/{chainId}` | 250 | 10 | 750 |
| `presale.get` | `/presales/{chainId}/{pool}` | 200 | — | 200 |
| `balances.get` | `/balances/{chainId}/{address}` | 800 | 10 | 2,800 |
| `locks.get` † | `/tokens/{chainId}/{address}/liquidity-locks` | 2,000 | — | 2,000 |
| `farm.list` † | `/farms/{chainId}` | 3,000 | — | 3,000 |
| `account.me` | `/me` | — | — | — |
| `meta.openapi` | `/openapi.json` | — | — | — |

A `limit` above the maximum is rejected with `400 invalid_limit` and **costs nothing**. So does a malformed request, and so does any `5xx` of ours — we do not charge for our own failures.

† A **heavy** route. Its concurrency is two in flight across **all** keys, not per key, so it can answer `503 server_busy` with `Retry-After` because somebody else is mid-call. Nothing is charged when it does.

## ETN price {#tag-etn}

The chain's own asset. Everything else is priced against it.

### `GET /prices/etn` {#etn-price}

The ETN/USD spot price.

**25 credits.**

```bash
curl -s "https://electroswap.io/public-api/v1/prices/etn" \
  -H "Authorization: Bearer $ELECTROSWAP_API_KEY"
```

## Tokens {#tag-token}

One token or the whole listed set, with prices, supply, candles and history.

### `GET /prices/{chainId}/{address}` {#token-price}

One token's last price in USD and ETN.

**50 credits.**

| Parameter | In | Required | Description |
| --- | --- | --- | --- |
| `chainId` | path | yes | Electroneum mainnet. The API is mainnet-only; 52014 is the only accepted value. |
| `address` | path | yes | The token or account address. |

```bash
curl -s "https://electroswap.io/public-api/v1/prices/52014/0xYOUR_ADDRESS" \
  -H "Authorization: Bearer $ELECTROSWAP_API_KEY"
```

### `GET /tokens/{chainId}/{address}` {#token-get}

One token with its price and supply.

**100 credits.**

| Parameter | In | Required | Description |
| --- | --- | --- | --- |
| `chainId` | path | yes | Electroneum mainnet. The API is mainnet-only; 52014 is the only accepted value. |
| `address` | path | yes | The token or account address. |

```bash
curl -s "https://electroswap.io/public-api/v1/tokens/52014/0xYOUR_ADDRESS" \
  -H "Authorization: Bearer $ELECTROSWAP_API_KEY"
```

### `GET /tokens/{chainId}` {#token-list}

Every listed token on the chain, in no particular order.

**100 credits**, plus 5 per item returned — at most 600 for a full page of 100.

| Parameter | In | Required | Description |
| --- | --- | --- | --- |
| `chainId` | path | yes | Electroneum mainnet. The API is mainnet-only; 52014 is the only accepted value. |
| `limit` | query | no | Up to 100. A larger value is rejected with `400 invalid_limit` and costs nothing. |

```bash
curl -s "https://electroswap.io/public-api/v1/tokens/52014" \
  -H "Authorization: Bearer $ELECTROSWAP_API_KEY"
```

### `GET /tokens/{chainId}/{address}/candles` {#token-candles}

OHLCV candles at a bucket size.

**100 credits**, plus 1 per item returned — at most 600 for a full page of 500.

| Parameter | In | Required | Description |
| --- | --- | --- | --- |
| `chainId` | path | yes | Electroneum mainnet. The API is mainnet-only; 52014 is the only accepted value. |
| `address` | path | yes | The token or account address. |
| `limit` | query | no | Up to 500. A larger value is rejected with `400 invalid_limit` and costs nothing. |
| `bucket` | query | no | Candle size: `1m`, `15m`, `1h` (the default), `4h` or `1d`. Anything else answers `400 invalid_request`. |
| `currency` | query | no | The quote currency: `USD` (the default) or `ETN`. |

```bash
curl -s "https://electroswap.io/public-api/v1/tokens/52014/0xYOUR_ADDRESS/candles" \
  -H "Authorization: Bearer $ELECTROSWAP_API_KEY"
```

### `GET /tokens/{chainId}/{address}/history` {#token-history}

Price history and period volume, high and low.

**200 credits.**

| Parameter | In | Required | Description |
| --- | --- | --- | --- |
| `chainId` | path | yes | Electroneum mainnet. The API is mainnet-only; 52014 is the only accepted value. |
| `address` | path | yes | The token or account address. |
| `duration` | query | no | The window looking back from now: `HOUR`, `DAY` (the default), `WEEK`, `MONTH` or `YEAR`. Case-insensitive; anything else answers `400 invalid_request`. |
| `currency` | query | no | The quote currency: `USD` (the default) or `ETN`. |

```bash
curl -s "https://electroswap.io/public-api/v1/tokens/52014/0xYOUR_ADDRESS/history" \
  -H "Authorization: Bearer $ELECTROSWAP_API_KEY"
```

## Batch prices {#tag-prices}

Up to fifty tokens in one call, for a fraction of what fifty calls cost.

### `GET /prices/{chainId}` {#prices-batch}

Last prices for up to fifty tokens in one call.

**100 credits**, plus 10 per item returned — at most 600 for a full page of 50.

| Parameter | In | Required | Description |
| --- | --- | --- | --- |
| `chainId` | path | yes | Electroneum mainnet. The API is mainnet-only; 52014 is the only accepted value. |
| `addresses` | query | yes | Required. One to fifty token addresses, comma-separated. Omitting it answers `400 invalid_request`; more than fifty answers `400 invalid_request` too. You are charged per address in the list. |

```bash
curl -s "https://electroswap.io/public-api/v1/prices/52014?addresses=0x138DAFbDA0CCB3d8E39C19edb0510Fc31b7C1c77,0xEe432C220273e4F949007B4c1946562826Efa055" \
  -H "Authorization: Bearer $ELECTROSWAP_API_KEY"
```

## Pools {#tag-pool}

V2 or V3 liquidity — one version per call, v2 by default.

### `GET /pools/{chainId}` {#pool-list}

V2 or V3 pools and the pair each one holds.

**200 credits**, plus 5 per item returned — at most 700 for a full page of 100.

| Parameter | In | Required | Description |
| --- | --- | --- | --- |
| `chainId` | path | yes | Electroneum mainnet. The API is mainnet-only; 52014 is the only accepted value. |
| `limit` | query | no | Up to 100. A larger value is rejected with `400 invalid_limit` and costs nothing. |
| `version` | query | no | Which pools to list: `2` (the default) or `3`. One version per call — there is no combined list. |

```bash
curl -s "https://electroswap.io/public-api/v1/pools/52014" \
  -H "Authorization: Bearer $ELECTROSWAP_API_KEY"
```

## Trades {#tag-trade}

Recent swaps, newest first.

### `GET /trades/{chainId}` {#trade-list}

Recent trades, newest first.

**250 credits**, plus 10 per item returned — at most 500 for a full page of 25.

| Parameter | In | Required | Description |
| --- | --- | --- | --- |
| `chainId` | path | yes | Electroneum mainnet. The API is mainnet-only; 52014 is the only accepted value. |
| `limit` | query | no | Up to 25. A larger value is rejected with `400 invalid_limit` and costs nothing. |
| `token` | query | no | Only trades in this token. |

```bash
curl -s "https://electroswap.io/public-api/v1/trades/52014" \
  -H "Authorization: Bearer $ELECTROSWAP_API_KEY"
```

## NFTs {#tag-nft}

Marketplace totals, collections, and the assets inside them. Floor, owners and volume come from the single-collection route.

### `GET /nft/stats` {#nft-stats}

Marketplace totals.

**25 credits.**

```bash
curl -s "https://electroswap.io/public-api/v1/nft/stats" \
  -H "Authorization: Bearer $ELECTROSWAP_API_KEY"
```

### `GET /nft/collections/{chainId}` {#nft-collections}

Listed collections and their identity. Floor, owners and volume come from `nft.collection`.

**300 credits**, plus 10 per item returned — at most 800 for a full page of 50.

| Parameter | In | Required | Description |
| --- | --- | --- | --- |
| `chainId` | path | yes | Electroneum mainnet. The API is mainnet-only; 52014 is the only accepted value. |
| `limit` | query | no | Up to 50. A larger value is rejected with `400 invalid_limit` and costs nothing. |

```bash
curl -s "https://electroswap.io/public-api/v1/nft/collections/52014" \
  -H "Authorization: Bearer $ELECTROSWAP_API_KEY"
```

### `GET /nft/collections/{chainId}/{address}` {#nft-collection}

One collection with its statistics.

**500 credits.**

| Parameter | In | Required | Description |
| --- | --- | --- | --- |
| `chainId` | path | yes | Electroneum mainnet. The API is mainnet-only; 52014 is the only accepted value. |
| `address` | path | yes | The token or account address. |

```bash
curl -s "https://electroswap.io/public-api/v1/nft/collections/52014/0xYOUR_ADDRESS" \
  -H "Authorization: Bearer $ELECTROSWAP_API_KEY"
```

### `GET /nft/collections/{chainId}/{address}/assets` {#nft-assets}

Assets in a collection.

**400 credits**, plus 20 per item returned — at most 1,400 for a full page of 50.

| Parameter | In | Required | Description |
| --- | --- | --- | --- |
| `chainId` | path | yes | Electroneum mainnet. The API is mainnet-only; 52014 is the only accepted value. |
| `address` | path | yes | The token or account address. |
| `limit` | query | no | Up to 50. A larger value is rejected with `400 invalid_limit` and costs nothing. |

```bash
curl -s "https://electroswap.io/public-api/v1/nft/collections/52014/0xYOUR_ADDRESS/assets" \
  -H "Authorization: Bearer $ELECTROSWAP_API_KEY"
```

## Presales {#tag-presale}

Launchpad campaigns: the pool, its token and its status.

### `GET /presales/{chainId}` {#presale-list}

Launchpad presales.

**250 credits**, plus 10 per item returned — at most 750 for a full page of 50.

| Parameter | In | Required | Description |
| --- | --- | --- | --- |
| `chainId` | path | yes | Electroneum mainnet. The API is mainnet-only; 52014 is the only accepted value. |
| `limit` | query | no | Up to 50. A larger value is rejected with `400 invalid_limit` and costs nothing. |

```bash
curl -s "https://electroswap.io/public-api/v1/presales/52014" \
  -H "Authorization: Bearer $ELECTROSWAP_API_KEY"
```

### `GET /presales/{chainId}/{pool}` {#presale-get}

One presale: its pool, token and status.

**200 credits.**

| Parameter | In | Required | Description |
| --- | --- | --- | --- |
| `chainId` | path | yes | Electroneum mainnet. The API is mainnet-only; 52014 is the only accepted value. |
| `pool` | path | yes | The presale pool address. |

```bash
curl -s "https://electroswap.io/public-api/v1/presales/52014/0xYOUR_POOL" \
  -H "Authorization: Bearer $ELECTROSWAP_API_KEY"
```

## Balances {#tag-balances}

What an address holds, as last recorded.

### `GET /balances/{chainId}/{address}` {#balances-get}

A stored balance document. No refresh, no per-token pricing.

**800 credits**, plus 10 per item returned — at most 2,800 for a full page of 200.

| Parameter | In | Required | Description |
| --- | --- | --- | --- |
| `chainId` | path | yes | Electroneum mainnet. The API is mainnet-only; 52014 is the only accepted value. |
| `address` | path | yes | The token or account address. |
| `limit` | query | no | Up to 200. A larger value is rejected with `400 invalid_limit` and costs nothing. |

```bash
curl -s "https://electroswap.io/public-api/v1/balances/52014/0xYOUR_ADDRESS" \
  -H "Authorization: Bearer $ELECTROSWAP_API_KEY"
```

## Liquidity locks {#tag-locks}

Locked liquidity for a token, and when it unlocks.

### `GET /tokens/{chainId}/{address}/liquidity-locks` {#locks-get}

Liquidity locks for a token.

**2,000 credits.**

| Parameter | In | Required | Description |
| --- | --- | --- | --- |
| `chainId` | path | yes | Electroneum mainnet. The API is mainnet-only; 52014 is the only accepted value. |
| `address` | path | yes | The token or account address. |

```bash
curl -s "https://electroswap.io/public-api/v1/tokens/52014/0xYOUR_ADDRESS/liquidity-locks" \
  -H "Authorization: Bearer $ELECTROSWAP_API_KEY"
```

## Yield farms {#tag-farm}

The active farms and what they pay.

### `GET /farms/{chainId}` {#farm-list}

Active yield farms. No `farmer` filter — per-account queries are not in v1.

**3,000 credits.**

| Parameter | In | Required | Description |
| --- | --- | --- | --- |
| `chainId` | path | yes | Electroneum mainnet. The API is mainnet-only; 52014 is the only accepted value. |

```bash
curl -s "https://electroswap.io/public-api/v1/farms/52014" \
  -H "Authorization: Bearer $ELECTROSWAP_API_KEY"
```

## Your account {#tag-account}

Your own credit balance and tier.

### `GET /me` {#account-me}

Your credit balance and tier.

Free — this call is not metered.

```bash
curl -s "https://electroswap.io/public-api/v1/me" \
  -H "Authorization: Bearer $ELECTROSWAP_API_KEY"
```

## The OpenAPI document {#tag-meta}

A machine-readable description of everything above. No key needed.

### `GET /openapi.json` {#meta-openapi}

This document.

Free — this call is not metered.

```bash
curl -s "https://electroswap.io/public-api/v1/openapi.json"
```
