Choose one product question to investigate
Suppose you are building a listening dashboard for an API company. The first question might be “Where do developers get stuck during setup?” That question suggests searches about authentication, webhook configuration and unclear documentation. It also gives the report a useful output: recurring setup problems with examples.
Our Reddit search endpoint finds candidate threads, and the comment endpoints retrieve the discussion you choose to inspect. Your application decides which threads are relevant and which themes the text supports. Keep those steps visible so readers can tell the difference between collected comments and a model’s interpretation.
1. Find discussions with focused searches
Use reddit.search with a few phrases that describe the problem, such as “API key not working” or “webhook setup.” Review the returned threads for relevance before collecting their comments. Keep the query that found each selected post so a report can explain its search scope.
Set SOCIALSCRAPER_API_KEY on your backend and replace the example input with your source.
// Reddit Post Search API · reddit API
const response = await fetch("https://socialmediascraper.org/v1/reddit/search?query=technology", {
method: 'GET',
headers: {
'x-api-key': process.env.SOCIALSCRAPER_API_KEY,
'x-price-version': '2026-11-23.retail-1',
'Idempotency-Key': crypto.randomUUID()
}
});
if (!response.ok) throw new Error(`HTTP ${response.status}: ${await response.text()}`);
const data = await response.json();
console.log(data);Set the first run’s scope before calling the API: a handful of search phrases, a limited number of selected threads and a page budget. Apply only filters supported by the endpoint, and handle other selection rules in your application. Save the query that found each thread so the report can explain how its sample was assembled.
2. Read comments from the selected threads
Pass a selected thread’s full URL to reddit.comments. Keep its target and sorting unchanged while following the returned cursor. Our API also documents a POST variant for clients that send a JSON body; use the reference matching your request format.
Set SOCIALSCRAPER_API_KEY on your backend and replace the example input with your source.
// Reddit Post Comments (GET) API · reddit API
const response = await fetch("https://socialmediascraper.org/v1/reddit/comments?url=https%3A%2F%2Fwww.reddit.com%2Fr%2FAskReddit%2Fcomments%2Fablzuq%2Fpeople_who_havent_pooped_in_2019_yet_why_are_you%2F", {
method: 'GET',
headers: {
'x-api-key': process.env.SOCIALSCRAPER_API_KEY,
'x-price-version': '2026-11-23.retail-1',
'Idempotency-Key': crypto.randomUUID()
}
});
if (!response.ok) throw new Error(`HTTP ${response.status}: ${await response.text()}`);
const data = await response.json();
console.log(data);Save the comment IDs, text, source URLs and collection time with each returned page. If a run pauses, retain the continuation only after the page is stored. Your worker can then resume useful progress rather than restarting a long discussion.
3. Make every finding traceable to a comment
Deduplicate comments by ID before counting themes. Keep the thread URL even when a row has no additional reply metadata. When parent or reply context is available, preserve it; a short response such as “same here” may only make sense beside the comment it answers.
| Saved value | Use in the product | Why it helps |
|---|---|---|
| Comment ID | Deduplicate and update | One stored source per comment |
| Original text | Review or rerun analysis | Keep the evidence separate from labels |
| Thread or comment URL | Open the discussion | Let customers check the context |
| Theme and sample size | Show a report | Explain what the count describes |
For this setup report, begin with labels such as authentication, webhook setup and unclear documentation. Store the label alongside a quoted excerpt and its comment ID. The example below shows an application-generated finding. Its text is illustrative; the evidence in a real report must come from the records you collected.
{
"theme": "Webhook setup",
"summary": "A finding supported by the collected excerpts",
"sample_size": 105,
"matching_comments": 21,
"evidence": [
{
"comment_id": "SOURCE_COMMENT_ID",
"excerpt": "COPY THE SUPPORTING COMMENT TEXT",
"source_url": "REDDIT_SOURCE_URL"
}
]
}Example: report 21 setup complaints in a 105-comment sample
Suppose three selected threads return 120 rows across no more than two comment pages each. Fifteen rows repeat a comment ID, leaving 105 unique comments. That collection requires at most six new comment-page requests, plus the searches used to find the threads.
If 21 of the 105 comments mention setup problems, report that count and attach representative excerpts. It is 20% of the collected sample, not 20% of all customers or Reddit users. A source-linked sample is useful product research without pretending to be a market-wide survey.
| Stage | Example count | Product output |
|---|---|---|
| Fetch selected pages | 120 rows | Raw discussion records |
| Deduplicate comment IDs | 105 comments | A usable source collection |
| Group setup problems | 21 matching comments | A finding with excerpts and links |
Turn the sample into a repeatable listening report
Show each theme with its count, the sample size and representative comments users can open. Discover new threads separately from refreshing active ones, and merge repeated comments by ID. This lets the report grow over time without treating every refresh as a different set of sources.
A first version can answer one product question from a few discussions. Add a schedule once that report is useful, with a page allowance and an explicit record of unfinished threads. Start with our Reddit Search API, select a relevant result and use the Comments API to collect its supporting discussion.
FAQ
Common questions
A few details to check before you build.
What does socialmediascraper.org provide for social listening?
It provides Reddit search and comment operations for supported public discussions. Your application chooses the scope, groups themes and presents the findings with source links.
Can the API return a ready-made sentiment report?
This workflow collects source data. You apply your own labels or model to the comments, keeping the original text and IDs so the analysis can be reviewed or rerun.
How do I avoid counting the same comment twice?
Use comment IDs as unique keys when merging pages or refreshes. Do not use text as the key, because different people can write the same words.
How should I start a small test?
Choose one product question, search for relevant discussions and fetch comments from a few selected threads. Review the source-linked report before expanding the collection.
