Polkassembly
Search
⌃K
⚙

API Documentation

The power of open source

Updated API Documentation (After 16 March'23)

​

Archived API Documentation (Before 16 March'23)

API Endpoint

Chain
Graphql Endpoint
kusama
https://kusama.polkassembly.io/v1/graphql
polkadot
https://polkadot.polkassembly.io/v1/graphql
moonbase
https://api.moonbase.polkassembly.network/v1/graphql
moonbeam
https://api.moonbeam.polkassembly.network/v1/graphql
moonriver
https://api.moonriver.polkassembly.network/v1/graphql
other networks
https://polkassembly-hasura.herokuapp.com/graphql
​

Proposal Post

// Fetch proposal title and description:
​
// Graphql Request:
​
query {
posts(where: {onchain_link: {onchain_proposal_id: {_eq: 113}}}) {
title
content
onchain_link {
proposer_address
}
comments {
content
created_at
author {
username
}
replies {
content
author {
username
}
}
}
}
}

Referendum Post

// Fetch proposal title and description:
​
// Graphql Request:
​
query {
posts(where: {onchain_link: {onchain_referendum_id: {_eq: 113}}}) {
title
content
onchain_link {
proposer_address
}
comments {
content
created_at
author {
username
}
replies {
content
author {
username
}
}
}
}
}
​
​

Treasury Post

// Fetch treasury title and description:
​
// Graphql Request:
​
query {
posts(where: {onchain_link: {onchain_treasury_proposal_id: {_eq: 113}}}) {
title
content
onchain_link {
proposer_address
onchain_treasury_proposal_id
onchain_motion_id
}
comments {
content
created_at
author {
username
}
replies {
content
author {
username
}
}
}
}
​
// Response:
​
{
"data": {
"posts": [
{
"title": "Encointer pre-launch expenses to become common good parachain",
"content": "Encointer ...",
"onchain_link": {
"proposer_address": "EyXct79ZDWdQfcSgJTG5texKM9wJj3quyh1ugPDVSkSt3Xm",
"onchain_treasury_proposal_id": 113,
"onchain_motion_id": 357
}
}
]
}
}

Motion Post

query {
posts(where: {onchain_link: {onchain_motion_id: {_eq: 113}}}) {
title
content
onchain_link {
proposer_address
onchain_motion_id
}
comments {
content
created_at
author {
username
}
replies {
content
author {
username
}
}
​
}
}
​