# /price - Lookup token prices

### Endpoint

**Method:** `POST`\
**URL:** `https://api.swapkit.dev/price`&#x20;

***

### &#x20;Request parameters

<table><thead><tr><th width="103">Parameter</th><th width="95">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>tokens</code></td><td><code>array</code></td><td>List of token identifiers to fetch price for. Each item is an object with an <code>identifier</code> field (e.g., <code>{ "identifier": "ETH.ETH" }</code>).</td></tr><tr><td><code>metadata</code></td><td><code>boolean</code></td><td>If <code>true</code>, includes extended CoinGecko metadata (currently always included, even if set to <code>false</code>).</td></tr></tbody></table>

{% hint style="info" %}
Identifiers follow the format `Chain.Asset`, such as `ETH.ETH`, `BTC.BTC` or `SOL.SOL`, with the contract address added at the end when necessary, such as `ARB.PENDLE-0x0c880f6761F1af8d9Aa9C466984b80DAb9a8c9e8`.\
This is the same formatting used in our `/quote` endpoint.
{% endhint %}

***

### Example requests

{% tabs %}
{% tab title="Multiple Tokens (cURL)" %}

```sh
curl -X POST \
  'https://api.swapkit.dev/price' \
  -H 'Content-Type: application/json' \
  -H "x-api-key: YOUR_VARIABLE_HERE" \
  -d '{
    "tokens": [
      { "identifier": "ETH.ETH" },
      { "identifier": "BTC.BTC" },
      { "identifier": "SOL.SOL" },
      {"identifier": "BSC.CAKE-0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82"}
    ],
    "metadata": true
  }'
```

{% endtab %}

{% tab title="Single Token (cURL)" %}

```sh
curl -X POST \
  'https://api.swapkit.dev/price' \
  -H 'Content-Type: application/json' \
  -H "x-api-key: YOUR_VARIABLE_HERE" \
  -d '{
    "tokens": [
      { "identifier": "ETH.ETH" }
    ],
    "metadata": true
  }'
```

{% endtab %}
{% endtabs %}

***

### Response format

The endpoint returns an array of token price objects.

```json
[
  {
    "identifier": "ETH.ETH",
    "provider": "",
    "cg": {
      "id": "ethereum",
      "name": "Ethereum",
      "market_cap": 197138665861,
      "total_volume": 12560864823,
      "price_change_24h_usd": -39.89,
      "price_change_percentage_24h_usd": -2.38,
      "sparkline_in_7d": [...],
      "timestamp": "2025-04-15T12:30:44.643Z"
    },
    "price_usd": 1653.61,
    "timestamp": 1744720254562
  }
]
```

For each token, it includes the following fields:

<table><thead><tr><th width="309">Field</th><th width="94">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>identifier</code></td><td><code>string</code></td><td>The token identifier you queried (e.g., <code>ETH.ETH</code>).</td></tr><tr><td><code>price_usd</code></td><td><code>number</code></td><td>The current price of the token in USD.</td></tr><tr><td><code>timestamp</code></td><td><code>number</code></td><td>Millisecond timestamp of the price fetch.</td></tr><tr><td><code>cg</code></td><td><code>object</code></td><td><em>(If <code>metadata: true</code> — currently always present)</em> CoinGecko metadata.</td></tr><tr><td>└─ <code>id</code></td><td><code>string</code></td><td>CoinGecko’s internal ID.</td></tr><tr><td>└─ <code>name</code></td><td><code>string</code></td><td>Full name of the token.</td></tr><tr><td>└─ <code>market_cap</code></td><td><code>number</code></td><td>Total market capitalization in USD.</td></tr><tr><td>└─ <code>total_volume</code></td><td><code>number</code></td><td>24-hour trading volume in USD.</td></tr><tr><td>└─ <code>price_change_24h_usd</code></td><td><code>number</code></td><td>Price change in absolute USD over the last 24 hours.</td></tr><tr><td>└─ <code>price_change_percentage_24h_usd</code></td><td><code>number</code></td><td>Percentage price change over the last 24 hours.</td></tr><tr><td>└─ <code>sparkline_in_7d</code></td><td><code>array</code></td><td>7-day price history (useful for drawing sparkline charts).</td></tr><tr><td>└─ <code>timestamp</code></td><td><code>string</code></td><td>Timestamp of the CoinGecko data.</td></tr></tbody></table>

When a token's price is not found, or the token name is not correctly specified, the endpoint will return a price of 0 USD for that token. Not how `ETH.HTE` is not a correct identifier so the example response here fails to return a correct price:

```json
[
  {
    "identifier": "ETH.EHT",
    "provider": "",
    "price_usd": 0,
    "timestamp": 0
  }
]
```
