eth_call
Polygon / https://triport.io/polygon
Minimum tier: Free
Last updated:
eth_call runs a message call locally on a Polygon node and returns whatever
the contract's code would return, without broadcasting a transaction,
mining a block, or changing any state. It is the workhorse for reading on-chain
data: token balances (balanceOf), allowances, pool reserves, oracle prices,
and any other view/pure function or simulated state-changing call.
Because the call is executed in-memory against a chosen block, you get an
instant, gas-free answer. Use it whenever you need to read contract state or
simulate the outcome of a call before sending a real transaction. To actually
broadcast a state change, use eth_sendRawTransaction instead.
Gotchas
- The
datafield must be the ABI-encoded calldata — a 4-byte function selector followed by the 32-byte-padded arguments. Build it with a library (ethers/web3/viem) rather than by hand. - A reverting contract returns an error (with the revert reason when available), not an empty result. Always handle the error path.
- Results reflect the state at the requested block tag. Omitting the tag means
latest, which can change between calls. - Batch your reads. Calling
eth_callonce per token/account burns your rps budget fast. Route many reads through Multicall3 at0xcA11bde05977b3631167028862bE2a173976CA11(same address on Polygon) and collapse dozens of reads into a singleeth_call.
Parameters
This method takes no parameters.
Returns
| Field | Type |
|---|---|
| result | object |
Examples
curl https://triport.io/polygon \
-X POST -H 'Content-Type: application/json' \
-H 'Authorization: Bearer <api-key>' \
-d '{"jsonrpc":"2.0","id":1,"method":"eth_call","params":[]}'const res = await fetch("https://triport.io/polygon", {
method: "POST",
headers: { "Content-Type": "application/json", Authorization: "Bearer <api-key>" },
body: JSON.stringify({
"jsonrpc": "2.0",
"id": 1,
"method": "eth_call",
"params": []
}),
});
const data = await res.json();import requests
resp = requests.post(
"https://triport.io/polygon",
headers={"Authorization": "Bearer <api-key>"},
json={"jsonrpc":"2.0","id":1,"method":"eth_call","params":[]},
)
print(resp.json())Usage
- Transport: HTTP (JSON-RPC).
- Chain: Polygon.
- Clusters: mainnet.
- Credit cost: 1 per call.
FAQ
- What does eth_call do?
- Executes a read-only smart-contract call against the current (or a historical) Polygon state, returning the raw result without creating a transaction or spending gas.
- How many credits does eth_call cost?
- eth_call costs 1 credit(s) per call on Triport by default.
- Is eth_call available over WebSocket?
- eth_call is an HTTP JSON-RPC method.