Polkadot GPT

Polkadot GPT · GPT アクション

Polkassembly API

API for accessing Polkassembly data including votes, posts, and listings.

  • GET /latest-activity/all-postsGet all posts from latest activities
  • GET /latest-activity/off-chain-postsGet off-chain posts from latest activities on Polkassembly
  • GET /latest-activity/on-chain-postsGet on-chain posts from latest activities on Polkassembly
  • GET /listing/off-chain-postsGet discussion listing
  • GET /listing/on-chain-postsGet on-chain listing
  • GET /posts/on-chain-postGet onchain post data
  • GET /posts/off-chain-postGet discussion post data
  • GET /votes/historyGet voter history
  • GET /votesGet post votes
元の API スキーマ
{
  "openapi": "3.0.0",
  "info": {
    "title": "Polkassembly API",
    "description": "API for accessing Polkassembly data including votes, posts, and listings.",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://api.polkassembly.io/api/v1",
      "description": "Main Polkassembly API server"
    }
  ],
  "paths": {
    "/latest-activity/all-posts": {
      "get": {
        "operationId": "getAllPostsLatestActivity",
        "summary": "Get all posts from latest activities",
        "parameters": [
          {
            "name": "govType",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "open_gov",
                "gov1"
              ]
            }
          },
          {
            "name": "listingLimit",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "headers": [
          {
            "name": "x-network",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "default": "polkadot"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "integer"
                    },
                    "posts": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ListPost"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/latest-activity/off-chain-posts": {
      "get": {
        "operationId": "getOffChainPostsLatestActivity",
        "summary": "Get off-chain posts from latest activities on Polkassembly",
        "parameters": [
          {
            "name": "proposalType",
            "in": "query",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/OffChainProposalType"
            }
          },
          {
            "name": "listingLimit",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "integer"
                    },
                    "posts": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ListPost"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/latest-activity/on-chain-posts": {
      "get": {
        "operationId": "getOnChainPostsLatestActivity",
        "summary": "Get on-chain posts from latest activities on Polkassembly",
        "parameters": [
          {
            "name": "proposalType",
            "in": "query",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/OnChainProposalType"
            }
          },
          {
            "name": "listingLimit",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "trackNo",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "headers": [
          {
            "name": "x-network",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "default": "polkadot"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "integer"
                    },
                    "posts": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ListPost"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/listing/off-chain-posts": {
      "get": {
        "operationId": "getDiscussionListing",
        "summary": "Get discussion listing",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "proposalType",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sortBy",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "listingLimit",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "headers": [
          {
            "name": "x-network",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "default": "polkadot"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "integer"
                    },
                    "posts": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ListPost"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/listing/on-chain-posts": {
      "get": {
        "operationId": "getOnChainListing",
        "summary": "Get on-chain listing",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "proposalType",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sortBy",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "listingLimit",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "trackNo",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "headers": [
          {
            "name": "x-network",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "default": "polkadot"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "integer"
                    },
                    "posts": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ListPost"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/posts/on-chain-post": {
      "get": {
        "operationId": "getOnchainPostData",
        "summary": "Get onchain post data",
        "parameters": [
          {
            "name": "postId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "proposalType",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "headers": [
          {
            "name": "x-network",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "default": "polkadot"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Post"
                }
              }
            }
          }
        }
      }
    },
    "/posts/off-chain-post": {
      "get": {
        "operationId": "getOffChainPostData",
        "summary": "Get discussion post data",
        "parameters": [
          {
            "name": "postId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "postType",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "headers": [
          {
            "name": "x-network",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "default": "polkadot"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Post"
                }
              }
            }
          }
        }
      }
    },
    "/votes/history": {
      "get": {
        "operationId": "getVoterHistory",
        "summary": "Get voter history",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "listingLimit",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "voterAddress",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "integer"
                    },
                    "votes": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/votes": {
      "get": {
        "operationId": "getPostVotes",
        "summary": "Get post votes",
        "parameters": [
          {
            "name": "postId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "listingLimit",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "voteType",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sortBy",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "headers": [
          {
            "name": "x-network",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "default": "polkadot"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Vote"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "OffChainProposalType": {
        "type": "string",
        "enum": [
          "discussions",
          "grants"
        ]
      },
      "OnChainProposalType": {
        "type": "string",
        "enum": [
          "democracy_proposals",
          "tech_committee_proposals",
          "treasury_proposals",
          "referendums",
          "fellowship_referendums",
          "council_motions",
          "bounties",
          "tips",
          "child_bounties",
          "referendums_v2"
        ]
      },
      "Post": {
        "type": "object",
        "properties": {
          "comments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Comment"
            }
          },
          "content": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "lastEditedAt": {
            "type": "string",
            "format": "date-time"
          },
          "postId": {
            "type": "integer"
          },
          "postLink": {
            "type": "string"
          },
          "postReactions": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/Reaction"
            }
          },
          "proposer": {
            "type": "string"
          },
          "timeline": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TimelineItem"
            }
          },
          "title": {
            "type": "string"
          },
          "topic": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "id": {
                "type": "integer"
              }
            }
          },
          "userId": {
            "type": "integer"
          },
          "username": {
            "type": "string"
          }
        }
      },
      "ListPost": {
        "type": "object",
        "properties": {
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "description": {
            "type": "string"
          },
          "hash": {
            "type": "string"
          },
          "method": {
            "type": "string"
          },
          "origin": {
            "type": "string"
          },
          "postId": {
            "type": "integer"
          },
          "proposer": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "trackNumber": {
            "type": "integer"
          },
          "type": {
            "type": "string"
          },
          "username": {
            "type": "string"
          },
          "topic": {
            "type": "object",
            "properties": {
              "id": {
                "type": "integer"
              },
              "name": {
                "type": "string"
              }
            }
          }
        }
      },
      "Comment": {
        "type": "object",
        "properties": {
          "commentReactions": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/Reaction"
            }
          },
          "content": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "id": {
            "type": "string"
          },
          "proposer": {
            "type": "string"
          },
          "replies": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "userId": {
            "type": "integer"
          },
          "username": {
            "type": "string"
          }
        }
      },
      "Reaction": {
        "type": "object",
        "properties": {
          "count": {
            "type": "integer"
          },
          "usernames": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "TimelineItem": {
        "type": "object",
        "properties": {
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "index": {
            "type": "integer"
          },
          "statuses": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Status"
            }
          }
        }
      },
      "Status": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string"
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "Vote": {
        "type": "object",
        "properties": {
          "decision": {
            "type": "string"
          },
          "voter": {
            "type": "string"
          },
          "balance": {
            "type": "object",
            "properties": {
              "value": {
                "type": "string"
              }
            }
          },
          "lockPeriod": {
            "type": "integer"
          }
        }
      }
    }
  }
}

Polkaholic API

Polkaholic API for interacting with Polkadot blockchain data

  • GET /block/polkadot/{BlockNumber}Retrieve Polkadot block data for a specific block number

    Returns data for a specific Polkadot block given a block number

  • GET /tx/{TxHash}Retrieve a transaction

    Returns details of a specific Polkadot transaction using its transaction hash

  • GET /account/{Address}Retrieve account information

    Returns details of a specific account using its address

元の API スキーマ
{
  "openapi": "3.0.0",
  "info": {
    "title": "Polkaholic API",
    "description": "Polkaholic API for interacting with Polkadot blockchain data",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://api.colorfulnotion.com",
      "description": "Polkaholic API server"
    }
  ],
  "paths": {
    "/block/polkadot/{BlockNumber}": {
      "get": {
        "operationId": "getBlock",
        "summary": "Retrieve Polkadot block data for a specific block number",
        "description": "Returns data for a specific Polkadot block given a block number",
        "parameters": [
          {
            "name": "BlockNumber",
            "in": "path",
            "required": true,
            "description": "The block number to retrieve data about",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "decrate",
            "in": "query",
            "required": false,
            "description": "Whether API should return decorated fields",
            "schema": {
              "type": "boolean",
              "default": true
            }
          },
          {
            "name": "extra",
            "in": "query",
            "required": false,
            "description": "Decorate the response with additional fields",
            "schema": {
              "type": "string",
              "default": "usd,address,data"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A JSON object containing Polkadot block data",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "header": {
                      "type": "object",
                      "description": "The substrate block header"
                    },
                    "extrinsics": {
                      "type": "array",
                      "description": "A list of decorated extrinsics"
                    },
                    "number": {
                      "type": "integer"
                    },
                    "hash": {
                      "type": "string"
                    },
                    "blockTS": {
                      "type": "integer"
                    },
                    "finalized": {
                      "type": "boolean"
                    },
                    "specVersion": {
                      "type": "integer"
                    },
                    "evmBlock": {
                      "type": "object",
                      "description": "The EVM block included at this block height"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/tx/{TxHash}": {
      "get": {
        "operationId": "getTransaction",
        "summary": "Retrieve a transaction",
        "description": "Returns details of a specific Polkadot transaction using its transaction hash",
        "parameters": [
          {
            "name": "TxHash",
            "in": "path",
            "required": true,
            "description": "The Transaction Hash to retrieve data about, can be Substrate's extrinsicHash",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "decorate",
            "in": "query",
            "required": false,
            "description": "Whether API should return decorated fields",
            "schema": {
              "type": "boolean",
              "default": true
            }
          },
          {
            "name": "extra",
            "in": "query",
            "required": false,
            "description": "Decorate the response with fields like ['usd','address', 'related', 'data']",
            "schema": {
              "type": "string",
              "default": "usd,address,data"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A JSON object containing Substrate transaction details",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "chainID": {
                      "type": "integer"
                    },
                    "id": {
                      "type": "string"
                    },
                    "chainName": {
                      "type": "string"
                    },
                    "extrinsicHash": {
                      "type": "string"
                    },
                    "extrinsicID": {
                      "type": "string"
                    },
                    "blockNumber": {
                      "type": "integer"
                    },
                    "ts": {
                      "type": "integer"
                    },
                    "blockHash": {
                      "type": "string"
                    },
                    "signer": {
                      "type": "string"
                    },
                    "fromAddress": {
                      "type": "string"
                    },
                    "signature": {
                      "type": "object"
                    },
                    "lifetime": {
                      "type": "object"
                    },
                    "nonce": {
                      "type": "integer"
                    },
                    "tip": {
                      "type": "integer"
                    },
                    "fee": {
                      "type": "string"
                    },
                    "chainSymbol": {
                      "type": "string"
                    },
                    "feeUSD": {
                      "type": "string"
                    },
                    "priceUSD": {
                      "type": "string"
                    },
                    "priceUSDCurrent": {
                      "type": "string"
                    },
                    "result": {
                      "type": "integer"
                    },
                    "status": {
                      "type": "string"
                    },
                    "section": {
                      "type": "string"
                    },
                    "method": {
                      "type": "string"
                    },
                    "params": {
                      "type": "object"
                    },
                    "events": {
                      "type": "array"
                    },
                    "decodedParams": {
                      "type": "array"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/account/{Address}": {
      "get": {
        "operationId": "getAccountInfo",
        "summary": "Retrieve account information",
        "description": "Returns details of a specific account using its address",
        "parameters": [
          {
            "name": "Address",
            "in": "path",
            "required": true,
            "description": "The address (public key, SS58 address, or nativeH160 address) to retrieve data about",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "group",
            "in": "query",
            "required": false,
            "description": "The group type to return by the API",
            "schema": {
              "type": "string",
              "default": "realtime"
            }
          },
          {
            "name": "lookbackWindow",
            "in": "query",
            "required": false,
            "description": "Time in days for the lookback window",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "decorate",
            "in": "query",
            "required": false,
            "description": "Whether API should return decorated fields",
            "schema": {
              "type": "boolean",
              "default": true
            }
          },
          {
            "name": "extra",
            "in": "query",
            "required": false,
            "description": "Decorate the response with fields like ['usd','address', 'related', 'data']",
            "schema": {
              "type": "string",
              "default": "usd,address,data"
            }
          },
          {
            "name": "chainfilters",
            "in": "query",
            "required": false,
            "description": "Filter the result by comma-separated chainIdentifiers",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A JSON array containing account information",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "assetChain": {
                        "type": "string"
                      },
                      "assetInfo": {
                        "type": "object"
                      },
                      "state": {
                        "type": "object"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}