Reddit Comment Tree and Sentiment API

API ID 14533

Retrieve nested Reddit comment threads with parent-child IDs, reply depth, author handles, and comment scores sorted by best confidence, top, new, or controversial.

API Documentation

Endpoints

Request
Searches public Reddit posts across all communities or scoped to a specific subreddit by keyword, with support for sorting by relevance, hot, top, new, or comments and time-window filtering.
Endpoint ID: 37122
GET https://zylalabs.com/api/14533/reddit+comment+tree+and+sentiment+api/37122/search+reddit+posts
INPUT PARAMETERS

Search Reddit Posts — Endpoint Features

Object Description
query Required Search keyword or phrase (e.g. python, fastapi, rag pipeline).
subreddit Optional Optional subreddit name without the r/ prefix to scope search results to a single community.
sort Optional Sort order: relevance, hot, top, new, or comments (default relevance).
time_range Optional Time window filter: hour, day, week, month, year, or all (default all).
limit Optional Maximum number of posts to return (1-50, default 10).
cursor Optional Optional pagination cursor token returned in nextCursor from a previous response.
include_nsfw Optional Set to true to include NSFW posts in search results (default false).
no_cache Optional Set to true to bypass the 60-second micro-cache and fetch fresh upstream data.

Free test requests remaining: 3 of 3.


INPUT PARAMETERS

query
subreddit
sort
time_range
limit
cursor
include_nsfw
no_cache
API EXAMPLE RESPONSE
JSON
{
    "success": true,
    "meta": {
        "request_id": "req_7b21c84a901e",
        "plugin": "reddit",
        "endpoint": "search",
        "tier": "ULTRA",
        "cached": false,
        "latency_ms": 722.4,
        "timestamp": "2026-10-27T06:40:00.000000+00:00"
    },
    "data": {
        "query": "openai",
        "tab": "posts",
        "subreddit": null,
        "sort": "relevance",
        "timeFilter": "all",
        "pageSize": 1,
        "nextCursor": "t3_1b8k9x2",
        "hasMore": true,
        "items": [
            {
                "id": "t3_1b8k9x2",
                "postId": "1b8k9x2",
                "title": "Next-generation AI agents and real-time community intelligence benchmarks in 2026",
                "subreddit": "technology",
                "author": "user_a8f2",
                "url": "https://www.reddit.com/r/technology/comments/1b8k9x2/nextgeneration_ai_agents_and_realtime/",
                "permalink": "https://www.reddit.com/r/technology/comments/1b8k9x2/nextgeneration_ai_agents_and_realtime/",
                "score": 2840,
                "upvoteRatio": 0.94,
                "numComments": 342,
                "createdAt": "2026-03-15T13:50:00+00:00",
                "selftext": "We evaluated real-time community discussion pipelines for LLM grounding, brand sentiment tracking, and developer trend discovery.",
                "postType": "text",
                "flair": "Artificial Intelligence",
                "isOver18": false,
                "isPinned": false,
                "mediaUrls": [],
                "commentsCount": 0,
                "comments": [],
                "searchQuery": "openai",
                "scrapedAt": "2026-10-27T06:40:00.000000+00:00"
            }
        ]
    }
}
Search Reddit Posts — CODE SNIPPETS

curl --location --request GET 'https://zylalabs.com/api/14533/reddit+comment+tree+and+sentiment+api/37122/search+reddit+posts?query=python&sort=relevance&time_range=all&limit=10&include_nsfw=false&no_cache=false' --header 'Authorization: Bearer YOUR_API_KEY' 


    
Request
Fetches structured posts from a public subreddit community feed sorted by hot, new, top, or rising, including post scores, upvote ratios, comment counts, media links, and pagination cursors.
Endpoint ID: 37123
GET https://zylalabs.com/api/14533/reddit+comment+tree+and+sentiment+api/37123/get+subreddit+feed+posts
INPUT PARAMETERS

Get Subreddit Feed Posts — Endpoint Features

