Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Get an API key
Free tier, no form to fill in. Signing in shares your email address with us — we
store it to create your key and to recognise you if you sign in with another
provider. By signing up you are subscribing to the APIs.io and API Evangelist
newsletters — you can unsubscribe from any issue. See our
Privacy Policy and Terms.
openapi: 3.2.0
info:
title: Tendermint RPC WebSocket API
contact:
name: Tendermint RPC
url: https://github.com/tendermint/tendermint/issues/new/choose
description: 'Tendermint supports the following RPC protocols:
* URI over HTTP
* JSONRPC over HTTP
* JSONRPC over websockets
## Configuration
RPC can be configured by tuning parameters under `[rpc]` table in the
`$TMHOME/config/config.toml` file or by using the `--rpc.X` command-line
flags.'
version: v0.34
license:
name: Apache 2.0
url: https://github.com/tendermint/tendermint/blob/main/LICENSE
servers:
- url: https://rpc.cosmos.network
description: Cosmos mainnet node to interact with the Tendermint RPC
- url: http://localhost:26657
description: Interact with the Tendermint RPC locally on your device
tags:
- name: Websocket
description: Subscribe/unsubscribe are reserved for websocket events.
paths:
/subscribe:
get:
summary: Subscribe for events via WebSocket
tags:
- Websocket
operationId: subscribe
description: To tell which events you want, you need to provide a query.
parameters:
- in: query
name: query
required: true
schema:
type: string
example: tm.event = 'Tx' AND tx.height = 5
description: 'query is a string, which has a form: "condition AND condition ..." (no OR at the
moment). condition has a form: "key operation operand". key is a string with
a restricted set of possible symbols ( \t\n\r\\()"''=>< are not allowed).
operation can be "=", "<", "<=", ">", ">=", "CONTAINS". operand can be a
string (escaped with single quotes), number, date or time.
'
responses:
'200':
description: empty answer
content:
application/json:
schema:
$ref: '#/components/schemas/EmptyResponse'
'500':
description: empty error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/unsubscribe:
get:
summary: Unsubscribe from event on Websocket
tags:
- Websocket
operationId: unsubscribe
description: '```go
client := rpchttp.New("tcp:0.0.0.0:26657", "/websocket")
err := client.Start()
if err != nil {
handle error
}
defer client.Stop()
query := "tm.event = ''Tx'' AND tx.height = 3"
err = client.Unsubscribe(context.Background(), "test-client", query)
if err != nil {
handle error
}
```'
parameters:
- in: query
name: query
required: true
schema:
type: string
example: tm.event = 'Tx' AND tx.height = 5
description: 'query is a string, which has a form: "condition AND condition ..." (no OR at the
moment). condition has a form: "key operation operand". key is a string with
a restricted set of possible symbols ( \t\n\r\\()"''=>< are not allowed).
operation can be "=", "<", "<=", ">", ">=", "CONTAINS". operand can be a
string (escaped with single quotes), number, date or time.
'
responses:
'200':
description: Answer
content:
application/json:
schema:
$ref: '#/components/schemas/EmptyResponse'
'500':
description: Error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/unsubscribe_all:
get:
summary: Unsubscribe from all events via WebSocket
tags:
- Websocket
operationId: unsubscribe_all
responses:
'200':
description: empty answer
content:
application/json:
schema:
$ref: '#/components/schemas/EmptyResponse'
'500':
description: empty error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
components:
schemas:
JSONRPC:
type: object
properties:
id:
type: integer
example: 0
jsonrpc:
type: string
example: '2.0'
ErrorResponse:
description: Error Response
allOf:
- $ref: '#/components/schemas/JSONRPC'
- type: object
properties:
error:
type: string
example: Description of failure
EmptyResponse:
description: Empty Response
allOf:
- $ref: '#/components/schemas/JSONRPC'
- type: object
properties:
result:
type: object
additionalProperties: {}