Polkadot node API

Connected node information

OpenAPI Specification

polkadot-node-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Polkadot REST Account node API
  description: High-performance Rust REST API for Substrate/Polkadot blockchain data. Drop-in replacement for substrate-api-sidecar.
  contact:
    url: https://github.com/paritytech/polkadot-rest-api
  license:
    name: GPL-3.0-or-later
  version: 0.1.3
servers:
- url: http://localhost:8080/v1
  description: Localhost
tags:
- name: node
  description: Connected node information
paths:
  /v1/node/network:
    get:
      tags:
      - node
      summary: Node network info
      description: Returns the node's network information including peer count, syncing status, and local peer ID.
      operationId: get_node_network
      responses:
        '200':
          description: Node network information
          content:
            application/json:
              schema:
                type: object
        '500':
          description: Internal server error
        '503':
          description: Service unavailable
  /v1/node/transaction-pool:
    get:
      tags:
      - node
      summary: Transaction pool
      description: Returns the node's transaction pool with optional fee information.
      operationId: get_node_transaction_pool
      parameters:
      - name: includeFee
        in: query
        description: Include fee details for each transaction
        required: false
        schema:
          type: boolean
      responses:
        '200':
          description: Transaction pool entries
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransactionPoolResponse'
        '500':
          description: Internal server error
        '503':
          description: Service unavailable
  /v1/node/version:
    get:
      tags:
      - node
      summary: Node version
      description: Returns the node's version information including client version, implementation name, and chain name.
      operationId: get_node_version
      responses:
        '200':
          description: Node version information
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NodeVersionResponse'
        '500':
          description: Internal server error
        '503':
          description: Service unavailable
  /node/network:
    get:
      tags:
      - node
      summary: Get information about the Substrate node's activity in the peer-to-peer network.
      description: Returns network related information of the node.
      operationId: getNodeNetworking
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NodeNetwork'
  /node/transaction-pool:
    get:
      tags:
      - node
      summary: Get pending extrinsics from the Substrate node.
      description: Returns the extrinsics that the node knows of that have not been included in a block.
      operationId: getNodeTransactionPool
      parameters:
      - name: includeFee
        in: query
        description: Boolean representing whether or not to include tips, partialFee, and priority in each extrinsic.
        required: false
        schema:
          type: boolean
          default: false
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransactionPool'
  /node/version:
    get:
      tags:
      - node
      summary: Get information about the Substrates node's implementation and versioning.
      description: Returns versioning information of the node.
      operationId: getNodeVersion
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NodeVersion'
components:
  schemas:
    NodeVersion:
      type: object
      properties:
        clientVersion:
          type: string
          description: Node's binary version.
        clientImplName:
          type: string
          description: Node's implementation name.
        chain:
          type: string
          description: Node's chain name.
      description: Version information of the node.
    TransactionPoolResponse:
      type: object
      required:
      - pool
      properties:
        pool:
          type: array
          items:
            $ref: '#/components/schemas/TransactionPoolEntry'
    TransactionPool:
      type: object
      properties:
        pool:
          type: array
          items:
            type: object
            properties:
              hash:
                type: string
                format: hex
                description: H256 hash of the extrinsic.
              encodedExtrinsic:
                type: string
                format: hex
                description: Scale encoded extrinsic.
              tip:
                type: string
                format: unsignedInteger
                description: The tip included in the extrinsic. Only included if the query param `includeFee` is set to true.
              priority:
                type: string
                format: unsignedInteger
                description: Computed priority of an extrinsic. Only included if the query param `includeFee` is set to true.
              partialFee:
                type: string
                format: unsignedInteger
                description: Provided `partialFee` of an extrinsic. Only included if the query param `includeFee` is set to true.
    TransactionPoolEntry:
      type: object
      required:
      - hash
      - encodedExtrinsic
      properties:
        encodedExtrinsic:
          type: string
        hash:
          type: string
        partialFee:
          type:
          - string
          - 'null'
        priority:
          type:
          - string
          - 'null'
        tip:
          type:
          - string
          - 'null'
    NodeVersionResponse:
      type: object
      required:
      - clientVersion
      - clientImplName
      - chain
      properties:
        chain:
          type: string
        clientImplName:
          type: string
        clientVersion:
          type: string
    NodeNetwork:
      type: object
      properties:
        nodeRoles:
          $ref: '#/components/schemas/NodeRole'
        numPeers:
          type: string
          description: Number of peers the node is connected to.
          format: unsignedInteger
        isSyncing:
          type: boolean
          description: Whether or not the node is syncing. `False` indicates that the node is in sync.
        shouldHavePeers:
          type: boolean
          description: Whether or not the node should be connected to peers. Might be false for local chains or when running without discovery.
        localPeerId:
          type: string
          description: Local copy of the `PeerId`.
        localListenAddresses:
          type: array
          description: Multiaddresses that the local node is listening on. The addresses include a trailing `/p2p/` with the local PeerId, and are thus suitable to be passed to `system_addReservedPeer` or as a bootnode address for example.
          items:
            type: string
        peersInfo:
          type: array
          items:
            $ref: '#/components/schemas/PeerInfo'
    NodeRole:
      type: string
      description: Role of this node. (N.B. Sentry nodes are being deprecated.)
      enum:
      - Full
      - LightClient
      - Authority
      - Sentry
    PeerInfo:
      type: object
      properties:
        peerId:
          type: string
          description: Peer ID.
        roles:
          type: string
          description: Roles the peer is running
        protocolVersion:
          type: string
          description: Peer's protocol version.
          format: unsignedInteger
        bestHash:
          type: string
          description: Hash of the best block on the peer's canon chain.
          format: hex
        bestNumber:
          type: string
          description: Height of the best block on the peer's canon chain.
          format: unsignedInteger