Object Description
subreddit Optional Subreddit community name without the r/ prefix (e.g. python, machinelearning, localllama).
url Optional Optional full subreddit URL instead of subreddit name.
sort Optional Feed sort order: hot, new, top, or rising (default hot).
time_range Optional Time window when sort is top: hour, day, week, month, year, or all (default all).
limit Optional Maximum number of posts to return (1-50, default 10).
cursor Optional Optional pagination cursor token returned in nextCursor from a previous response.
include_nsfw Optional Set to true to include NSFW posts in the subreddit feed (default false).
no_cache Optional Set to true to bypass the 60-second micro-cache and fetch fresh upstream data.

Free test requests remaining: 3 of 3.


INPUT PARAMETERS

subreddit
url
sort
time_range
limit
cursor
include_nsfw
no_cache
API EXAMPLE RESPONSE
JSON
{
    "success": true,
    "meta": {
        "request_id": "req_8c32d95b012f",
        "plugin": "reddit",
        "endpoint": "subreddit",
        "tier": "ULTRA",
        "cached": false,
        "latency_ms": 941.2,
        "timestamp": "2026-10-27T06:40:00.000000+00:00"
    },
    "data": {
        "subreddit": "technology",
        "url": "https://www.reddit.com/r/technology/",
        "sort": "hot",
        "timeFilter": "all",
        "pageSize": 1,
        "nextCursor": "t3_1b8k9x2",
        "hasMore": true,
        "items": [
            {
                "id": "t3_1b8k9x2",
                "postId": "1b8k9x2",
                "title": "Next-generation AI agents and real-time community intelligence benchmarks in 2026",
                "subreddit": "technology",
                "author": "user_a8f2",
                "url": "https://www.reddit.com/r/technology/comments/1b8k9x2/nextgeneration_ai_agents_and_realtime/",
                "permalink": "https://www.reddit.com/r/technology/comments/1b8k9x2/nextgeneration_ai_agents_and_realtime/",
                "score": 2840,
                "upvoteRatio": 0.94,
                "numComments": 342,
                "createdAt": "2026-03-15T13:50:00+00:00",
                "selftext": "We evaluated real-time community discussion pipelines for LLM grounding, brand sentiment tracking, and developer trend discovery.",
                "postType": "text",
                "flair": "Artificial Intelligence",
                "isOver18": false,
                "isPinned": false,
                "mediaUrls": [],
                "commentsCount": 0,
                "comments": [],
                "searchQuery": null,
                "scrapedAt": "2026-10-27T06:40:00.000000+00:00"
            }
        ]
    }
}
Get Subreddit Feed Posts — CODE SNIPPETS

curl --location --request GET 'https://zylalabs.com/api/14533/reddit+comment+tree+and+sentiment+api/37123/get+subreddit+feed+posts?subreddit=python&sort=hot&time_range=all&limit=10&include_nsfw=false&no_cache=false' --header 'Authorization: Bearer YOUR_API_KEY' 


    
Request
Extracts full metadata, body text, upvote ratio, score, flair, media links, and an optional preview of top-level and nested comments for a specific Reddit post by post_id or thread link.
Endpoint ID: 37124
GET https://zylalabs.com/api/14533/reddit+comment+tree+and+sentiment+api/37124/get+post+detail+and+top+comments
INPUT PARAMETERS

Get Post Detail and Top Comments — Endpoint Features

Object Description
post_id Optional Reddit post ID with or without the t3_ prefix (e.g. 1j9x2a4 or t3_1j9x2a4).
url Optional Optional full Reddit post permalink URL instead of post_id.
include_comments Optional Set to true to fetch top thread comments alongside post details (default true).
comment_limit Optional Maximum number of comments to return when include_comments is true (1-100, default 15).
no_cache Optional Set to true to bypass the 60-second micro-cache and fetch fresh upstream data.

Free test requests remaining: 3 of 3.


INPUT PARAMETERS

