> For the complete documentation index, see [llms.txt](https://dexhunter.gitbook.io/dexhunter-partners/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dexhunter.gitbook.io/dexhunter-partners/data/market-data.md).

# Market Data

Get prices, pools, and trading pairs.

{% hint style="warning" %}
**Required:** Include `X-Partner-Id` header with your API key on all requests.

**Base URL:** `https://api-us.dexhunterv3.app`
{% endhint %}

***

## Get ADA Price

Get current ADA price in USD.

**Endpoint**

`GET /swap/adaValue`

**Response**

Returns the current ADA/USD price as a number.

{% tabs %}
{% tab title="Example" %}

```javascript
const API_KEY = 'YOUR_API_KEY';
const BASE_URL = 'https://api-us.dexhunterv3.app';
const headers = { 'X-Partner-Id': API_KEY };

const { data: adaPrice } = await axios.get(`${BASE_URL}/swap/adaValue`, {
  headers,
});

console.log(adaPrice);
// 0.45
```

{% endtab %}
{% endtabs %}

***

## Get Token Price

Get current token price in ADA.

**Endpoint**

`GET /swap/averagePrice/ADA/{token_id}`

**Response**

| Field      | Type   | Description  |
| ---------- | ------ | ------------ |
| `price_ba` | number | Price in ADA |

{% tabs %}
{% tab title="Example" %}

```javascript
const NIGHT =
  '0691b2fecca1ac4f53cb6dfb00b7013e561d1f34403b957cbb5af1fa4e49474854';

const { data } = await axios.get(`${BASE_URL}/swap/averagePrice/ADA/${NIGHT}`, {
  headers,
});

console.log(data.price_ba);
// 0.052
```

{% endtab %}
{% endtabs %}

***

## Get Liquidity Pools

Get all liquidity pools for a token pair.

**Endpoint**

`GET /stats/pools/ADA/{token_id}`

**Response**

Array of pool objects:

| Field            | Type   | Description          |
| ---------------- | ------ | -------------------- |
| `dex_name`       | string | DEX identifier       |
| `token_1_amount` | number | ADA amount in pool   |
| `token_2_amount` | number | Token amount in pool |
| `pool_id`        | string | Pool identifier      |

{% tabs %}
{% tab title="Example" %}

```javascript
const NIGHT =
  '0691b2fecca1ac4f53cb6dfb00b7013e561d1f34403b957cbb5af1fa4e49474854';

const { data: pools } = await axios.get(
  `${BASE_URL}/stats/pools/ADA/${NIGHT}`,
  { headers }
);

console.log(pools);
// [
//   {
//     dex_name: "MINSWAP",
//     token_1_amount: 500000,
//     token_2_amount: 10000000,
//     pool_id: "pool123..."
//   },
//   {
//     dex_name: "SUNDAESWAP",
//     token_1_amount: 250000,
//     token_2_amount: 5000000,
//     pool_id: "pool456..."
//   }
// ]
```

{% endtab %}
{% endtabs %}

***

## Get Trading Pairs

Get available trading pairs for a token.

**Endpoint**

`GET /stats/pairs/{token_id}`

**Response**

Array of trading pair objects with liquidity info.

{% tabs %}
{% tab title="Example" %}

```javascript
const NIGHT =
  '0691b2fecca1ac4f53cb6dfb00b7013e561d1f34403b957cbb5af1fa4e49474854';

const { data: pairs } = await axios.get(`${BASE_URL}/stats/pairs/${NIGHT}`, {
  headers,
});

console.log(pairs);
// [
//   {
//     token_id: "",
//     ticker: "ADA",
//     liquidity: 750000
//   },
//   {
//     token_id: "...",
//     ticker: "USDM",
//     liquidity: 50000
//   }
// ]
```

{% endtab %}
{% endtabs %}

***

## Get Daily Stats

Get 24h trading statistics for a token.

**Endpoint**

`GET /stats/daily_stats/ADA/{token_id}`

**Response**

| Field               | Type   | Description       |
| ------------------- | ------ | ----------------- |
| `daily_buys_count`  | number | Number of buys    |
| `daily_sales_count` | number | Number of sells   |
| `daily_volume`      | number | 24h volume in ADA |

{% tabs %}
{% tab title="Example" %}

```javascript
const NIGHT =
  '0691b2fecca1ac4f53cb6dfb00b7013e561d1f34403b957cbb5af1fa4e49474854';

const { data: stats } = await axios.get(
  `${BASE_URL}/stats/daily_stats/ADA/${NIGHT}`,
  { headers }
);

console.log(stats);
// {
//   daily_buys_count: 156,
//   daily_sales_count: 89,
//   daily_volume: 45000
// }
```

{% endtab %}
{% endtabs %}
