Blockchain SQL Query
curl --request POST \
--url https://api.asksurf.ai/gateway/v1/onchain/sql \
--header 'Content-Type: application/json' \
--data '
{
"sql": "SELECT transaction_hash, from_address, value FROM agent.ethereum_transactions LIMIT 5",
"max_rows": 1000
}
'import requests
url = "https://api.asksurf.ai/gateway/v1/onchain/sql"
payload = {
"sql": "SELECT transaction_hash, from_address, value FROM agent.ethereum_transactions LIMIT 5",
"max_rows": 1000
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
sql: 'SELECT transaction_hash, from_address, value FROM agent.ethereum_transactions LIMIT 5',
max_rows: 1000
})
};
fetch('https://api.asksurf.ai/gateway/v1/onchain/sql', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": [
{}
],
"meta": {
"cached": true,
"credits_used": 123,
"limit": 123,
"offset": 123,
"total": 123
},
"$schema": "https://example.com/schemas/DataResponseOnchainRow.json"
}{
"error": {
"code": "<string>",
"message": "<string>"
},
"$schema": "https://example.com/schemas/DataAPIError.json"
}Onchain
SQL Query
POST
/
gateway
/
v1
/
onchain
/
sql
Blockchain SQL Query
curl --request POST \
--url https://api.asksurf.ai/gateway/v1/onchain/sql \
--header 'Content-Type: application/json' \
--data '
{
"sql": "SELECT transaction_hash, from_address, value FROM agent.ethereum_transactions LIMIT 5",
"max_rows": 1000
}
'import requests
url = "https://api.asksurf.ai/gateway/v1/onchain/sql"
payload = {
"sql": "SELECT transaction_hash, from_address, value FROM agent.ethereum_transactions LIMIT 5",
"max_rows": 1000
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
sql: 'SELECT transaction_hash, from_address, value FROM agent.ethereum_transactions LIMIT 5',
max_rows: 1000
})
};
fetch('https://api.asksurf.ai/gateway/v1/onchain/sql', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": [
{}
],
"meta": {
"cached": true,
"credits_used": 123,
"limit": 123,
"offset": 123,
"total": 123
},
"$schema": "https://example.com/schemas/DataResponseOnchainRow.json"
}{
"error": {
"code": "<string>",
"message": "<string>"
},
"$schema": "https://example.com/schemas/DataAPIError.json"
}Body
application/json