Sand AISand AI MAGI-2MAGI-2 est maintenant sur SandBase : vidéo 1080p avec audio natifEssayer maintenant

Reddit Post Comments

Docs 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.

Prix
À partir de $0.0006USD / appel
Méthode
POST
Réponse
JSON
Paramètres
1 obligatoires · 1 facultatifs

Bac à sable

Entrée
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.
SortiePrêt

Votre sortie apparaîtra ici

Complétez les entrées, puis cliquez sur Exécuter.

README de l'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.

Explorer plus

APIs associées

Toutes les APIs
APIPrixRéponse
RedditÀ partir de $0.0006 par appelJSON
Reddit$0.001 par appelJSON
Reddit$0.001 par appelJSON
Reddit$0.001 par appelJSON
Reddit$0.001 par appelJSON
Reddit$0.001 par appelJSON

Guides :Best Reddit API in 2026: Pricing Compared

Questions

FAQ

Comment utiliser l’API Reddit Post Comments ?

Envoyez une requête POST à https://api.sandbase.ai/v1/api/reddit/post-comments avec votre clé API SandBase dans l’en-tête Authorization (Bearer) et les paramètres dans un corps JSON. Vous pouvez aussi l’essayer dans le Playground sur cette page sans écrire de code.

Combien coûte l’API Reddit Post Comments ?

À partir de $0.0006 par appel, facturé depuis votre solde SandBase. Vous ne payez que les appels que vous effectuez ; aucun abonnement.

Quels paramètres l’API Reddit Post Comments accepte-t-elle ?

Obligatoire : url (string). Facultatif : cursor (string). Le tableau des paramètres et le Playground sur cette page listent tous les champs.

Que renvoie l’API Reddit Post Comments ?

Une réponse JSON renvoyée dans la même requête HTTP (synchrone). Le README sur cette page inclut un exemple de réponse.

Ai-je besoin d’un compte développeur ou d’une clé API Reddit ?

Non. Reddit Post Comments fonctionne via SandBase, donc une seule clé API SandBase couvre ce point de terminaison ainsi que toutes les autres API et tous les modèles du catalogue. Vous n’avez pas besoin de demander un accès API Reddit séparément.

Dois-je transmettre un ID de post ou une URL à cette API Comments ?

Cet endpoint prend l’URL du post Reddit dans url, ainsi qu’un curseur facultatif. Utilisez l’URL publique complète du post pour le tutoriel. La variante de l’application Post Comments a un contrat de requête distinct ; ne copiez pas ici ses paramètres post_id ou after.

Comment conserver les relations de réponse et lire plus de commentaires ?

La référence décrit un tableau plat data.comments. Faites correspondre parentId à l’id du commentaire parent ; une chaîne vide dans parentId indique un commentaire de niveau supérieur. Un parent référencé peut ne pas être présent dans la page que vous avez récupérée, conservez donc cette relation manquante au lieu de traiter la réponse comme un commentaire de niveau supérieur. Si un data.nextCursor complet est renvoyé, envoyez-le comme cursor avec la même URL du post. Une seule réponse ne garantit pas un thread complet.

Cette endpoint effectue-t-elle une analyse de sentiment ou recherche-t-elle tous les commentaires Reddit ?

Non. Elle lit les commentaires pour l’URL du post que vous fournissez. L’interprétation du sentiment est une étape d’analyse distincte, et un thread échantillonné n’est pas une mesure représentative d’une communauté entière. Les scores et les noms d’utilisateur sont un contexte, pas une vérification factuelle. Utilisez uniquement des données publiques et respectez les règles applicables de la plateforme et d’utilisation.