Uniswap API

Uniswap exchange trade and price data.

Demo

This API powers CoinGecko Uniswap exchange coverage.

API Access

Beta Version

The v0 endpoints are in beta. We expect to make some changes in advance of releasing the v1 stable version of the API.

Please email hello@blocklytics.org for an API key.

Append the API key to the end of the request. For example:

curl https://api.blocklytics.org/uniswap/v0/exchanges?key=API_KEY

Factories

get
All Factories

https://api.blocklytics.org/uniswap/v0/factories
Returns a list of all factories.
Request
Response
Query Parameters
key
required
string
API key
200: OK
[
"0xc0a47dfe034b400b47bdad5fecda2621de6c4d95",
"0x2fc8507beb41a60a37e3ac65fb41a01d9a6585da",
"0xbe87b46515ab488713daa155d92abbd0e5964f6a",
"0x30a27e6f9d7ce7e39bff0068188f09f020164155"
]

Exchanges

get
All Exchanges

https://api.blocklytics.org/uniswap/v0/exchanges
Returns a list of exchanges with 24h volume, current price and liquidity details. Excludes exchanges with no liquidity. ⚠️ Avoid double-counting trade volume by using either `ethVolume` OR `tokenVolume`.
Request
Response
Query Parameters
key
required
string
API key
200: OK
[{
"ethLiquidity":11885.298838344355,
"ethVolume":826.4742565939489,
"exchange":"0x2c4bd064b998838076fa341a83d007fc2fa50957",
"factory":"0xc0a47dfe034b400b47bdad5fecda2621de6c4d95",
"price":0.3310788756378723,
"timestamp":"2019-05-11T05:37:26+00:00",
"token":"0x9f8f72aa9304c8b593d555f12ef6589cc3a579a2",
"tokenLiquidity":3934.971376019159,
"tokenSymbol":"MKR",
"tokenVolume":279.569025472665
}]

get
Exchanges for Address

https://api.blocklytics.org/uniswap/v0/exchanges/{address}
Returns a list of exchanges with 24h volume, current price and liquidity details given the address of an exchange, factory or token. ⚠️ Avoid double-counting trade volume by using either `ethVolume` OR `tokenVolume`.
Request
Response
Path Parameters
address
required
string
Factory, token or exchange address
Query Parameters
key
required
string
API key
200: OK
[{
"ethLiquidity":11885.298838344355,
"ethVolume":826.4742565939489,
"exchange":"0x2c4bd064b998838076fa341a83d007fc2fa50957",
"factory":"0xc0a47dfe034b400b47bdad5fecda2621de6c4d95",
"price":0.3310788756378723,
"timestamp":"2019-05-11T05:37:26+00:00",
"token":"0x9f8f72aa9304c8b593d555f12ef6589cc3a579a2",
"tokenLiquidity":3934.971376019159,
"tokenSymbol":"MKR",
"tokenVolume":279.569025472665
}]

Trades

get
Trades for Address

https://api.blocklytics.org/uniswap/v0/trades/{address}
Returns historical trades given the address of an account or exchange.
Request
Response
Path Parameters
address
required
string
Account or exchange address
Query Parameters
from
optional
string
Filter by a starting date (inclusive), using YYYY-MM-DD format
to
optional
string
Filter by an ending date (inclusive), using YYYY-MM-DD format
key
required
string
API key
200: OK
[{
"action": "BUY",
"exchange": "0x2c4bd064b998838076fa341a83d007fc2fa50957",
"id": 76515130006,
"price": 3.286168626746399,
"quantity": 0.9901,
"timestamp": "2019-04-27T19:51:42+00:00",
"token": "0x9f8f72aa9304c8b593d555f12ef6589cc3a579a2",
"tokenSymbol": "MKR",
"trader":"0xef422dbbf46120de627ffb913c9afad44c735618",
"transaction": "0x39e12af3d04a2056d60baf62be5c59e0d6467c73be5537d07918846f7619bc1d",
"volume":3.25363555734161
},
{
"action": "SELL",
"exchange": "0x2c4bd064b998838076fa341a83d007fc2fa50957",
"id": 76514010100,
"price": 3.270360912449533,
"quantity": 5.0,
"timestamp": "2019-04-27T19:26:40+00:00",
"token": "0x9f8f72aa9304c8b593d555f12ef6589cc3a579a2",
"tokenSymbol": "MKR",
"trader":"0x57e15de11e5fe92345e2ff8ba9d4a1acbe9d84b8",
"transaction": "0xece02f355ca1ec1dd862bedcca760d84900cbd2d71d7c20dcaaf537daeeb4872",
"volume": 16.351804562247665
}]

Liquidity

get
Liquidity for Address

https://api.blocklytics.org/uniswap/v0/liquidity/{address}
Returns historical liquidity activities given the address of an account or exchange.
Request
Response
Path Parameters
address
required
string
Account or exchange address
Query Parameters
from
optional
string
Filter by a starting date (inclusive), using YYYY-MM-DD format
to
optional
string
Filter by an ending date (inclusive), using YYYY-MM-DD format
key
required
string
API Key
200: OK
[{
"action":"ADD",
"ethAmount":0.9363625288501211,
"exchange":"0x09cabec1ead1c0ba254b09efb3ee13841712be14",
"id":78555520026,
"liquidity_provider":"0x01c5d2e9a6926627dbd74eb004f60c097f2c8cca",
"timestamp":"2019-05-29T16:23:49+00:00",
"token":"0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
"tokenAmount":254.61410117033302,
"tokenSymbol":"DAI",
"transaction":"0xd40a794b51e270cfa0449823bfeb3abfc4cd7e9d802750f80c5e05ab293b6bbf"
},{
"action":"REMOVE",
"ethAmount":0.938805193690121,
"exchange":"0x09cabec1ead1c0ba254b09efb3ee13841712be14",
"id":78555500020,
"liquidity_provider":"0x01c5d2e9a6926627dbd74eb004f60c097f2c8cca",
"timestamp":"2019-05-29T16:23:05+00:00",
"token":"0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
"tokenAmount":255.78495552297795,
"tokenSymbol":"DAI",
"transaction":"0x68adc410c42dfa48f41d767dec8c2c51f994c7e0b3dd7994b38936277479a478"
}]