Перейти к содержимому

database_api.list_comments ​

Purpose ​

Возвращает все комментарии (comment), начиная с указанных опций. Параметры: start:array; limit:int; order:string

  • start зависит от order (см. ниже)
  • limit - до 1000.
  • order может быть одним из:
    • by_cashout_time - упорядочение по времени выплаты (cashout time)
      • start - массив из одного обязательного и двух необязательных значений: timestamp, author, permlink
    • by_permlink - упорядочение по пермалинку (permlink)
      • start - массив из двух необязательных значений: author, permlink
    • by_root - упорядочение по корню (root)
      • start - массив из двух обязательных и двух необязательных значений: root_author, root_permlink, child_author, child_permlink
    • by_parent - упорядочение по родителю (parent)
      • start - массив из двух обязательных и двух необязательных значений: parent_author, parent_permlink, child_author, child_permlink

| start (array) | limit (int) | order (string) | | |----------------------------|---------------|-| | ["1970-01-01T00:00:00", "", ""] | 10 | "by_cashout_time" | Запрос первых 10 комментариев, сортировка по времени выплаты | | ["", ""] | 10 | "by_permlink" | Запрос первых 10 комментариев, сортировка по пермалинку | | ["steemit","firstpost", "", ""] | 10 | "by_root" | Запрос следующих 10 комментариев начиная с @steemit/firstpost, сортировка по корню | | ["steemit","firstpost", "", ""] | 10 | "by_parent" | Запрос следующих 10 комментариев начиная с @steemit/firstpost, сортировка по родителю |

См. также: Paginated API Methods

Parameters ​

PARAMETERS
json
{
  "start": null,
  "limit": 0,
  "order": "by_name"
}

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_comments",
    "params": {
      "start": [
        "1970-01-01T00:00:00",
        "",
        ""
      ],
      "limit": 10,
      "order": "by_cashout_time"
    },
    "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_comments",
    "params": {
      "start": [
        "",
        ""
      ],
      "limit": 10,
      "order": "by_permlink"
    },
    "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_comments",
    "params": {
      "start": [
        "steemit",
        "firstpost",
        "",
        ""
      ],
      "limit": 10,
      "order": "by_root"
    },
    "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_comments",
    "params": {
      "start": [
        "steemit",
        "firstpost",
        "",
        ""
      ],
      "limit": 10,
      "order": "by_parent"
    },
    "id": 1
  }'

Response ​

RESPONSE
json
{
  "comments": [
    {
      "id": 66710716,
      "author": "libert",
      "permlink": "libert-re-runicar-re-libert-libert-re-runicar-re-libert-libert-re-runicar-ykwyxgj6-20181128t063355338z",
      "category": "steem",
      "parent_author": "runicar",
      "parent_permlink": "re-libert-libert-re-runicar-re-libert-libert-re-runicar-ykwyxgj6-20181128t063100538z",
      "title": "",
      "body": "13\n\nPosted using [Partiko Android](https://steemit.com/@partiko-android)",
      "json_metadata": "{\"app\":\"partiko\"}",
      "last_update": "2018-11-28T06:33:57",
      "created": "2018-11-28T06:33:57",
      "active": "2018-11-28T06:34:30",
      "last_payout": "1970-01-01T00:00:00",
      "depth": 5,
      "children": 1,
      "net_rshares": 0,
      "abs_rshares": 0,
      "vote_rshares": 0,
      "children_abs_rshares": 0,
      "cashout_time": "2018-12-05T06:33:57",
      "max_cashout_time": "1969-12-31T23:59:59",
      "total_vote_weight": 0,
      "reward_weight": 10000,
      "total_payout_value": {
        "amount": "0",
        "precision": 3,
        "nai": "@@000000013"
      },
      "curator_payout_value": {
        "amount": "0",
        "precision": 3,
        "nai": "@@000000013"
      },
      "author_rewards": 0,
      "net_votes": 0,
      "root_author": "runicar",
      "root_permlink": "ykwyxgj6",
      "max_accepted_payout": {
        "amount": "1000000000",
        "precision": 3,
        "nai": "@@000000013"
      },
      "percent_steem_dollars": 10000,
      "allow_replies": true,
      "allow_votes": true,
      "allow_curation_rewards": true,
      "beneficiaries": []
    }
  ]
}