Polkadot rc API

Relay chain endpoints (available on parachains only)

OpenAPI Specification

polkadot-rc-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Polkadot REST Account rc 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: rc
  description: Relay chain endpoints (available on parachains only)
paths:
  /v1/rc/accounts/{accountId}/balance-info:
    get:
      tags:
      - rc
      summary: RC get balance info
      description: Returns balance information for a given account on the relay chain.
      operationId: get_balance_info
      parameters:
      - name: accountId
        in: path
        description: SS58-encoded account address
        required: true
        schema:
          type: string
      - name: at
        in: query
        description: Block identifier (number or hash)
        required: false
        schema:
          type: string
      - name: token
        in: query
        description: Token symbol (defaults to native token)
        required: false
        schema:
          type: string
      - name: denominated
        in: query
        description: Denominate balances using chain decimals
        required: false
        schema:
          type: boolean
      responses:
        '200':
          description: Balance information
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RcBalanceInfoResponse'
        '400':
          description: Invalid account address
        '500':
          description: Internal server error
        '503':
          description: Relay chain not configured
  /v1/rc/accounts/{accountId}/proxy-info:
    get:
      tags:
      - rc
      summary: RC get proxy info
      description: Returns proxy information for a given account on the relay chain.
      operationId: get_proxy_info
      parameters:
      - name: accountId
        in: path
        description: SS58-encoded account address
        required: true
        schema:
          type: string
      - name: at
        in: query
        description: Block identifier (number or hash)
        required: false
        schema:
          type: string
      responses:
        '200':
          description: Proxy information
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RcProxyInfoResponse'
        '400':
          description: Invalid account address
        '500':
          description: Internal server error
        '503':
          description: Relay chain not configured
  /v1/rc/accounts/{accountId}/staking-info:
    get:
      tags:
      - rc
      summary: RC get staking info
      description: Returns staking information for a given stash account on the relay chain.
      operationId: get_staking_info
      parameters:
      - name: accountId
        in: path
        description: SS58-encoded stash account address
        required: true
        schema:
          type: string
      - name: at
        in: query
        description: Block identifier (number or hash)
        required: false
        schema:
          type: string
      - name: includeClaimedRewards
        in: query
        description: When true, include claimed rewards in the response
        required: false
        schema:
          type: boolean
      responses:
        '200':
          description: Staking information
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RcStakingInfoResponse'
        '400':
          description: Invalid account address
        '500':
          description: Internal server error
        '503':
          description: Relay chain not configured
  /v1/rc/accounts/{accountId}/staking-payouts:
    get:
      tags:
      - rc
      summary: RC get staking payouts
      description: Returns staking payout information for a given account on the relay chain.
      operationId: get_staking_payouts
      parameters:
      - name: accountId
        in: path
        description: SS58-encoded account address
        required: true
        schema:
          type: string
      - name: at
        in: query
        description: Block identifier (number or hash)
        required: false
        schema:
          type: string
      - name: depth
        in: query
        description: 'Number of eras to query (default: 1)'
        required: false
        schema:
          type: integer
          format: int32
          minimum: 0
      - name: era
        in: query
        description: 'The era to query at (default: active_era - 1)'
        required: false
        schema:
          type: integer
          format: int32
          minimum: 0
      - name: unclaimedOnly
        in: query
        description: 'Only show unclaimed rewards (default: true)'
        required: false
        schema:
          type: boolean
      responses:
        '200':
          description: Staking payouts
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RcStakingPayoutsResponse'
        '400':
          description: Invalid account address
        '500':
          description: Internal server error
        '503':
          description: Relay chain not configured
  /v1/rc/accounts/{accountId}/vesting-info:
    get:
      tags:
      - rc
      summary: RC get vesting info
      description: Returns vesting information for a given account on the relay chain.
      operationId: get_vesting_info
      parameters:
      - name: accountId
        in: path
        description: SS58-encoded account address
        required: true
        schema:
          type: string
      - name: at
        in: query
        description: Block identifier (number or hash)
        required: false
        schema:
          type: string
      responses:
        '200':
          description: Vesting information
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RcVestingInfoResponse'
        '400':
          description: Invalid account address
        '500':
          description: Internal server error
        '503':
          description: Relay chain not configured
  /v1/rc/blocks:
    get:
      tags:
      - rc
      summary: RC get blocks by range
      description: Returns relay chain blocks within a specified range (max 500 blocks).
      operationId: get_rc_blocks
      parameters:
      - name: range
        in: query
        description: Block range (e.g., '100-200')
        required: false
        schema:
          type: string
      - name: eventDocs
        in: query
        description: Include event documentation
        required: false
        schema:
          type: boolean
      - name: extrinsicDocs
        in: query
        description: Include extrinsic documentation
        required: false
        schema:
          type: boolean
      - name: noFees
        in: query
        description: Skip fee calculation
        required: false
        schema:
          type: boolean
      - name: decodedXcmMsgs
        in: query
        description: Decode and include XCM messages
        required: false
        schema:
          type: boolean
      - name: paraId
        in: query
        description: Filter XCM messages by parachain ID
        required: false
        schema:
          type: integer
          format: int32
          minimum: 0
      responses:
        '200':
          description: Relay chain blocks
          content:
            application/json:
              schema:
                type: object
        '400':
          description: Invalid range or missing parameter
        '500':
          description: Internal server error
        '503':
          description: Relay chain not configured
  /v1/rc/blocks/head:
    get:
      tags:
      - rc
      summary: RC get head block
      description: Returns the latest block on the relay chain.
      operationId: get_rc_blocks_head
      parameters:
      - name: finalized
        in: query
        description: 'When true returns finalized head (default: true)'
        required: false
        schema:
          type: boolean
      - name: eventDocs
        in: query
        description: Include event documentation
        required: false
        schema:
          type: boolean
      - name: extrinsicDocs
        in: query
        description: Include extrinsic documentation
        required: false
        schema:
          type: boolean
      - name: noFees
        in: query
        description: Skip fee calculation
        required: false
        schema:
          type: boolean
      - name: decodedXcmMsgs
        in: query
        description: Decode and include XCM messages
        required: false
        schema:
          type: boolean
      - name: paraId
        in: query
        description: Filter XCM messages by parachain ID
        required: false
        schema:
          type: integer
          format: int32
          minimum: 0
      responses:
        '200':
          description: Relay chain head block
          content:
            application/json:
              schema:
                type: object
        '500':
          description: Internal server error
        '503':
          description: Relay chain not configured
  /v1/rc/blocks/head/header:
    get:
      tags:
      - rc
      summary: RC get head block header
      description: Returns the header of the latest relay chain block.
      operationId: get_rc_blocks_head_header
      parameters:
      - name: finalized
        in: query
        description: 'When true returns finalized head (default: true)'
        required: false
        schema:
          type: boolean
      responses:
        '200':
          description: Relay chain head block header
          content:
            application/json:
              schema:
                type: object
        '500':
          description: Internal server error
        '503':
          description: Relay chain not configured
  /v1/rc/blocks/{blockId}:
    get:
      tags:
      - rc
      summary: RC get block by ID
      description: Returns relay chain block information for a given block identifier.
      operationId: get_rc_block
      parameters:
      - name: blockId
        in: path
        description: Block height number or block hash
        required: true
        schema:
          type: string
      - name: eventDocs
        in: query
        description: Include event documentation
        required: false
        schema:
          type: boolean
      - name: extrinsicDocs
        in: query
        description: Include extrinsic documentation
        required: false
        schema:
          type: boolean
      - name: noFees
        in: query
        description: Skip fee calculation
        required: false
        schema:
          type: boolean
      - name: decodedXcmMsgs
        in: query
        description: Include decoded XCM messages
        required: false
        schema:
          type: boolean
      - name: paraId
        in: query
        description: Filter XCM messages by parachain ID
        required: false
        schema:
          type: integer
          format: int32
          minimum: 0
      responses:
        '200':
          description: Relay chain block information
          content:
            application/json:
              schema:
                type: object
        '400':
          description: Invalid block identifier
        '500':
          description: Internal server error
        '503':
          description: Relay chain not configured
  /v1/rc/blocks/{blockId}/extrinsics-raw:
    get:
      tags:
      - rc
      summary: RC get raw extrinsics
      description: Returns raw hex-encoded extrinsics for a relay chain block without decoding.
      operationId: get_rc_block_extrinsics_raw
      parameters:
      - name: blockId
        in: path
        description: Block height number or block hash
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Raw extrinsics
          content:
            application/json:
              schema:
                type: object
        '400':
          description: Invalid block identifier
        '500':
          description: Internal server error
        '503':
          description: Relay chain not configured
  /v1/rc/blocks/{blockId}/extrinsics/{extrinsicIndex}:
    get:
      tags:
      - rc
      summary: RC get extrinsic by index
      description: Returns a specific extrinsic from a relay chain block by its index.
      operationId: get_rc_extrinsic
      parameters:
      - name: blockId
        in: path
        description: Block height number or block hash
        required: true
        schema:
          type: string
      - name: extrinsicIndex
        in: path
        description: Index of the extrinsic in the block
        required: true
        schema:
          type: string
      - name: eventDocs
        in: query
        description: Include event documentation
        required: false
        schema:
          type: boolean
      - name: extrinsicDocs
        in: query
        description: Include extrinsic documentation
        required: false
        schema:
          type: boolean
      - name: noFees
        in: query
        description: Skip fee calculation
        required: false
        schema:
          type: boolean
      responses:
        '200':
          description: Extrinsic details
          content:
            application/json:
              schema:
                type: object
        '400':
          description: Invalid block ID or extrinsic index
        '500':
          description: Internal server error
        '503':
          description: Relay chain not configured
  /v1/rc/blocks/{blockId}/header:
    get:
      tags:
      - rc
      summary: RC get block header
      description: Returns the header of a relay chain block by block hash or block number.
      operationId: get_rc_block_header
      parameters:
      - name: blockId
        in: path
        description: Block height number or block hash
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Relay chain block header
          content:
            application/json:
              schema:
                type: object
        '400':
          description: Invalid block identifier
        '500':
          description: Internal server error
        '503':
          description: Relay chain not configured
  /v1/rc/blocks/{blockId}/para-inclusions:
    get:
      tags:
      - rc
      summary: RC get parachain inclusions
      description: Returns parachain inclusion information for a given relay chain block.
      operationId: get_rc_block_para_inclusions
      parameters:
      - name: blockId
        in: path
        description: Block height number or block hash
        required: true
        schema:
          type: string
      - name: paraId
        in: query
        description: Filter by parachain ID
        required: false
        schema:
          type: integer
          format: int32
          minimum: 0
      responses:
        '200':
          description: Parachain inclusions
          content:
            application/json:
              schema:
                type: object
        '400':
          description: Invalid block identifier
        '500':
          description: Internal server error
        '503':
          description: Relay chain not configured
  /v1/rc/node/network:
    get:
      tags:
      - rc
      summary: RC get node network
      description: Returns the relay chain node's network information.
      operationId: get_rc_node_network
      responses:
        '200':
          description: Relay chain node network info
          content:
            application/json:
              schema:
                type: object
        '500':
          description: Internal server error
        '503':
          description: Relay chain not configured
  /v1/rc/node/transaction-pool:
    get:
      tags:
      - rc
      summary: RC get transaction pool
      description: Returns the relay chain's transaction pool with optional fee information.
      operationId: get_rc_node_transaction_pool
      parameters:
      - name: includeFee
        in: query
        description: 'Include fee information for each transaction (default: false)'
        required: false
        schema:
          type: boolean
      responses:
        '200':
          description: Relay chain transaction pool
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransactionPoolResponse'
        '500':
          description: Internal server error
        '503':
          description: Relay chain not configured
  /v1/rc/node/version:
    get:
      tags:
      - rc
      summary: RC get node version
      description: Returns the relay chain node's version information.
      operationId: get_rc_node_version
      responses:
        '200':
          description: Relay chain node version
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NodeVersionResponse'
        '500':
          description: Internal server error
        '503':
          description: Relay chain not configured
  /v1/rc/pallets/on-going-referenda:
    get:
      tags:
      - rc
      summary: RC on-going referenda
      description: Returns all currently active referenda from the relay chain's Referenda pallet.
      operationId: rc_pallets_on_going_referenda
      parameters:
      - name: at
        in: query
        description: Block hash or number to query at
        required: false
        schema:
          type: string
      responses:
        '200':
          description: Active referenda from relay chain
          content:
            application/json:
              schema:
                type: object
        '500':
          description: Internal server error
        '503':
          description: Service unavailable
  /v1/rc/pallets/staking/progress:
    get:
      tags:
      - rc
      summary: RC staking progress
      description: Returns staking progress from the relay chain.
      operationId: rc_pallets_staking_progress
      parameters:
      - name: at
        in: query
        description: Block hash or number to query at
        required: false
        schema:
          type: string
      responses:
        '200':
          description: Relay chain staking progress
          content:
            application/json:
              schema:
                type: object
        '500':
          description: Internal server error
        '503':
          description: Service unavailable
  /v1/rc/pallets/staking/validators:
    get:
      tags:
      - rc
      summary: RC staking validators
      description: Returns the list of active validators from the relay chain.
      operationId: rc_pallets_staking_validators
      parameters:
      - name: at
        in: query
        description: Block hash or number to query at
        required: false
        schema:
          type: string
      responses:
        '200':
          description: Relay chain validator information
          content:
            application/json:
              schema:
                type: object
        '500':
          description: Internal server error
        '503':
          description: Service unavailable
  /v1/rc/pallets/{palletId}/consts:
    get:
      tags:
      - rc
      summary: RC pallet constants
      description: Returns all constants defined in a relay chain pallet.
      operationId: rc_pallets_constants
      parameters:
      - name: palletId
        in: path
        description: Name or index of the pallet
        required: true
        schema:
          type: string
      - name: at
        in: query
        description: Block hash or number to query at
        required: false
        schema:
          type: string
      - name: onlyIds
        in: query
        description: Only return constant names
        required: false
        schema:
          type: boolean
      responses:
        '200':
          description: Relay chain pallet constants
          content:
            application/json:
              schema:
                type: object
        '400':
          description: Invalid pallet
        '500':
          description: Internal server error
        '503':
          description: Service unavailable
  /v1/rc/pallets/{palletId}/consts/{constantItemId}:
    get:
      tags:
      - rc
      summary: RC pallet constant value
      description: Returns the value and metadata of a specific constant from a relay chain pallet.
      operationId: rc_pallets_constant_item
      parameters:
      - name: palletId
        in: path
        description: Name or index of the pallet
        required: true
        schema:
          type: string
      - name: constantItemId
        in: path
        description: Name of the constant
        required: true
        schema:
          type: string
      - name: at
        in: query
        description: Block hash or number to query at
        required: false
        schema:
          type: string
      - name: metadata
        in: query
        description: Include metadata
        required: false
        schema:
          type: boolean
      responses:
        '200':
          description: Relay chain constant value
          content:
            application/json:
              schema:
                type: object
        '404':
          description: Constant not found
        '500':
          description: Internal server error
        '503':
          description: Service unavailable
  /v1/rc/pallets/{palletId}/dispatchables:
    get:
      tags:
      - rc
      summary: RC pallet dispatchables
      description: Returns the dispatchable calls defined in a relay chain pallet.
      operationId: rc_pallets_dispatchables
      parameters:
      - name: palletId
        in: path
        description: Name or index of the pallet
        required: true
        schema:
          type: string
      - name: at
        in: query
        description: Block hash or number to query at
        required: false
        schema:
          type: string
      - name: onlyIds
        in: query
        description: Only return dispatchable names
        required: false
        schema:
          type: boolean
      responses:
        '200':
          description: Relay chain pallet dispatchables
          content:
            application/json:
              schema:
                type: object
        '400':
          description: Invalid pallet
        '500':
          description: Internal server error
        '503':
          description: Service unavailable
  /v1/rc/pallets/{palletId}/dispatchables/{dispatchableId}:
    get:
      tags:
      - rc
      summary: RC pallet dispatchable details
      description: Returns a single dispatchable call from a relay chain pallet.
      operationId: rc_pallet_dispatchable_item
      parameters:
      - name: palletId
        in: path
        description: Name or index of the pallet
        required: true
        schema:
          type: string
      - name: dispatchableId
        in: path
        description: Name of the dispatchable
        required: true
        schema:
          type: string
      - name: at
        in: query
        description: Block hash or number to query at
        required: false
        schema:
          type: string
      - name: metadata
        in: query
        description: Include metadata
        required: false
        schema:
          type: boolean
      responses:
        '200':
          description: Relay chain dispatchable details
          content:
            application/json:
              schema:
                type: object
        '404':
          description: Dispatchable not found
        '500':
          description: Internal server error
        '503':
          description: Service unavailable
  /v1/rc/pallets/{palletId}/errors:
    get:
      tags:
      - rc
      summary: RC pallet errors
      description: Returns all errors defined in a relay chain pallet.
      operationId: rc_pallet_errors
      parameters:
      - name: palletId
        in: path
        description: Name or index of the pallet
        required: true
        schema:
          type: string
      - name: at
        in: query
        description: Block hash or number to query at
        required: false
        schema:
          type: string
      - name: onlyIds
        in: query
        description: Only return error names
        required: false
        schema:
          type: boolean
      responses:
        '200':
          description: Relay chain pallet errors
          content:
            application/json:
              schema:
                type: object
        '400':
          description: Invalid pallet
        '500':
          description: Internal server error
        '503':
          description: Service unavailable
  /v1/rc/pallets/{palletId}/errors/{errorItemId}:
    get:
      tags:
      - rc
      summary: RC pallet error details
      description: Returns metadata for a specific error in a relay chain pallet.
      operationId: rc_pallet_error_item
      parameters:
      - name: palletId
        in: path
        description: Name or index of the pallet
        required: true
        schema:
          type: string
      - name: errorItemId
        in: path
        description: Name of the error
        required: true
        schema:
          type: string
      - name: at
        in: query
        description: Block hash or number to query at
        required: false
        schema:
          type: string
      - name: metadata
        in: query
        description: Include metadata
        required: false
        schema:
          type: boolean
      responses:
        '200':
          description: Relay chain error details
          content:
            application/json:
              schema:
                type: object
        '404':
          description: Error not found
        '500':
          description: Internal server error
        '503':
          description: Service unavailable
  /v1/rc/pallets/{palletId}/events:
    get:
      tags:
      - rc
      summary: RC pallet events
      description: Returns all events defined in a relay chain pallet.
      operationId: rc_pallet_events
      parameters:
      - name: palletId
        in: path
        description: Name or index of the pallet
        required: true
        schema:
          type: string
      - name: at
        in: query
        description: Block hash or number to query at
        required: false
        schema:
          type: string
      - name: onlyIds
        in: query
        description: Only return event names
        required: false
        schema:
          type: boolean
      responses:
        '200':
          description: Relay chain pallet events
          content:
            application/json:
              schema:
                type: object
        '400':
          description: Invalid pallet
        '500':
          description: Internal server error
        '503':
          description: Service unavailable
  /v1/rc/pallets/{palletId}/events/{eventItemId}:
    get:
      tags:
      - rc
      summary: RC pallet event details
      description: Returns metadata for a specific event in a relay chain pallet.
      operationId: rc_pallet_event_item
      parameters:
      - name: palletId
        in: path
        description: Name or index of the pallet
        required: true
        schema:
          type: string
      - name: eventItemId
        in: path
        description: Event name
        required: true
        schema:
          type: string
      - name: at
        in: query
        description: Block hash or number to query at
        required: false
        schema:
          type: string
      - name: metadata
        in: query
        description: Include full event metadata
        required: false
        schema:
          type: boolean
      responses:
        '200':
          description: Relay chain event details
          content:
            application/json:
              schema:
                type: object
        '404':
          description: Pallet or event not found
        '500':
          description: Internal server error
        '503':
          description: Service unavailable
  /v1/rc/pallets/{palletId}/storage:
    get:
      tags:
      - rc
      summary: RC pallet storage items
      description: Returns the list of storage items for a relay chain pallet.
      operationId: rc_get_pallets_storage
      parameters:
      - name: palletId
        in: path
        description: Name or index of the pallet
        required: true
        schema:
          type: string
      - name: at
        in: query
        description: Block hash or number to query at
        required: false
        schema:
          type: string
      - name: onlyIds
        in: query
        description: Only return storage item names
        required: false
        schema:
          type: boolean
      responses:
        '200':
          description: Relay chain pallet storage items
          content:
            application/json:
              schema:
                type: object
        '400':
          description: Invalid pallet or parameters
        '500':
          description: Internal server error
        '503':
          description: Service unavailable
  /v1/rc/pallets/{palletId}/storage/{storageItemId}:
    get:
      tags:
      - rc
      summary: RC pallet storage item value
      description: Returns the value of a specific storage item from a relay chain pallet.
      operationId: rc_get_pallets_storage_item
      parameters:
      - name: palletId
        in: path
        description: Name or index of the pallet
        required: true
        schema:
          type: string
      - name: storageItemId
        in: path
        description: Name of the storage item
        required: true
        schema:
          type: string
      - name: at
        in: query
        description: Block hash or number to query at
        required: false
        schema:
          type: string
      - name: keys[]
        in: query
        description: Storage key arguments
        required: false
        schema:
          type: array
          items:
            type: string
      - name: metadata
        in: query
        description: Include metadata for the storage item
        required: false
        schema:
          type: boolean
      responses:
        '200':
          description: Relay chain storage item value
          content:
            application/json:
              schema:
                type: object
        '400':
          description: Invalid parameters
        '404':
          description: Storage item not found
        '500':
          description: Internal server error
        '503':
          description: Service unavailable
  /v1/rc/runtime/code:
    get:
      tags:
      - rc
      summary: RC get runtime code
      description: Returns the Wasm code blob of the relay chain runtime at a given block.
      operationId: get_rc_runtime_code
      parameters:
      - name: at
        in: query
        description: Block identifier (number or hash)
        required: false
        schema:
          type: string
      responses:
        '200':
          description: Relay chain runtime code
          content:
            application/json:
              schema:
                type: object
        '500':
          description: Internal server error
        '503':
          description: Relay chain not configured
  /v1/rc/runtime/metadata:
    get:
      tags:
      - rc
      summary: RC get runtime metadata
      description: Returns the decoded runtime metadata of the relay chain in JSON format.
      operationId: get_rc_runtime_metadata
      parameters:
      - name: at
        in: query
        description: Block identifier (number or hash)
        required: false
        schema:
          type: string
      responses:
        '200':
          description: Relay chain runtime metadata
          content:
            application/json:
              schema:
                type: object
        '500':
          descripti

# --- truncated at 32 KB (63 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/polkadot/refs/heads/main/openapi/polkadot-rc-api-openapi.yml