Polkadot Contracts API

The Contracts API from Polkadot — 9 operation(s) for contracts.

Operations 9

POST /api/scan/contracts/events List WASM contract events
POST /api/scan/contracts/info Get WASM contract details
POST /api/scan/contracts/list List WASM contracts
POST /api/scan/contracts/meta Get WASM contract aggregate metadata
POST /api/scan/contracts/timeline Get a WASM contract timeline
POST /api/scan/contracts/transactions List WASM contract transactions
GET /api/scan/contracts/verify/compiler_images List supported contract compiler images
GET /api/scan/contracts/verify/compiler_version List supported contract compiler versions
POST /contracts/ink/{address}/query Query an !Ink contract with a given message (method). #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/polkadot-contracts-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

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. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

polkadot-contracts-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Polkadot Contracts API
  version: '1.0'
  description: 'Operations tagged Contracts across 2 of this provider''s published API definitions: subscan-swagger.yaml, substrate-api-sidecar-openapi.yaml. Each path carries the servers of the definition it was published in.'
servers:
- url: https://https://www.subscan.io/
- url: https://polkadot-public-sidecar.parity-chains.parity.io/
  description: Polkadot Parity public sidecar
- url: https://kusama-public-sidecar.parity-chains.parity.io/
  description: Kusama Parity public sidecar
- url: https://polkadot-asset-hub-public-sidecar.parity-chains.parity.io/
  description: Polkadot Asset Hub Parity public sidecar
- url: https://kusama-asset-hub-public-sidecar.parity-chains.parity.io/
  description: Kusama Asset Hub Parity public sidecar
- url: http://localhost:8080
  description: Localhost
