Proposals (v1beta1)
curl --request GET \
--url https://cosmos-rest.publicnode.com/cosmos/gov/v1beta1/proposalsimport requests
url = "https://cosmos-rest.publicnode.com/cosmos/gov/v1beta1/proposals"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://cosmos-rest.publicnode.com/cosmos/gov/v1beta1/proposals', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://cosmos-rest.publicnode.com/cosmos/gov/v1beta1/proposals",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://cosmos-rest.publicnode.com/cosmos/gov/v1beta1/proposals"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://cosmos-rest.publicnode.com/cosmos/gov/v1beta1/proposals")
.asString();require 'uri'
require 'net/http'
url = URI("https://cosmos-rest.publicnode.com/cosmos/gov/v1beta1/proposals")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"proposals": [
{
"proposal_id": "<string>",
"content": {
"@type": "<string>"
},
"status": "PROPOSAL_STATUS_UNSPECIFIED",
"final_tally_result": {
"yes": "<string>",
"abstain": "<string>",
"no": "<string>",
"no_with_veto": "<string>"
},
"submit_time": "2023-11-07T05:31:56Z",
"deposit_end_time": "2023-11-07T05:31:56Z",
"total_deposit": [
{
"denom": "<string>",
"amount": "<string>"
}
],
"voting_start_time": "2023-11-07T05:31:56Z",
"voting_end_time": "2023-11-07T05:31:56Z"
}
],
"pagination": {
"next_key": "aSDinaTvuI8gbWludGxpZnk=",
"total": "<string>"
}
}{
"code": 123,
"message": "<string>",
"details": [
{
"@type": "<string>"
}
]
}gov
Proposals (v1beta1)
gRPC: cosmos.gov.v1beta1.Query/Proposals (reference)
Proposals queries all proposals based on given status.
GET
/
cosmos
/
gov
/
v1beta1
/
proposals
Proposals (v1beta1)
curl --request GET \
--url https://cosmos-rest.publicnode.com/cosmos/gov/v1beta1/proposalsimport requests
url = "https://cosmos-rest.publicnode.com/cosmos/gov/v1beta1/proposals"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://cosmos-rest.publicnode.com/cosmos/gov/v1beta1/proposals', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://cosmos-rest.publicnode.com/cosmos/gov/v1beta1/proposals",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://cosmos-rest.publicnode.com/cosmos/gov/v1beta1/proposals"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://cosmos-rest.publicnode.com/cosmos/gov/v1beta1/proposals")
.asString();require 'uri'
require 'net/http'
url = URI("https://cosmos-rest.publicnode.com/cosmos/gov/v1beta1/proposals")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"proposals": [
{
"proposal_id": "<string>",
"content": {
"@type": "<string>"
},
"status": "PROPOSAL_STATUS_UNSPECIFIED",
"final_tally_result": {
"yes": "<string>",
"abstain": "<string>",
"no": "<string>",
"no_with_veto": "<string>"
},
"submit_time": "2023-11-07T05:31:56Z",
"deposit_end_time": "2023-11-07T05:31:56Z",
"total_deposit": [
{
"denom": "<string>",
"amount": "<string>"
}
],
"voting_start_time": "2023-11-07T05:31:56Z",
"voting_end_time": "2023-11-07T05:31:56Z"
}
],
"pagination": {
"next_key": "aSDinaTvuI8gbWludGxpZnk=",
"total": "<string>"
}
}{
"code": 123,
"message": "<string>",
"details": [
{
"@type": "<string>"
}
]
}Query Parameters
proposal_status defines the status of the proposals.
- PROPOSAL_STATUS_UNSPECIFIED: PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status.
- PROPOSAL_STATUS_DEPOSIT_PERIOD: PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit period.
- PROPOSAL_STATUS_VOTING_PERIOD: PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting period.
- PROPOSAL_STATUS_PASSED: PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has passed.
- PROPOSAL_STATUS_REJECTED: PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has been rejected.
- PROPOSAL_STATUS_FAILED: PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has failed.
Available options:
PROPOSAL_STATUS_UNSPECIFIED, PROPOSAL_STATUS_DEPOSIT_PERIOD, PROPOSAL_STATUS_VOTING_PERIOD, PROPOSAL_STATUS_PASSED, PROPOSAL_STATUS_REJECTED, PROPOSAL_STATUS_FAILED Response
A successful response.
Was this page helpful?