post_id
url
include_comments
comment_limit
no_cache
API EXAMPLE RESPONSE
JSON
{
    "success": true,
    "meta": {
        "request_id": "req_9d43ea6c1230",
        "plugin": "reddit",
        "endpoint": "post",
        "tier": "ULTRA",
        "cached": false,
        "latency_ms": 1180.5,
        "timestamp": "2026-10-27T06:40:00.000000+00:00"
    },
    "data": {
        "id": "t3_1b8k9x2",
        "postId": "1b8k9x2",
        "title": "Next-generation AI agents and real-time community intelligence benchmarks in 2026",
        "subreddit": "technology",
        "author": "user_a8f2",
        "url": "https://www.reddit.com/r/technology/comments/1b8k9x2/nextgeneration_ai_agents_and_realtime/",
        "permalink": "https://www.reddit.com/r/technology/comments/1b8k9x2/nextgeneration_ai_agents_and_realtime/",
        "score": 2840,
        "upvoteRatio": 0.94,
        "numComments": 342,
        "createdAt": "2026-03-15T13:50:00+00:00",
        "selftext": "We evaluated real-time community discussion pipelines for LLM grounding, brand sentiment tracking, and developer trend discovery.",
        "postType": "text",
        "flair": "Artificial Intelligence",
        "isOver18": false,
        "isPinned": false,
        "mediaUrls": [],
        "commentsCount": 2,
        "comments": [
            {
                "id": "kty8m1a",
                "postId": "t3_1b8k9x2",
                "parentId": "t3_1b8k9x2",
                "subreddit": "technology",
                "author": "user_4c9b",
                "body": "The real latency win comes from edge caching and avoiding cold-start browser overhead on every API call.",
                "score": 412,
                "createdAt": "2026-03-15T14:22:10+00:00",
                "depth": 0,
                "isSubmitter": false,
                "permalink": "https://www.reddit.com/r/technology/comments/1b8k9x2/sample_thread/kty8m1a/",
                "scrapedAt": "2026-10-27T06:40:00.000000+00:00"
            },
            {
                "id": "kty9b4c",
                "postId": "t3_1b8k9x2",
                "parentId": "t1_kty8m1a",
                "subreddit": "technology",
                "author": "user_7d1e",
                "body": "Agreed. For RAG pipelines and AI agents, sub-second JSON responses make a huge difference compared to headless browsers.",
                "score": 189,
                "createdAt": "2026-03-15T14:35:42+00:00",
                "depth": 1,
                "isSubmitter": false,
                "permalink": "https://www.reddit.com/r/technology/comments/1b8k9x2/sample_thread/kty9b4c/",
                "scrapedAt": "2026-10-27T06:40:00.000000+00:00"
            }
        ],
        "searchQuery": null,
        "scrapedAt": "2026-10-27T06:40:00.000000+00:00"
    }
}
Get Post Detail and Top Comments — CODE SNIPPETS

curl --location --request GET 'https://zylalabs.com/api/14533/reddit+comment+tree+and+sentiment+api/37124/get+post+detail+and+top+comments?post_id=1j9x2a4&include_comments=true&comment_limit=15&no_cache=false' --header 'Authorization: Bearer YOUR_API_KEY' 


    
Request
Retrieves structured comment trees for a specific Reddit post with parentId hierarchy, nesting depth, author handles, scores, timestamps, and sorting by confidence, top, new, controversial, or old.
Endpoint ID: 37125
GET https://zylalabs.com/api/14533/reddit+comment+tree+and+sentiment+api/37125/get+post+comment+thread
INPUT PARAMETERS

Get Post Comment Thread — Endpoint Features

Object Description
post_id Optional Reddit post ID with or without the t3_ prefix (e.g. 1j9x2a4 or t3_1j9x2a4).
url Optional Optional full Reddit post permalink URL instead of post_id.
sort Optional Comment sort order: confidence (best), top, new, controversial, or old (default confidence).
limit Optional Maximum number of comments to return (1-100, default 25).
no_cache Optional Set to true to bypass the 60-second micro-cache and fetch fresh upstream data.

Free test requests remaining: 3 of 3.


INPUT PARAMETERS

