> 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/trending.md).

# Trending

Get trending tokens by volume.

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

**Base URL:** `https://charts.dhapi.io`
{% endhint %}

***

## Get Trending Tokens

Fetch tokens sorted by trading volume.

**Endpoint**

`POST /trending`

**Payload**

| Field    | Type   | Required | Description                   |
| -------- | ------ | -------- | ----------------------------- |
| `sort`   | string | ✓        | Sort method (`VOLUME_AMOUNT`) |
| `period` | string | ✓        | Time period                   |

**Response**

| Field                   | Type   | Description      |
| ----------------------- | ------ | ---------------- |
| `token_id`              | string | Token identifier |
| `token_symbol`          | string | Token ticker     |
| `current_period_volume` | number | Volume in ADA    |
| `price_change`          | number | Price change %   |

***

## Period Types

| Period  | Description     |
| ------- | --------------- |
| `5min`  | Last 5 minutes  |
| `30min` | Last 30 minutes |
| `1hour` | Last 1 hour     |
| `4hour` | Last 4 hours    |
| `1day`  | Last 24 hours   |

***

## Examples

{% tabs %}
{% tab title="Trending last hour" %}

```javascript
const API_KEY = 'YOUR_API_KEY';
const CHART_URL = 'https://charts.dhapi.io';
const headers = { 'X-Partner-Id': API_KEY };

const { data: trending } = await axios.post(`${CHART_URL}/trending`, {
  sort: 'VOLUME_AMOUNT',
  period: '1hour',
}, { headers });
```

{% endtab %}

{% tab title="Trending 24 hours" %}

```javascript
const { data: trending } = await axios.post(`${CHART_URL}/trending`, {
  sort: 'VOLUME_AMOUNT',
  period: '1day',
}, { headers });
```

{% endtab %}
{% endtabs %}
