Skip to Content
ServicesEVM RPC REST APIeth_chainId

eth_chainId

Return the chain id for the selected EVM route.

Available under EVM REST API. Use the chain-family pages for route switching and the method pages for exact request and response shapes.

Access patterns

PatternValueNotes
Bearer header (Recommended)POST /rpc/{evm_chain}Recommended default. Keep the API key in `Authorization: Bearer <api_key>`. Current baseline routes: `/rpc/ethereum`, `/rpc/bnbchain`, `/rpc/base`, `/rpc/arbitrum`, `/rpc/optimism`, `/rpc/polygon`. Examples use `/rpc/ethereum`.
URL compatibilityPOST /v1/{evm_chain}/<api_key>Use only when the client can store one full RPC URL but cannot send custom headers. Replace `{evm_chain}` with one of `/rpc/ethereum`, `/rpc/bnbchain`, `/rpc/base`, `/rpc/arbitrum`, `/rpc/optimism`, `/rpc/polygon`.

Examples

Bearer auth example
curl -X POST "https://gw-aql.tomo.services/rpc/ethereum" \ -H "Authorization: Bearer <api_key>" \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "eth_chainId", "params": []}'
Try send

Try eth_chainId

Send one direct browser request to the current hosted gateway base URL so the real network request is visible in devtools. The API key is only stored locally when you provide one.

Request fields

JSON-RPC request body

FieldTypeRequiredNotes
jsonrpcstringRequiredJSON-RPC version. Use `2.0`.
idstring | numberRequiredCaller request id.
methodstringRequiredAllowlisted chain method.
paramsarrayRequiredMethod arguments.

Response fields

JSON-RPC response body

FieldTypeNotes
jsonrpcstringJSON-RPC version.
idstring | numberEchoed request id.
resultunknownSuccessful method result.
errorobjectStandard JSON-RPC error object when the request fails.