# Market Data

## Market Data Overview&#x20;

## Gets an overview of market data for a given base and target.

<mark style="color:blue;">`GET`</mark> `https://api.aio.exchange/api/v2/marketdata/quote/{baseTokenId}-{targetTokenId}`&#x20;

**`*`Recommended**

&#x20;                                                            **OR**

<mark style="color:blue;">`GET`</mark> `https://api.aio.exchange/api/v2/marketdata/quote/{baseSymbol}-{targetSymbol}`

This is a public endpoint. Provides the best bid, the best ask, and live market information. &#x20;

#### Path Parameters

| Name                         | Type   | Description                                              |
| ---------------------------- | ------ | -------------------------------------------------------- |
| baseSymbol                   | String | Ticker Pair of the base currency e.g. for Bitcon: BTC    |
| targetSymbol                 | String | Ticker Pair of the target currency e.g. for Tether: USDT |
| <p><br>baseTokenId<br></p>   | Int    | Token ID of the base currency e.g. for Bitcoin: 1        |
| <p><br>targetTokenId<br></p> | Int    | Token ID of the target currency e.g. for Tether: 825     |

{% tabs %}
{% tab title="200: OK /api/v1/marketdata/btc-usdt" %}
{% code overflow="wrap" %}

```json
// GET  Response

{
  "data": {
    "aggregatedVolume": 116132.8442178152, // sum of volume from connections 
    "high": 19176.3, // overall high 24h
    "low": 16574.4, // overall low 24h
    "baseSymbol": "BTC",
    "targetSymbol": "USDT",
    "baseTokenId": 1, //Unique AIO ID for token
    "targetTokenId": 825,
    "bestBid": {
      "exchangeName": "OKCOIN",
      "price": 16692.6,
      "size": 0.0056
    },
    "bestAsk": {
      "exchangeName": "BITSTAMP",
      "price": 16713,
      "size": 0
    },
    "dailyChange": 84.59939, //24h
    "dailyPercentageChange": 0.5081060598 //24h
  },
  "success": true,
  "error": null,
  "timestamp": 1668931096371,
  "requestId":"1234"
}
```

{% endcode %}
{% endtab %}
{% endtabs %}

## To Complete: Retrieves a snapshot of tickers across all exchanges.

<mark style="color:blue;">`GET`</mark> `https://api.aio.exchange/api/v2/marketdata/snapshot/{baseTokenId}-{targetTokenId}`

Get's the last stored data from each exchange ticker

#### Path Parameters

| Name          | Type | Description                                          |
| ------------- | ---- | ---------------------------------------------------- |
| baseTokenId   | Int  | Token ID of the base currency e.g. for Bitcon: 1     |
| targetTokenId | Int  | Token ID of the target currency e.g. for Tether: 825 |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
  "response":
     data:[ {
        "exchangeName": "BINANCE",
        "bestAsk": 21934.50,
        "bestAskSize": 14.291,
        "bestBid": 21931.30,
        "bestBidSize": 12.21,
        "lastPrice": 21941.30,
        "volume":559357.12
      }, {
        "exchangeName": "BITFINEX",
        "bestAsk": 21930.20,
        "bestAskSize": 7.241,
        "bestBid": 21927.10,
        "bestBidSize": 1.78,
        "lastPrice": 21941.30,
        "volume":11555
      }, {
        "exchangeName": "BITMART",
        "bestAsk": 21934.50,
        "bestAskSize": 4.291,
        "bestBid": 21931.30,
        "bestBidSize": 1.2,
        "lastPrice": 21941.30,
        "volume":559357
      }, {
        "exchangeName": "BITSTAMP",
        "bestAsk": 21934.50,
        "bestAskSize": 4.291,
        "bestBid": 21931.30,
        "bestBidSize": 1.2,
        "lastPrice": 21941.30,
        "volume":559357
      },
      ...
      ],
      
      "maxCutOff":5000 // this is the number of milliseconds before we stop returning data for that exchange
      
     },   
  "success": true,
  "error": null,
  "timestamp": 1668931096371,
  "requestId":"1234"

}
```

{% endtab %}
{% endtabs %}

## Retrieves information about a specific token, and relevant metadata

<mark style="color:blue;">`GET`</mark> `https://api.aio.exchange/api/v2/marketdata/tokeninformation/{symbol}`

#### Path Parameters

| Name                                     | Type   | Description                                        |
| ---------------------------------------- | ------ | -------------------------------------------------- |
| symbol<mark style="color:red;">\*</mark> | String | Ticker symbol of the currency e.g. for Bitcon: BTC |

{% tabs %}
{% tab title="200: OK " %}

<pre class="language-json"><code class="lang-json">{
    "data":
    [{
        "tokenId":132,
        "coinId":781,
        "name":"Cardano",
        "ticker":"ADA",
        "description":"Cardano (ADA) is a cryptocurrency launched in 2017. Cardano has a current supply of 35,538,184,453.812 with 34,670,947,960.302 in circulation. The last known price of Cardano is 0.3296321 USD and is down -7.69 over the last 24 hours. It is currently trading on 661 active market(s) with $316,529,610.18 traded over the last 24 hours. More information can be found at https://www.cardano.org.",
        "logoURL":"https://s2.coinmarketcap.com/static/img/coins/64x64/2010.png",
        "website":"https://www.cardano.org",
<strong>        "rank":7,
</strong>        "marketCap":11424034959.8761980000,
        "dilutedMarketCap":14827444977.3600000000,
        "aioConnectedExchanges":11
    }],
  "success": true,
  "error": null,
  "timestamp": 1668931096371,
  "requestId":"1234"
}
</code></pre>

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.aio.exchange/market-data.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