post_id
url
sort
limit
no_cache
API EXAMPLE RESPONSE
JSON
{
    "success": true,
    "meta": {
        "request_id": "req_ae54fb7d2341",
        "plugin": "reddit",
        "endpoint": "comments",
        "tier": "ULTRA",
        "cached": false,
        "latency_ms": 985.1,
        "timestamp": "2026-10-27T06:40:00.000000+00:00"
    },
    "data": {
        "postId": "1b8k9x2",
        "fullnameId": "t3_1b8k9x2",
        "subreddit": "technology",
        "postTitle": "Next-generation AI agents and real-time community intelligence benchmarks in 2026",
        "permalink": "https://www.reddit.com/r/technology/comments/1b8k9x2/nextgeneration_ai_agents_and_realtime/",
        "returnedCount": 2,
        "maxCommentsRequested": 20,
        "comments": [
            {
                "id": "kty8m1a",
                "postId": "t3_1b8k9x2",
                "parentId": "t3_1b8k9x2",
                "subreddit": "technology",
                "author": "user_4c9b",
                "body": "The real latency win comes from edge caching and avoiding cold-start browser overhead on every API call.",
                "score": 412,
                "createdAt": "2026-03-15T14:22:10+00:00",
                "depth": 0,
                "isSubmitter": false,
                "permalink": "https://www.reddit.com/r/technology/comments/1b8k9x2/sample_thread/kty8m1a/",
                "scrapedAt": "2026-10-27T06:40:00.000000+00:00"
            },
            {
                "id": "kty9b4c",
                "postId": "t3_1b8k9x2",
                "parentId": "t1_kty8m1a",
                "subreddit": "technology",
                "author": "user_7d1e",
                "body": "Agreed. For RAG pipelines and AI agents, sub-second JSON responses make a huge difference compared to headless browsers.",
                "score": 189,
                "createdAt": "2026-03-15T14:35:42+00:00",
                "depth": 1,
                "isSubmitter": false,
                "permalink": "https://www.reddit.com/r/technology/comments/1b8k9x2/sample_thread/kty9b4c/",
                "scrapedAt": "2026-10-27T06:40:00.000000+00:00"
            }
        ]
    }
}
Get Post Comment Thread — CODE SNIPPETS

curl --location --request GET 'https://zylalabs.com/api/14533/reddit+comment+tree+and+sentiment+api/37125/get+post+comment+thread?post_id=1j9x2a4&sort=confidence&limit=25&no_cache=false' --header 'Authorization: Bearer YOUR_API_KEY' 


    
Request
Extracts public posts and community activity submitted by a Reddit username with support for activity tabs (posts, submitted, or overview), sorting by new, hot, or top, and cursor pagination.
Endpoint ID: 37126
GET https://zylalabs.com/api/14533/reddit+comment+tree+and+sentiment+api/37126/get+user+submitted+posts+and+activity
INPUT PARAMETERS

Get User Submitted Posts and Activity — Endpoint Features

Object Description
username Optional Reddit username without the u/ prefix.
url Optional Optional full Reddit user profile URL instead of username.
tab Optional User profile activity tab: posts, submitted, or overview (default posts).
sort Optional Activity sort order: new, hot, or top (default new).
limit Optional Maximum number of user activity items to return (1-50, default 10).
cursor Optional Optional pagination cursor token returned in nextCursor from a previous response.
include_nsfw Optional Set to true to include NSFW submissions in user activity results (default false).
no_cache Optional Set to true to bypass the 60-second micro-cache and fetch fresh upstream data.

Free test requests remaining: 3 of 3.


INPUT PARAMETERS

username
url
tab
sort
limit
cursor
include_nsfw
no_cache
API EXAMPLE RESPONSE
JSON
{
    "success": true,
    "meta": {
        "request_id": "req_bf650c8e3452",
        "plugin": "reddit",
        "endpoint": "user",
        "tier": "ULTRA",
        "cached": false,
        "latency_ms": 1120.8,
        "timestamp": "2026-10-27T06:40:00.000000+00:00"
    },
    "data": {
        "username": "user_a8f2",
        "profileUrl": "https://www.reddit.com/user/user_a8f2/",
        "pageSize": 1,
        "nextCursor": "t3_1b8k9x2",
        "hasMore": false,
        "items": [
            {
                "id": "t3_1b8k9x2",
                "postId": "1b8k9x2",
                "title": "Next-generation AI agents and real-time community intelligence benchmarks in 2026",
                "subreddit": "technology",
                "author": "user_a8f2",
                "url": "https://www.reddit.com/r/technology/comments/1b8k9x2/nextgeneration_ai_agents_and_realtime/",
                "permalink": "https://www.reddit.com/r/technology/comments/1b8k9x2/nextgeneration_ai_agents_and_realtime/",
                "score": 2840,
                "upvoteRatio": 0.94,
                "numComments": 342,
                "createdAt": "2026-03-15T13:50:00+00:00",
                "selftext": "We evaluated real-time community discussion pipelines for LLM grounding, brand sentiment tracking, and developer trend discovery.",
                "postType": "text",
                "flair": "Artificial Intelligence",
                "isOver18": false,
                "isPinned": false,
                "mediaUrls": [],
                "commentsCount": 0,
                "comments": [],
                "searchQuery": null,
                "scrapedAt": "2026-10-27T06:40:00.000000+00:00"
            }
        ]
    }
}
Get User Submitted Posts and Activity — CODE SNIPPETS

