Sand AISand AI MAGI-2MAGI-2 ya está en SandBase: video en 1080p con audio nativoPruébalo ahora

Reddit Post Comments

Documentación de la 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.

Precio
Desde $0.0006USD / llamada
Método
POST
Respuesta
JSON
Parámetros
1 obligatorios · 1 opcionales

Entorno de pruebas

Entrada
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.
SalidaListo

Su salida aparecerá aquí

Complete las entradas y luego haga clic en Ejecutar.

README de la 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.

Explorar más

APIs relacionadas

Todas las APIs
APIPrecioRespuesta
RedditDesde $0.0006 por llamadaJSON
Reddit$0.001 por llamadaJSON
Reddit$0.001 por llamadaJSON
Reddit$0.001 por llamadaJSON
Reddit$0.001 por llamadaJSON
Reddit$0.001 por llamadaJSON

Guías:Best Reddit API in 2026: Pricing Compared

Preguntas

FAQ

¿Cómo uso la API de Reddit Post Comments?

Envía una solicitud POST a https://api.sandbase.ai/v1/api/reddit/post-comments con tu clave API de SandBase en el encabezado Authorization (Bearer) y los parámetros como un cuerpo JSON. También puedes probarlo en el Playground de esta página sin escribir código.

¿Cuánto cuesta la API de Reddit Post Comments?

Desde $0.0006 por llamada, facturado desde tu saldo de SandBase. Solo se te cobra por las llamadas que haces; no hay suscripción.

¿Qué parámetros acepta la API de Reddit Post Comments?

Requeridos: url (string). Opcionales: cursor (string). La tabla de Parámetros y el Playground de esta página enumeran todos los campos.

¿Qué devuelve la API de Reddit Post Comments?

Una respuesta JSON devuelta en la misma solicitud HTTP (sincrónica). El README de esta página incluye una respuesta de ejemplo.

¿Necesito una cuenta de desarrollador o una clave API de Reddit?

No. Reddit Post Comments funciona a través de SandBase, así que una sola clave API de SandBase cubre este endpoint y todas las demás APIs y modelos del catálogo. No necesitas solicitar acceso a la API de Reddit por separado.

¿Debo pasar un ID de publicación o una URL a esta Comments API?

Este endpoint toma la URL de la publicación de Reddit como url, además de un cursor opcional. Usa la URL pública completa de la publicación para el tutorial. La variante de la app Post Comments tiene un contrato de solicitud separado; no copies aquí sus parámetros post_id o after.

¿Cómo conservo las relaciones de respuesta y leo más comentarios?

La referencia describe un array plano data.comments. Haz coincidir parentId con el id del comentario padre; una cadena vacía en parentId marca un comentario de nivel superior. Es posible que un padre referenciado no esté presente en la página que obtuviste, así que conserva esa relación faltante en lugar de tratar la respuesta como de nivel superior. Si se devuelve un data.nextCursor completo, envíalo como cursor con la misma URL de la publicación. Una respuesta no garantiza un hilo completo.

¿Este endpoint realiza análisis de sentimiento o busca todos los comentarios de Reddit?

No. Lee los comentarios de la URL de la publicación que proporciones. Interpretar el sentimiento es un paso de análisis aparte, y un hilo muestreado no es una medida representativa de toda una comunidad. Las puntuaciones y los nombres de usuario son contexto, no verificación factual. Usa solo datos públicos y sigue las normas aplicables de la plataforma y de uso.