Price (DEX only)

Find best price for token trades

get
price

https://data-api.defipulse.com/api/v1/dexag/price?from=ETH&to=DAI&fromAmount=1&dex=ag
Returns current price and DEX provider of best token swap trade
Request
Response
Request
Query Parameters
api-key
required
string
Create a free account at data.defipulse.com to obtain an api-key
from
optional
string
The token you want to send (input)
to
optional
string
The token you want to receive (output)
fromAmount
required
string
The amount of 'from' token you want to send
toAmount
required
string
The amount of 'to' token you want to receive
dex
optional
string
A specific DEX(uniswap), ag (aggregator), all(even external source)
discluded
optional
string
DEX's to disclude from the aggregator. Eg discluded=bancor
Response
200: OK
{
"dex":"ag",
"price":"235.71408989879922",
"pair": {
"base":"ETH",
"quote":"DAI"
},
"liquidity":{"bancor":100}
}

*Note: either fromAmount or toAmount must be specified.

Response: the price for a single DEX or a list of prices.

Value

Description

price

Price denoted in the "from" token (eg ETH)

dex

DEX providing the price (eg Uniswap)

pair

​eg ETH:USDC

base

Base token of the trading pair

quote

Quote token of the trading pair