Need help with your APIs? I offer API discovery, governance & evangelism services. Explore services →
API Evangelist API Evangelist
Discovery
Learnings
Guidance
Toolbox
Alignment
API Evangelist LLC

Infura JSON-RPC API

Multi-chain JSON-RPC over HTTPS and WebSockets across 23+ networks (Ethereum, Linea, Polygon, Arbitrum, Optimism, Base, Avalanche, BNB, Scroll, Mantle, Blast, Starknet, etc.).

Infura JSON-RPC API is one of 6 APIs that Infura publishes on the APIs.io network, described by an AsyncAPI event-driven specification.

Tagged areas include JSON-RPC, WebSocket, and Multi-chain. The published artifact set on APIs.io includes API documentation and an AsyncAPI specification.

This event API exposes 2 operations across 1 channel, and defines 28 schemas. It is described by AsyncAPI 2.6.0, at version 1.0.0.

The API connects through a single server, wss://{network}.infura.io/ws/v3/{projectId} (wss).

2 operations 1 channels 28 schemas

Metadata

The identity and technical contract details declared by the specification.

Specification
AsyncAPI 2.6.0
API Version
1.0.0
Base URL
https://{network}.infura.io/v3/{apiKey}
Resource Areas
1

Channels & Operations 2

Across 1 channel, the API surfaces 2 operations. Each is listed below with its action, channel, parameters, and response codes.

Channels 2
SUB
/
Server-to-client frames (responses and notifications)
receiveJsonRpcFrames body
PUB
/
Client-to-server JSON-RPC request
sendJsonRpcRequest body

Messages & Schemas 28

The contract defines 28 schemas that model the data carried by its messages. The most detailed are BlockHeader (14 properties), LogEntry (9 properties), EthSubscribeRequest (4 properties), EthUnsubscribeRequest (4 properties). Each schema is shown below with its type and property counts.

EthSubscribeRequest
message
Create a new subscription for a particular event.
EthSubscribeResponse
message
JSON-RPC response containing the newly created subscription ID.
EthUnsubscribeRequest
message
Cancel an existing subscription by its subscription ID.
EthUnsubscribeResponse
message
Boolean flag indicating whether unsubscription succeeded.
NewHeadsNotification
message
Emitted each time a new header is appended to the chain.
LogsNotification
message
Emitted when matching event logs are included in new blocks.
NewPendingTransactionsNotification
message
Emitted as new transactions enter the pending pool.
JsonRpcErrorResponse
message
Standard JSON-RPC 2.0 error envelope.
JsonRpcId
object
Client-supplied identifier echoed back in the matching response. Notifications (ethsubscription) omit id.
JsonRpcVersion
string
JSON-RPC protocol version. Always "2.0".
HexQuantity
string
Hex-encoded quantity, prefixed with 0x.
HexData
string
Hex-encoded byte data, prefixed with 0x.
Address
string
20-byte Ethereum address, hex-encoded with 0x prefix.
Hash32
string
32-byte hash (e.g. block hash, transaction hash, topic).
SubscriptionId
string
Subscription identifier returned by ethsubscribe.
LogsFilter
object
Optional second parameter of ethsubscribe when the subscription type is logs. Either address, topics, or both should be supplied per Infura's recommendation.
2 properties
SubscriptionType
string
Subscription event type. Enumerated per the official Infura / MetaMask Developer Ethereum subscription-methods documentation.
EthSubscribeRequest
object
4 properties 4 required
EthSubscribeResponse
object
3 properties 3 required
EthUnsubscribeRequest
object
4 properties 4 required
EthUnsubscribeResponse
object
3 properties 3 required
BlockHeader
object
Ethereum block header as emitted on newHeads notifications.
14 properties
LogEntry
object
Ethereum log entry. The removed property is true when this log was emitted on the old chain after a reorg.
9 properties
NotificationEnvelope
object
Common JSON-RPC envelope for asynchronous ethsubscription notifications. Subtypes refine params.result for the specific subscription type.
2 properties 3 required
NewHeadsNotification
object
LogsNotification
object
NewPendingTransactionsNotification
object
JsonRpcErrorResponse
object
3 properties 3 required

Specification

The full machine-readable AsyncAPI contract behind this narrative.

Source

infura-asyncapi.yml Raw ↑

Other APIs Infura publishes across the network.

Infura Solana JSON-RPC
Infura Gas API
Infura IPFS API
Infura NFT API
Infura Infura (MetaMask Developer) JSON RPC API API