eth_syncing
https://api.triport.io/Reports whether the Ethereum node is currently syncing, returning `false` when fully synced or a sync-progress object while catching up.
eth_syncing tells you whether the node serving your request is fully
synchronized with the head of the Ethereum chain. When the node is caught up,
it returns the boolean false. While the node is still importing blocks, it
returns an object describing how far the sync has progressed.
Use this as a lightweight health probe before depending on the freshness of
data from other reads such as eth_blockNumber or
eth_getBlockByNumber. On the Triport platform
requests are routed to synced nodes, so in normal operation you should expect
false; a sync object is the signal that the node you reached is still
backfilling and its latest-block data may lag the true chain head.
Note that the numeric fields are returned as hex-encoded quantity strings
(e.g. "0x9e64d"), not decimal numbers — decode them before doing arithmetic.
Parameters
This method takes no parameters. Pass an empty array for params.
——optionalResponse
When the node is fully synced:
When the node is still syncing:
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"startingBlock": "0x9e640",
"currentBlock": "0x9e64d",
"highestBlock": "0x9f2a1"
}
}resultboolean | objectfalse when fully synced; otherwise a sync-status object (fields below).result.startingBlockstring (hex quantity)result.currentBlockstring (hex quantity)result.highestBlockstring (hex quantity)Errors
| Code | Meaning | When it happens |
|---|---|---|
-32001 | trial_expired | The API key's trial period has ended; upgrade to a paid tier to continue. |
-32003 | rate_limited | You exceeded the requests-per-second limit for your tier. Back off and retry. |
Errors follow the standard JSON-RPC error envelope. See the shared errors reference for the full envelope shape and retry guidance.
Example rate-limited response:
{
"jsonrpc": "2.0",
"id": 1,
"error": {
"code": -32003,
"message": "rate_limited"
}
}Examples
JavaScript (fetch)
const res = await fetch("https://api.triport.io/", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.TRIPORT_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
jsonrpc: "2.0",
id: 1,
method: "eth_syncing",
params: [],
}),
});
const { result } = await res.json();
if (result === false) {
console.log("Node is fully synced");
} else {
console.log(`Syncing: ${parseInt(result.currentBlock, 16)} / ${parseInt(result.highestBlock, 16)}`);
}TypeScript SDK (@triport/sdk)
import { Triport } from "@triport/sdk";
const client = new Triport({ apiKey: process.env.TRIPORT_API_KEY! });
const syncing = await client.eth.syncing();
if (syncing === false) {
console.log("Node is fully synced");
} else {
console.log(`Syncing: ${parseInt(syncing.currentBlock, 16)} / ${parseInt(syncing.highestBlock, 16)}`);
}Python (triport-sdk)
import os
from triport import Triport
client = Triport(api_key=os.environ["TRIPORT_API_KEY"])
syncing = client.eth.syncing()
if syncing is False:
print("Node is fully synced")
else:
print(f"Syncing: {int(syncing['currentBlock'], 16)} / {int(syncing['highestBlock'], 16)}")Notes
- A
falseresult is the common case on Triport, since requests are routed to synced nodes. Treat a returned object as a transient condition. - All block numbers are hex-encoded quantity strings; convert with
parseInt(value, 16)(JS/TS) orint(value, 16)(Python). - For the absolute current head once synced, use
eth_blockNumber. - This method takes no parameters and is safe to poll, subject to your tier's RPS limit. See rate limits for burst behavior.