curl --location --request GET 'https://zylalabs.com/api/14533/reddit+comment+tree+and+sentiment+api/37126/get+user+submitted+posts+and+activity?username=user_a8f2&tab=posts&sort=new&limit=10&include_nsfw=false&no_cache=false' --header 'Authorization: Bearer YOUR_API_KEY' 


    

API Access Key & Authentication

After signing up, every developer is assigned a personal API access key, a unique combination of letters and digits provided to access to our API endpoint. To authenticate with the Reddit Comment Tree and Sentiment API simply include your bearer token in the Authorization header.

Headers
Header Description
Authorization Required Should be Bearer access_key. See "Your API Access Key" above when you are subscribed.

No long-term commitment. Upgrade, downgrade, or cancel anytime.

Starts at
$10,000/Year


  • Custom Volume
  • Custom Rate Limit
  • Specialized Customer Support
  • Real-Time API Monitoring

Overview

Retrieve nested Reddit comment threads with parent-child IDs, reply depth, author handles, and comment scores sorted by best confidence, top, new, or controversial.

Reddit Comment Tree and Sentiment API FAQs

Each endpoint returns structured JSON data from public Reddit communities: Search Reddit Posts and Get Subreddit Feed Posts return post collections with scores and pagination cursors, Get Post Detail returns full thread metadata plus top comments, Get Post Comment Thread returns nested comment trees, and Get User Submitted Posts returns public user submissions.

Key post fields include `id`, `title`, `subreddit`, `author`, `score`, `upvoteRatio`, `commentCount`, `createdAt`, `permalink`, `bodyText`, and `mediaUrls`. Comment items also include `parentId` and `depth` to reconstruct multi-level conversation trees.

Parameters vary by endpoint and include `query`, `subreddit`, `sort`, `time_range`, `limit`, `cursor`, `include_nsfw`, `post_id`, `include_comments`, `comment_limit`, `username`, `tab`, and `no_cache`.

When additional items are available, the response includes a `nextCursor` string and `hasNextPage` boolean. Pass the `nextCursor` value into the `cursor` parameter on your next request to retrieve the next page.

Yes. On the Get Post Detail endpoint, set `include_comments` to `true` and adjust `comment_limit` to receive both the complete `post` object and the top thread `comments` in one request.

Every response uses a consistent JSON envelope containing a `success` boolean, a `meta` object with `request_id`, `latency_ms`, and `cached` status, and a `data` object holding the requested `items`, `post`, or `comments`.

Common use cases include AI agent grounding and Retrieval-Augmented Generation (RAG), social listening, brand sentiment analysis, community trend tracking, market research, and developer ecosystem monitoring.

Responses are cached for 60 seconds by default to maximize speed and protect rate limits. Pass `no_cache` set to `true` on any endpoint to force a fresh real-time upstream extraction.

General FAQs

To obtain your API key, first sign in to your account and navigate to the API you want to use. From the API's Pricing section, choose a plan and complete the subscription process. Once subscribed, return to the API page and you will see your API Access Key displayed at the top of the documentation page. You can use this key to authenticate your requests.

You can’t switch APIs during the free trial. If you subscribe to a different API, your trial will end and the new subscription will start as a paid plan.

The free trial lasts for 7 days and allows you to make up to 50 API requests.

No, the free trial is available only once, so we recommend using it on the API that interests you the most. Most of our APIs offer a free trial, but some may not include this option.