tags:
- name: Contracts
paths:
  /api/scan/contracts/events:
    post:
      description: Returns paginated emitted events for one WASM contract, with optional filtering by extrinsic index. Available only on networks with the contracts frame.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/internal_server_http.J'
                - properties:
                    data:
                      properties:
                        count:
                          type: integer
                        list:
                          items:
                            $ref: '#/components/schemas/subscan_internal_model.ContractEventJson'
                          type: array
                      type: object
                  type: object
      summary: List WASM contract events
      tags:
      - Contracts
      x-synonyms:
      - contract
      - events
      - contracts
      - scan
      - smart contract
      - wasm contract
      - evm contract
      - logs
      - on-chain events
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/internal_server_http.contractsEventsParams'
        description: param
        required: true
    servers:
    - url: https://https://www.subscan.io/
  /api/scan/contracts/info:
    post:
      description: Returns detailed information for one WASM contract by contract address. Available only on networks with the contracts frame.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/internal_server_http.J'
                - properties:
                    data:
                      $ref: '#/components/schemas/subscan_internal_model.ContractDetailJson'
                  type: object
      summary: Get WASM contract details
      tags:
      - Contracts
      x-synonyms:
      - contract
      - contracts
      - scan
      - smart contract
      - wasm contract
      - evm contract
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/internal_server_http.contractInfoParams'
        description: param
        required: true
    servers:
    - url: https://https://www.subscan.io/
  /api/scan/contracts/list:
    post:
      description: Returns a paginated list of WASM contracts with optional verification and ordering filters. Available only on networks with the contracts frame.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/internal_server_http.J'
                - properties:
                    data:
                      properties:
                        count:
                          type: integer
                        list:
                          items:
                            $ref: '#/components/schemas/subscan_internal_model.ContractAccountListJson'
                          type: array
                      type: object
                  type: object
      summary: List WASM contracts
      tags:
      - Contracts
      x-synonyms:
      - wasm
      - contract
      - contracts
      - scan
      - smart contract
      - wasm contract
      - evm contract
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/internal_server_http.contractsListParams'
        description: param
        required: true
    servers:
    - url: https://https://www.subscan.io/
  /api/scan/contracts/meta:
    post:
      description: Returns aggregate WASM contract statistics such as contract count, transaction count, and verified-contract count. Available only on networks with the contracts frame.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/internal_server_http.J'
                - properties:
                    data:
                      properties:
                        contract_count:
                          type: integer
                        contract_verified_count:
                          type: integer
                        transaction_count:
                          type: integer
                      type: object
                  type: object
      summary: Get WASM contract aggregate metadata
      tags:
      - Contracts
      x-synonyms:
      - contract
      - meta
      - contracts
      - scan
      - smart contract
      - wasm contract
      - evm contract
    servers:
    - url: https://https://www.subscan.io/
  /api/scan/contracts/timeline:
    post:
      description: Returns the lifecycle timeline for one WASM contract address. Available only on networks with the contracts frame.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/internal_server_http.J'
                - properties:
                    data:
                      properties:
                        list:
                          items:
                            $ref: '#/components/schemas/subscan_internal_model.ContractTimeline'
                          type: array
                      type: object
                  type: object
      summary: Get a WASM contract timeline
      tags:
      - Contracts
      x-synonyms:
      - contract
      - timeline
      - contracts
      - scan
      - smart contract
      - wasm contract
      - evm contract
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/internal_server_http.contractTimelineParams'
        description: param
        required: true
    servers:
    - url: https://https://www.subscan.io/
  /api/scan/contracts/transactions:
    post:
      description: Returns paginated WASM contract transactions filtered by account address, contract address, block range, and success status. Available only on networks with the contracts frame.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/internal_server_http.J'
                - properties:
                    data:
                      properties:
                        count:
                          type: integer
                        list:
                          items:
                            $ref: '#/components/schemas/subscan_internal_model.ContractTransactionListJson'
                          type: array
                      type: object
                  type: object
      summary: List WASM contract transactions
      tags:
      - Contracts
      x-synonyms:
      - wasm
      - contract
      - transactions
      - contracts
      - scan
      - smart contract
      - wasm contract
      - evm contract
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/internal_server_http.contractTxsParams'
        description: param
        required: true
    servers:
    - url: https://https://www.subscan.io/
  /api/scan/contracts/verify/compiler_images:
    get:
      description: Returns the supported third-party compiler images and tags that can be used for WASM contract verification.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/internal_server_http.J'
                - properties:
                    data:
                      additionalProperties:
                        items:
                          $ref: '#/components/schemas/subscan_internal_model.ThirdPartyCompiler'
                        type: array
                      type: object
                  type: object
      summary: List supported contract compiler images
      tags:
      - Contracts
      x-synonyms:
      - compiler
      - images
      - tag
      - contracts
      - scan
      - verify
    servers:
    - url: https://https://www.subscan.io/
  /api/scan/contracts/verify/compiler_version:
    get:
      description: Returns the supported compiler versions that can be used to verify WASM contracts.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/internal_server_http.J'
                - properties:
                    data:
                      items:
                        type: string
                      type: array
                  type: object
      summary: List supported contract compiler versions
      tags:
      - Contracts
      x-synonyms:
      - compiler
      - versions
      - contracts
      - scan
      - verify
      - version
    servers:
    - url: https://https://www.subscan.io/
  /contracts/ink/{address}/query:
    post:
      tags:
      - Contracts
      summary: Query an !Ink contract with a given message (method).
      description: Will return a valid or invalid result.
      operationId: callContractQuery
      requestBody:
        $ref: '#/components/requestBodies/ContractMetadata'
      parameters:
      - name: address
        in: path
        description: SS58 or Hex address of the account associated with the contract.
        required: true
        schema:
          type: string
      - name: method
        in: query
        description: The message or method used to query.
        required: false
        schema:
          type: string
          default: get
      - name: gasLimit
        in: query
        description: The gas limit to be used as an option for the queried message.
        required: false
        schema:
          default: -1
          type: number
      - name: storageDepositLimit
        in: query
        description: The storage deposit limit to be used as an option for the queried message.
        required: false
        schema:
          default: null
          type: number
      - name: args
        in: query
        description: Abi params used as args specified in the metadata to be passed into a query. The format to use this query param is ?args[]=1&args[]=2&args[]=3.
        required: false
        schema:
          type: array
          items:
            type: string
          description: An array of Abi params.
      responses:
        '200':
          description: succesful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContractsInkQuery'
        '400':
          description: Invalid Method
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    servers:
    - url: https://polkadot-public-sidecar.parity-chains.parity.io/
      description: Polkadot Parity public sidecar
    - url: https://kusama-public-sidecar.parity-chains.parity.io/
      description: Kusama Parity public sidecar
    - url: https://polkadot-asset-hub-public-sidecar.parity-chains.parity.io/
      description: Polkadot Asset Hub Parity public sidecar
    - url: https://kusama-asset-hub-public-sidecar.parity-chains.parity.io/
      description: Kusama Asset Hub Parity public sidecar
    - url: http://localhost:8080
      description: Localhost
