database_api.list_proposals
Purpose
Returns all proposals, starting with the specified creator or start date. Parameters: start:array; limit:int; order:string; order_direction:string; status:string
startdepends onorder(see below)creator- creator of the proposal (account name string)start_date- start date of the proposal (date string)end_date- end date of the proposal (date string)total_votes- total votes of the proposal (int)
limitis up to 1000.ordercan be one of:by_creator- order by proposal creatorby_start_date- order by proposal start dateby_end_date- order by proposal end dateby_total_votes- order by proposal total votes
order_directioncan be one of:ascendingdescending
statusallinactiveactiveexpiredvotable
start (array) | limit (int) | order (string) | order_direction (string) | status (string) | |
|---|---|---|---|---|---|
[""] | 10 | by_creator | ascending | active | list 10 proposals with active status, ordered by creator, ascending |
["2019-08-07T16:54:03"] | 1000 | by_start_date | ascending | inactive | list 1000 proposals with inactive status, ordered by start date, ascending, since 2019-08-07T16:54:03 |
["a"] | 1 | by_creator | ascending | expired | list 1 proposal with expired status, ordered by creator, ascending, by accounts starting with "a" |
["alice"] | 10 | by_creator | ascending | all | list 10 proposals with any status, ordered by creator, ascending, by alice |
[""] | 1000 | by_creator | ascending | votable | list 1000 votable proposals, ordered by creator, ascending |
[10] | 1000 | by_total_votes | ascending | votable | list 1000 votable proposals, ordered by creator, ascending, having at least 10 votes |
Also see: Paginated API Methods
Parameters
PARAMETERS
json
{
"start": null,
"limit": 0,
"order": "by_name",
"order_direction": "ascending",
"status": "all"
}Example
Example 1
BASH
bash
curl -s https://api.steemit.com \
-H 'Content-Type: application/json' \
--data-binary '{
"jsonrpc": "2.0",
"method": "database_api.list_proposals",
"params": {
"start": [
""
],
"limit": 10,
"order": "by_creator",
"order_direction": "ascending",
"status": "active"
},
"id": 1
}'Example 2
BASH
bash
curl -s https://api.steemit.com \
-H 'Content-Type: application/json' \
--data-binary '{
"jsonrpc": "2.0",
"method": "database_api.list_proposals",
"params": {
"start": [
"2019-08-07T16:54:03"
],
"limit": 1000,
"order": "by_start_date",
"order_direction": "ascending",
"status": "inactive"
},
"id": 1
}'Example 3
BASH
bash
curl -s https://api.steemit.com \
-H 'Content-Type: application/json' \
--data-binary '{
"jsonrpc": "2.0",
"method": "database_api.list_proposals",
"params": {
"start": [
"a"
],
"limit": 1,
"order": "by_creator",
"order_direction": "ascending",
"status": "expired"
},
"id": 1
}'Example 4
BASH
bash
curl -s https://api.steemit.com \
-H 'Content-Type: application/json' \
--data-binary '{
"jsonrpc": "2.0",
"method": "database_api.list_proposals",
"params": {
"start": [
"alice"
],
"limit": 10,
"order": "by_creator",
"order_direction": "ascending",
"status": "all"
},
"id": 1
}'Example 5
BASH
bash
curl -s https://api.steemit.com \
-H 'Content-Type: application/json' \
--data-binary '{
"jsonrpc": "2.0",
"method": "database_api.list_proposals",
"params": {
"start": [
""
],
"limit": 1000,
"order": "by_creator",
"order_direction": "ascending",
"status": "votable"
},
"id": 1
}'Example 6
BASH
bash
curl -s https://api.steemit.com \
-H 'Content-Type: application/json' \
--data-binary '{
"jsonrpc": "2.0",
"method": "database_api.list_proposals",
"params": {
"start": [
10
],
"limit": 1000,
"order": "by_total_votes",
"order_direction": "ascending",
"status": "votable"
},
"id": 1
}'Response
RESPONSE
json
{
"proposals": [
{
"id": 0,
"proposal_id": "1103806595072",
"creator": "alice",
"receiver": "bob",
"start_date": "2019-07-01T00:00:00",
"end_date": "2019-08-01T23:59:59",
"daily_pay": {
"amount": "4800000",
"precision": 3,
"nai": "@@000000013"
},
"subject": "My Proposal",
"permlink": "creator-proposal-permlink",
"total_votes": "77351826710",
"status": "active"
}
]
}