Trigger transaction synchronization for an address, bypassing the 10-minute cache to force an immediate update.
Cost: 1 credit + 1 credit per 250 transactions indexed
Index Limit — Addresses with more than 100,000 transactions are not indexed. Contact support for assistance.
Endpoint
POST https://api.octav.fi/v1/sync-transactions
Request Body
Array of addresses to sync (currently supports 1 address){
"addresses": ["0x6426af179aabebe47666f345d69fd9079673f6cd"]
}
Example
curl -X POST "https://api.octav.fi/v1/sync-transactions" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"addresses": ["0x6426af179aabebe47666f345d69fd9079673f6cd"]}'
Response
Returns a string indicating sync status:
"Address is syncing" - Synchronization started
"Address already syncing" - Address is currently syncing
Cost Breakdown
1 credit per sync request
1 credit per 250 transactions indexed
- Only new transactions since last sync are indexed
- Transactions are indexed permanently (one-time cost)
- Subsequent syncs only pay for new transactions
Example Costs
First Sync
Update Sync
No New Transactions
Address with 10,000 transactions:
- API call: 1 credit
- Indexing: 40 credits (10,000 ÷ 250)
- Total: 41 credits ($1.03)
Address with 100 new transactions since last sync:
- API call: 1 credit
- Indexing: 1 credit (100 ÷ 250, rounded up)
- Total: 2 credits ($0.05)
No transactions since last sync:
- API call: 1 credit
- Indexing: 0 credits
- Total: 1 credit ($0.025)
Use Cases
Force Update
Check Before Sync
Force immediate transaction sync:async function forceSync(address) {
const response = await fetch(
'https://api.octav.fi/v1/sync-transactions',
{
method: 'POST',
headers: {
'Authorization': `Bearer ${apiKey}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({ addresses: [address] })
}
);
const status = await response.text();
console.log(`Sync status: ${status}`);
// Wait for sync to complete
await new Promise(resolve => setTimeout(resolve, 5000));
// Fetch updated transactions
const txResponse = await fetch(
`https://api.octav.fi/v1/transactions?addresses=${address}&limit=10&offset=0&sort=DESC`,
{ headers: { 'Authorization': `Bearer ${apiKey}` } }
);
return await txResponse.json();
}
Check status before syncing:async function smartSync(address) {
// Check current status
const statusResponse = await fetch(
`https://api.octav.fi/v1/status?addresses=${address}`,
{ headers: { 'Authorization': `Bearer ${apiKey}` } }
);
const [status] = await statusResponse.json();
// Check if sync needed
const lastSync = new Date(status.transactionsLastSync);
const now = new Date();
const minutesSinceSync = (now - lastSync) / 1000 / 60;
if (minutesSinceSync > 10 && !status.syncInProgress) {
console.log('Triggering sync...');
await fetch('https://api.octav.fi/v1/sync-transactions', {
method: 'POST',
headers: {
'Authorization': `Bearer ${apiKey}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({ addresses: [address] })
});
} else if (status.syncInProgress) {
console.log('Sync already in progress');
} else {
console.log('Recent sync available, no need to sync');
}
}
Best Practices
Use the Status endpoint to check if a sync is needed before triggering oneAvoid unnecessary sync costs by checking transactionsLastSync timestamp
If you receive “Address already syncing”, wait for the current sync to completeTypical sync time: 5-30 seconds depending on transaction count
First-time syncs can be expensive for addresses with many transactionsRegular syncs are cheap as only new transactions are indexed