Yes. If the API offers a free trial, you will see a "Free 7-Day Trial" option in its Pricing section. The trial lasts for 7 days and allows up to 50 API requests, enabling you to evaluate the API before subscribing to a paid plan.

Zyla API Hub is like a big store for APIs, where you can find thousands of them all in one place. We also offer dedicated support and real-time monitoring of all APIs. Once you sign up, you can pick and choose which APIs you want to use. Just remember, each API needs its own subscription. But if you subscribe to multiple ones, you'll use the same key for all of them, making things easier for you.

Prices are listed in USD (United States Dollar), EUR (Euro), CAD (Canadian Dollar), AUD (Australian Dollar), and GBP (British Pound). We accept all major debit and credit cards. Our payment system uses the latest security technology and is powered by Stripe, one of the world's most reliable payment companies. If you have any trouble paying by card, just contact us at [email protected]

Additionally, if you already have an active subscription in any of these currencies (USD, EUR, CAD, AUD, GBP), that currency will remain for subsequent subscriptions. You can change the currency at any time as long as you don't have any active subscriptions.
The local currency shown on the pricing page is based on the country of your IP address and is provided for reference only. The actual prices are in USD (United States Dollar). When you make a payment, the charge will appear on your card statement in USD, even if you see the equivalent amount in your local currency on our website. This means you cannot pay directly with your local currency.
Occasionally, a bank may decline the charge due to its fraud protection settings. We suggest reaching out to your bank initially to check if they are blocking our charges. Also, you can access the Billing Portal and change the card associated to make the payment. If these does not work and you need further assistance, please contact our team at [email protected]
Prices are determined by a recurring monthly or yearly subscription, depending on the chosen plan.
API calls are deducted from your plan based on successful requests. Each plan comes with a specific number of calls that you can make per month. Only successful calls, indicated by a Status 200 response, will be counted against your total. This ensures that failed or incomplete requests do not impact your monthly quota.
Zyla API Hub works on a recurring monthly subscription system. Your billing cycle will start the day you purchase one of the paid plans, and it will renew the same day of the next month. So be aware to cancel your subscription beforehand if you want to avoid future charges.
To upgrade your current subscription plan, simply go to the pricing page of the API and select the plan you want to upgrade to. The upgrade will be instant, allowing you to immediately enjoy the features of the new plan. Please note that any remaining calls from your previous plan will not be carried over to the new plan, so be aware of this when upgrading. You will be charged the full amount of the new plan.
To check how many API calls you have left for the current month, refer to the 'X-Zyla-API-Calls-Monthly-Remaining' field in the response header. For example, if your plan allows 1,000 requests per month and you've used 100, this field in the response header will indicate 900 remaining calls.

You can monitor your API usage through the response headers included with every request:

x-zyla-api-calls-monthly-used: Shows the total number of API requests you have used during the current billing period.
x-zyla-api-calls-monthly-remaining: Shows the number of API requests you have remaining for the current billing period.

The 'X-Zyla-RateLimit-Reset' header shows the number of seconds until your rate limit resets. This tells you when your request count will start fresh. For example, if it displays 3,600, it means 3,600 seconds are left until the limit resets.

Yes, you can cancel your subscription at any time. Simply go to the Pricing section of the API you're subscribed to and click the "Unsubscribe" button.

Please note that upgrades, downgrades, and cancellations take effect immediately. Once your subscription is canceled, access to the service will end immediately, regardless of any remaining API calls in your quota.

After 7 days, you will be charged the full amount for the plan you were subscribed to during the trial. Therefore, it's important to cancel before the trial period ends. Refund requests for forgetting to cancel on time are not accepted.
When you subscribe to an API free trial, you can make up to 50 API calls. If you wish to make additional API calls beyond this limit, the API will prompt you to perform an "Start Your Paid Plan." You can find the "Start Your Paid Plan" button in your profile under Subscription -> Choose the API you are subscribed to -> Pricing tab.
You can contact us through our chat channel to receive immediate assistance. We are always online from 8 am to 5 pm (EST). If you reach us after that time, we will get back to you as soon as possible. Additionally, you can contact us via email at [email protected]

Please have a look at our Refund Policy: https://zylalabs.com/terms#refund


Related APIs