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

# Get Volume by Exchange

> Retrieve trading volume distribution across exchanges

## Overview

Returns trading volume data for a token distributed across different exchanges over a date range. Use this to understand where trading activity is happening.

## Path Parameters

<ParamField path="tokenAddress" type="string" required>
  Token contract address (hex format)
</ParamField>

## Query Parameters

<ParamField query="startDate" type="string" required>
  Start date (YYYY-MM-DD format)
</ParamField>

<ParamField query="endDate" type="string" required>
  End date (YYYY-MM-DD format)
</ParamField>

## Response

Returns an array of volume data by exchange.

<ResponseField name="value" type="number" required>
  Trading volume in token amount
</ResponseField>

<ResponseField name="valueUsd" type="number" required>
  Trading volume in USD
</ResponseField>

<ResponseField name="exchange" type="string" required>
  Exchange/DEX name
</ResponseField>

<ResponseField name="startDate" type="string" required>
  Start date of the period (YYYY-MM-DD format)
</ResponseField>

<ResponseField name="endDate" type="string" required>
  End date of the period (YYYY-MM-DD format)
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl "https://starknet.impulse.avnu.fi/v3/tokens/0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7/exchange-volumes?startDate=2024-02-01&endDate=2024-02-14"
  ```

  ```typescript TypeScript theme={null}
  const tokenAddress = '0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7';

  const params = new URLSearchParams({
    startDate: '2024-02-01',
    endDate: '2024-02-14'
  });

  const response = await fetch(
    `https://starknet.impulse.avnu.fi/v3/tokens/${tokenAddress}/exchange-volumes?${params}`
  );

  const volumeData = await response.json();

  // Calculate total volume by exchange
  const totalVolume = volumeData.reduce((sum, item) => sum + item.valueUsd, 0);

  volumeData
    .sort((a, b) => b.valueUsd - a.valueUsd)
    .forEach(item => {
      const share = (item.valueUsd / totalVolume) * 100;
      console.log(`${item.exchange}: $${item.valueUsd.toLocaleString()} (${share.toFixed(1)}%)`);
    });
  ```

  ```python Python theme={null}
  import requests

  token_address = '0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7'

  params = {
      'startDate': '2024-02-01',
      'endDate': '2024-02-14'
  }

  response = requests.get(
      f'https://starknet.impulse.avnu.fi/v3/tokens/{token_address}/exchange-volumes',
      params=params
  )

  volume_data = response.json()

  # Calculate total and display distribution
  total = sum(item['valueUsd'] for item in volume_data)
  for item in sorted(volume_data, key=lambda x: -x['valueUsd']):
      share = (item['valueUsd'] / total) * 100
      print(f"{item['exchange']}: ${item['valueUsd']:,.0f} ({share:.1f}%)")
  ```
</RequestExample>

<ResponseExample>
  ```json theme={null}
  [
    {
      "value": 5234.567,
      "valueUsd": 2500000,
      "exchange": "Ekubo",
      "startDate": "2024-02-01",
      "endDate": "2024-02-14"
    },
    {
      "value": 3789.123,
      "valueUsd": 1800000,
      "exchange": "JediSwap",
      "startDate": "2024-02-01",
      "endDate": "2024-02-14"
    }
  ]
  ```
</ResponseExample>
