Sand AISand AI MAGI-2MAGI-2 kini tersedia di SandBase: video 1080p dengan audio nativeCoba sekarang

Reddit Post Comments

Dokumentasi API
https://api.sandbase.ai/v1/api/reddit/post-comments

List the comments on a Reddit post by URL (author, body, score, timestamp, parent comment). Replies carry the parentId of the comment they answer.

Harga
Dari $0.0006USD / panggilan
Metode
POST
Respons
JSON
Parameter
1 wajib · 1 opsional

Playground

Input
Full Reddit post URL on reddit.com. A gallery link (https://www.reddit.com/gallery/<id>) is read as the post it belongs to, and a relative permalink (/r/<subreddit>/comments/<id>/...) as the same path on https://www.reddit.com.
Cursor from a previous response for more comments.
OutputSiap

Output Anda akan muncul di sini

Lengkapi input, lalu klik Run.

README API

Reddit Post Comments API

Returns the comments on a Reddit post, with author, body, score, creation time and the parent comment for each reply. It needs the full URL of the post as url.

Use cases

  • Collect the replies to a popular AMA to study which questions got the most upvotes.
  • Rebuild a comment thread as a tree by matching each parentId to a comment id.
  • Pull the top-scored comments on a post to summarize what readers think.
  • Link each comment back to its page on Reddit using its url to review or moderate it.

Request

curl -X POST "https://api.sandbase.ai/v1/api/reddit/post-comments" \
  -H "Authorization: Bearer $SANDBASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://www.reddit.com/r/IAmA/comments/z1c9z/i_am_barack_obama_president_of_the_united_states/"}'

The result is returned in outputs[0].data.

Parameters

NameTypeRequiredDescription
urlstringYesFull Reddit post URL on reddit.com. A gallery link (https://www.reddit.com/gallery/<id>) is read as the post it belongs to, and a relative permalink (/r/<subreddit>/comments/<id>/...) as the same path on https://www.redd
cursorstringNoCursor from a previous response for more comments.

Example response

Real response for the request above, trimmed: lists keep their first item and long strings are cut.

{
  "data": {
    "comments": [
      {
        "author": "Biinaryy",
        "body": "Here is a collection of all the questions and answers:\n\nQuestion: [Link](http://…",
        "createdUtc": 1346276659,
        "id": "c60o0iw",
        "parentId": "",
        "score": 5399,
        "url": "https://www.reddit.com/r/IAmA/comments/z1c9z/i_am_barack_obama_president_of_the_…"
      }
    ],
    "media": null,
    "nextCursor": "cur_E_QuTid3jKG5pjQCweyA_g"
  },
  "found": true
}

Response fields

FieldMeaning
data.comments[].authorReddit username of the person who wrote the comment.
data.comments[].bodyText of the comment. It uses Reddit markdown, so links and emphasis appear as markdown.
data.comments[].idID of the comment, for example c60o0iw. Replies point to it in parentId.
data.comments[].parentIdThe id of the comment this one answers. It is an empty string for a top-level comment.
data.comments[].scoreScore of the comment, as a number.
data.comments[].createdUtcCreation time of the comment as a Unix timestamp in seconds (UTC).
data.comments[].urlDirect link to the comment on reddit.com.
data.nextCursorCursor for the next page of comments. Send it as cursor in the next request.
data.mediaMedia attached to the post. It is null in this response.
foundtrue when the post was found. A lookup that finds nothing returns false.

Notes

Need to find a thread first? Search posts within one subreddit. Then follow the Python request walkthrough to read a selected thread without assuming complete comment coverage.

  • Copy the post URL from Reddit. A gallery link or a relative permalink such as /r/<subreddit>/comments/<id>/... also works.
  • To get more comments, repeat the request with the same url and the nextCursor value as cursor.
  • Comments are listed in a flat array. Use parentId to see which comment each reply answers.

Pricing

Billed at the actual cost of each call, about $0.0006 for the request above. Failed calls are not charged.

Jelajahi lebih lanjut

API Terkait

Semua APIs
APIHargaRespons
RedditDari $0.0006 per panggilanJSON
Reddit$0.001 per panggilanJSON
Reddit$0.001 per panggilanJSON
Reddit$0.001 per panggilanJSON
Reddit$0.001 per panggilanJSON
Reddit$0.001 per panggilanJSON

Panduan:Best Reddit API in 2026: Pricing Compared

Pertanyaan

FAQ

Bagaimana cara menggunakan API Reddit Post Comments?

Kirim permintaan POST ke https://api.sandbase.ai/v1/api/reddit/post-comments dengan kunci API SandBase Anda di header Authorization (Bearer) dan parameter sebagai body JSON. Anda juga dapat mencobanya di Playground di halaman ini tanpa menulis kode.

Berapa biaya API Reddit Post Comments?

Mulai dari $0.0006 per panggilan, ditagihkan dari saldo SandBase Anda. Anda hanya dikenai biaya untuk panggilan yang Anda lakukan; tidak ada langganan.

Parameter apa yang diterima API Reddit Post Comments?

Wajib: url (string). Opsional: cursor (string). Tabel Parameters dan Playground di halaman ini mencantumkan setiap field.

Apa yang dikembalikan API Reddit Post Comments?

Respons JSON yang dikembalikan dalam permintaan HTTP yang sama (sinkron). README di halaman ini menyertakan contoh respons.

Apakah saya memerlukan akun developer atau kunci API Reddit?

Tidak. Reddit Post Comments berjalan melalui SandBase, jadi satu kunci API SandBase mencakup endpoint ini dan setiap API serta model lain di katalog. Anda tidak perlu mendaftar akses API Reddit secara terpisah.

Haruskah saya mengirim ID post atau URL ke Comments API ini?

Endpoint ini menerima URL post Reddit sebagai url, plus cursor opsional. Gunakan URL post publik lengkap untuk tutorial. Varian app Post Comments memiliki kontrak permintaan yang terpisah; jangan menyalin post_id atau parameter after-nya ke sini.

Bagaimana cara mempertahankan hubungan balasan dan membaca lebih banyak komentar?

Deskripsi referensi menjelaskan array data.comments yang datar. Cocokkan parentId dengan id komentar induk; string kosong pada parentId menandai komentar tingkat teratas. Induk yang dirujuk mungkin tidak ada di halaman yang Anda ambil, jadi pertahankan relasi yang hilang itu alih-alih memperlakukan balasan sebagai tingkat teratas. Jika data.nextCursor lengkap dikembalikan, kirim sebagai cursor dengan URL post yang sama. Satu respons tidak menjamin thread yang lengkap.

Apakah endpoint ini melakukan analisis sentimen atau mencari setiap komentar Reddit?

Tidak. Endpoint ini membaca komentar untuk URL post yang Anda berikan. Menafsirkan sentimen adalah langkah analisis terpisah, dan thread sampel bukan ukuran representatif untuk seluruh komunitas. Skor dan nama pengguna adalah konteks, bukan verifikasi faktual. Gunakan hanya data publik dan ikuti aturan platform serta penggunaan yang berlaku.