POST
/
blockchain
/
query
curl --request POST \
  --url https://api.mobula.io/api/1/blockchain/query \
  --header 'Content-Type: application/json' \
  --data '{
  "sql": "SELECT * FROM assets WHERE symbol = '\''ETH'\''"
}'
{
  "data": [
    {}
  ]
}

Query quick start

Pass SQL payload to the SQL body parameter.

Available tables:

  • “PairTick”: tick-level price data for all DeFi pairs (pair_id, date, price, price_usd, volume, is_mev)
  • “Pair”: all pairs curated on Mobula (id, address, blockchain, base, quote)
  • “Trade”: all trades curated on Mobula (id, pair_id, date, token_in, token_out, token_in_amount, token_out_amount, hash, blockchain, amount_usd)
  • “EVMEvent_topic0”: Decoded events from a given topic

Example

{
  "sql": "SELECT * from \"EVMEvent_0x3c4b1d42b9c7fa283f6fe657533f6a5a8a7ad1d36f9ef1d9d89a\""
}

How to generate topic hash

from web3 import Web3
topic = Web3.sha3(text="Transfer(address,address,uint256)")
print(topic.hex())

If the topic is not found, it will throw an error. Use the blockchain/decode POST endpoint to decode the topic.

Body

application/json
sql
string

Response

200 - application/json
data
object[]