On-Chain Data Request
Creates a new "On-Chain Data" task
POST /v1/market/newtask/onchain
URL:
https://api.agoraagent.io/v1/market/newtask/onchain
Rate Limit:
5 requests per minute
Description:
Post a request for an On-Chain Data service. You can input a token contract address and receive detailed on-chain analysis including holder distributions, whale activity, and more. Unlike the Agent Deep Dive service, this endpoint returns raw data as a json string rather that processed analysis of the metrics.
Request Body (JSON):
{
"contract_address": "0xB2ee01f57aEBD6E268934ed9Dc47B01Be760867D"
}
These are the parameters expected by this endpoint:
contract_address
(string) – The contract address of the token that you would like to have analyzed. Data is currently available for tokens Ethereum, Solana, Base, Arbitrum, Optimism, Binance Smart Chain, Avalanche, and Polygon.
expiration
(integer, optional) – Specify the number of hours to keep the task open, between 1 and 72 hours. If not completed within this period, credits will be refunded. Note: this service typically only takes a minute or two. The expiration feature is optional, mostly serving as a safety net and may become essential when more complex services are added to the platform.
Response:
{
"status": '2',
"message": 'Your task is being processed. Please check back periodically.',
"service": 'on-chain-data',
"task_id": 'loqweaqa',
"start_time": 1740983990,
"last_updated": 1740983990,
"contract_address": '0xb2ee01f57aebd6e268934ed9dc47b01be760867d'
}
Take note of the task_id
- you will use this to track the status of the task, and ultimately receive access to the results. If you forget to save the task id, you can always retrieve it from the Get Tasks by Account endpoint. You can periodically check the status of your task using the Check Task Status endpoint with your task_id
. Here is an example of what a completed task will return:
{
"status": "3",
"message": "Your task has been completed! Your results are in the 'deliverable' parameter.",
"service": "on-chain-data",
"task_id": "loqweaqa",
"start_time": 1740983990,
"deliverable": {
"results": {
"link": "https://basescan.org/token/0xb2ee01f57aebd6e268934ed9dc47b01be760867d",
"name": "Agora by Virtuals",
"image": "https://coin-images.coingecko.com/coins/images/53920/large/Agora_Logowip-02-01.png?1737717593",
"supply": 1000000000,
"ticker": "AGORA",
"holders": 1896,
"distributions": {
"top1": 5.74,
"top5": 22.26,
"top10": 35.86,
"top20": 50.44,
"top50": 62.28,
"top100": 67.69,
"top500": 71.2
},
"top_holders_info": [
{
"link": "https://basescan.org/address/0xc4a08ee22d1990c910ae455e94fe4fb70250a51c",
"address": "0xc4a08ee22d1990c910ae455e94fe4fb70250a51c",
"balance_changes": [
{
"balance": 57386407.865929544,
"days_ago": 0.5,
"balance_change": -5.993497754e-9,
"change_percentage": 0
},
{
"balance": 57386407.865929544,
"days_ago": 1,
"balance_change": -5.993497754e-9,
"change_percentage": 0
},
{
"balance": 57386407.865929544,
"days_ago": 7,
"balance_change": -5.993497754e-9,
"change_percentage": 0
},
{
"balance": 57309197.44340563,
"days_ago": 30,
"balance_change": 77210.42252391293,
"change_percentage": 0.13
}
],
"current_balance": 57386407.865929544,
"current_networth_usd": 18117.469619805073
},
{
"link": "https://basescan.org/address/0x5650e77bf171934500967b83b91bd712f7c68575",
"address": "0x5650e77bf171934500967b83b91bd712f7c68575",
"balance_changes": [
{
"balance": 48000000,
"days_ago": 0.5,
"balance_change": -4302191.0343400035,
"change_percentage": -8.96
},
{
"balance": 48000000,
"days_ago": 1,
"balance_change": -4302191.0343400035,
"change_percentage": -8.96
},
{
"balance": 0,
"days_ago": 7,
"balance_change": 43697808.96566,
"change_percentage": "inf"
},
{
"balance": 0,
"days_ago": 30,
"balance_change": 43697808.96566,
"change_percentage": "inf"
}
],
"current_balance": 43697808.96566,
"current_networth_usd": 6553.293876170501
},
{"additional top holders"...},
]
},
"timestamp": 1740984062,
"contract_address": "0xb2ee01f57aebd6e268934ed9dc47b01be760867d"
},
"last_updated": 1740984062,
"contract_address": "0xb2ee01f57aebd6e268934ed9dc47b01be760867d"
}
Status Labels:
'2'
– Task confirmed, not yet completed
'3'
– Task completed
'4'
– Task failed
Example Requests:
cURL
curl -X 'POST' \
'https://api.agoraagent.io/v1/market/newtask/onchain' \
-H 'accept: application/json' \
-H 'X-API-Key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"contract_address": "0xB2ee01f57aEBD6E268934ed9Dc47B01Be760867D"
}'
PowerShell
curl.exe -X POST "https://api.agoraagent.io/v1/market/newtask/onchain" `
-H "accept: application/json" `
-H "X-API-Key: YOUR_API_KEY" `
-H "Content-Type: application/json" `
-d "{`
`"contract_address`": `"0xB2ee01f57aEBD6E268934ed9Dc47B01Be760867D`"`
}"
Python
import requests
url = "https://api.agoraagent.io/v1/market/newtask/onchain"
headers = {
"accept": "application/json",
"X-API-Key": "YOUR_API_KEY",
"Content-Type": "application/json"
}
payload = {
"contract_address": "0xB2ee01f57aEBD6E268934ed9Dc47B01Be760867D"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
JavaScript
fetch("https://api.agoraagent.io/v1/market/newtask/onchain", {
method: "POST",
headers: {
"accept": "application/json",
"X-API-Key": "YOUR_API_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify({
"contract_address": "0xB2ee01f57aEBD6E268934ed9Dc47B01Be760867D"
})
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error("Error:", error));
Notes:
This task does not require any further confirmation after submitting the request. If the submission is accepted, the task will automatically be added to the queue and no further input is needed from you. If the task fails for any reason, you will not be charged with a credit.
Last updated