components:
  schemas:
    internal_server_http.contractTimelineParams:
      properties:
        contract:
          type: string
      type: object
    subscan_internal_model.ContractAction:
      enum:
      - Instantiated
      - Terminated
      - ContractCodeUpdated
      type: string
      x-enum-varnames:
      - ContractInstantiated
      - ContractTerminated
      - ContractCodeUpdated
    subscan_internal_model.MerkleTag:
      properties:
        address_type:
          type: string
        tag_name:
          type: string
        tag_subtype:
          type: string
        tag_type:
          type: string
      type: object
    subscan_internal_model.ContractAccountListJson:
      properties:
        balance:
          type: string
        contract_display:
          $ref: '#/components/schemas/subscan_internal_model.AccountDisplay'
        owner_display:
          $ref: '#/components/schemas/subscan_internal_model.AccountDisplay'
        transaction_count:
          type: integer
        verify_time:
          type: integer
      type: object
    internal_server_http.J:
      properties:
        code:
          example: 0
          type: integer
        data: {}
        generated_at:
          example: 1699600641
          type: integer
        message:
          example: Success
          type: string
      type: object
    subscan_internal_model.ContractTimeline:
      properties:
        action:
          $ref: '#/components/schemas/subscan_internal_model.ContractAction'
        block_timestamp:
          type: integer
        event_index:
          type: string
        extrinsic_index:
          type: string
      type: object
    subscan_internal_model.AccountParentJson:
      properties:
        address:
          type: string
        display:
          type: string
        identity:
          type: boolean
        sub_symbol:
          type: string
      type: object
    internal_server_http.contractsListParams:
      properties:
        order:
          enum:
          - desc
          - asc
          type: string
        order_field:
          enum:
          - verify_time
          - transaction_count
          type: string
        page:
          description: Page number, starting from 0
          example: 0
          minimum: 0
          type: integer
        row:
          description: Data size per page
          example: 10
          maximum: 100
          minimum: 1
          type: integer
        verified:
          type: boolean
      type: object
    subscan_internal_model.AccountDisplay:
      properties:
        account_index:
          type: string
        address:
          description: Current network account
          type: string
        display:
          type: string
        evm_address:
          type: string
        evm_contract:
          $ref: '#/components/schemas/subscan_internal_model.EvmAccountDisplay'
        identity:
          type: boolean
        judgements:
          items:
            $ref: '#/components/schemas/subscan_internal_model.RegistrationJudgementJson'
          type: array
        merkle:
          $ref: '#/components/schemas/subscan_internal_model.MerkleTag'
        parent:
          allOf:
          - $ref: '#/components/schemas/subscan_internal_model.AccountParentJson'
          description: Parent account
        people:
          $ref: '#/components/schemas/subscan_internal_model.SampleIdentity'
      type: object
    subscan_internal_model.RegistrationJudgementJson:
      properties:
        index:
          type: integer
        judgement:
          type: string
      type: object
    internal_server_http.contractsEventsParams:
      properties:
        contract:
          type: string
        extrinsic_index:
          type: string
        page:
          description: Page number, starting from 0
          example: 0
          minimum: 0
          type: integer
        row:
          description: Data size per page
          example: 10
          maximum: 100
          minimum: 1
          type: integer
      type: object
    subscan_internal_model.ThirdPartyCompiler:
      properties:
        digest:
          type: string
        repository_tag:
          type: string
        worker_dir:
          type: string
      type: object
    subscan_internal_model.EvmAccountDisplay:
      properties:
        contract_name:
          type: string
        verify_source:
          type: string
      type: object
    internal_server_http.contractTxsParams:
      properties:
        address:
          type: string
        block_range:
          example: 20000-30000
          type: string
        contract:
          type: string
        page:
          description: Page number, starting from 0
          example: 0
          minimum: 0
          type: integer
        result:
          type: boolean
        row:
          description: Data size per page
          example: 10
          maximum: 100
          minimum: 1
          type: integer
      type: object
    subscan_internal_model.ContractDetailJson:
      properties:
        abi: {}
        balance:
          type: string
        code:
          type: string
        code_hash:
          type: string
        contract_display:
          $ref: '#/components/schemas/subscan_internal_model.AccountDisplay'
        deposit:
          type: string
        has_compile_log:
          type: boolean
        input_data:
          type: string
        is_verifying:
          type: boolean
        last_compile_result:
          type: string
        owner_display:
          $ref: '#/components/schemas/subscan_internal_model.AccountDisplay'
        salt:
          type: string
        source_code: {}
        transaction_count:
          type: integer
        verify_time:
          type: integer
      type: object
    subscan_internal_model.ContractEventJson:
      properties:
        block_timestamp:
          type: integer
        data:
          type: string
        event_index:
          type: string
        extrinsic_index:
          type: string
      type: object
    internal_server_http.contractInfoParams:
      properties:
        contract:
          type: string
      type: object
    subscan_internal_model.SampleIdentity:
      properties:
        display:
          type: string
        identity:
          type: boolean
        judgements:
          items:
            $ref: '#/components/schemas/subscan_internal_model.RegistrationJudgementJson'
          type: array
        parent:
          $ref: '#/components/schemas/subscan_internal_model.AccountParentJson'
      type: object
    subscan_internal_model.ContractTransactionListJson:
      properties:
        account_display:
          $ref: '#/components/schemas/subscan_internal_model.AccountDisplay'
        block_timestamp:
          type: integer
        contract_address:
          $ref: '#/components/schemas/subscan_internal_model.AccountDisplay'
        extrinsic_index:
          type: string
        success:
          type: boolean
      type: object
    ContractsInkQuery:
      type: object
      description: Result from calling a query to a Ink contract.
      properties:
        debugMessage:
          type: string
        gasConsumed:
          type: string
        gasRequired:
          type: string
        output:
          type: boolean
        result:
          type: object
          description: Will result in an Ok or Err object depending on the result of the query.
        storageDeposit:
          type: object
    Error:
      type: object
      properties:
        code:
          type: number
        message:
          type: string
        stack:
          type: string
        level:
          type: string
    ContractMetadata:
      type: object
      description: Metadata used to instantiate a ContractPromise. This metadata can be generated by compiling the contract you are querying.
  requestBodies:
    ContractMetadata:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ContractMetadata'
x-refined-from:
- subscan-swagger.yaml
- substrate-api-sidecar-openapi.yaml