DEV Community

Cover image for Build a Reddit Search API Workflow with ChatGPT and SocialListeningAPI
Shash
Shash

Posted on

Build a Reddit Search API Workflow with ChatGPT and SocialListeningAPI

Reddit is great for finding people talking about your product, complaining about your competitors, etc. It is also full of repeated jokes, old advice, and posts that match a keyword for the
wrong context.

A Reddit social listening workflow should do more than collect links. It should preserve the post or
comment text, subreddit, date, and source URL, then give ChatGPT a strict rule for keeping or
rejecting each result.

For this workflow, we'll be using:

  • SocialListeningAPI It searches public Reddit posts and comments.
  • ChatGPT. It can group the returned records and write a short brief. A human still needs to read the full thread before treating a comment as evidence or joining the conversation.

PS, you can also use Claude or any other LLM, it doesn't really matter.

What this workflow is good for

I would use this setup for research jobs where the exact words matter:

  • Finding product recommendation questions
  • Collecting complaints about a product category
  • Finding workarounds people already use
  • Grouping repeated feature requests
  • Learning how people compare two products
  • Finding questions that deserve a clear help article

It is a poor fit for counting every mention or declaring broad market sentiment. A keyword result is
a sample of public Reddit content, and a single popular thread can distort the picture.

The two Reddit search endpoints

SocialListeningAPI has separate endpoints for posts and comments.

Search Endpoint Cost per successful request
Public posts /api/v1/reddit/search-posts 1 credit
Public comments /api/v1/reddit/search-comments 2 credits

Both search newest first. Post results include normalized post text, subreddit, engagement, author,
publication time, and source data. Comment results include normalized comment text, subreddit, and
source data.

The exact parameter defaults to true for both searches. SocialListeningAPI wraps the query in
double quotes when exact search is enabled. Set exact=false when you want the source search to
receive the phrase unchanged.

Step 1: Start with problem language

Searching a category name such as project management will return a large mix of discussions.
Search for language that reveals a task or decision.

For example:

recommend a project management tool
alternative to competitor name
competitor name too expensive
how do you track project delays
need a tool that exports project reports
Enter fullscreen mode Exit fullscreen mode

Keep each phrase separate. You want to know which query found the result.

Run the same phrase against posts and comments when the task needs both. Posts often contain the
main question. Comments may contain product comparisons and workarounds that never appear in the
title.

Step 2: Search Reddit with the API

Create a SocialListeningAPI account, activate it, and copy your API key. You'll get free 100 credits.
Send the key in the x-api-key header.

Search public posts:

curl --get 'https://api.sociallisteningapi.com/api/v1/reddit/search-posts' \
  --data-urlencode 'query=recommend a project management tool' \
  --data-urlencode 'exact=true' \
  --header 'x-api-key: YOUR_API_KEY'
Enter fullscreen mode Exit fullscreen mode

Search public comments:

curl --get 'https://api.sociallisteningapi.com/api/v1/reddit/search-comments' \
  --data-urlencode 'query=recommend a project management tool' \
  --data-urlencode 'exact=true' \
  --header 'x-api-key: YOUR_API_KEY'
Enter fullscreen mode Exit fullscreen mode

Successful responses return records under data.items. Failed requests do not use credits.

For a JavaScript workflow, keep the API key on your server:

const url = new URL(
  "https://api.sociallisteningapi.com/api/v1/reddit/search-posts",
);

url.searchParams.set("query", "recommend a project management tool");
url.searchParams.set("exact", "true");

const response = await fetch(url, {
  headers: {
    "x-api-key": process.env.SOCIALLISTENING_API_KEY,
  },
});

if (!response.ok) {
  throw new Error(`Reddit search failed with status ${response.status}`);
}

const result = await response.json();
console.log(result.data.items);
Enter fullscreen mode Exit fullscreen mode

Step 3: Keep the fields ChatGPT needs

Do not send only the post title to ChatGPT. That removes the context needed to make a useful call.

For each record, keep:

query
result type: post or comment
subreddit
title, when available
text
author
published_at
engagement, when available
source URL
Enter fullscreen mode Exit fullscreen mode

Also keep the query beside the result. A comment may match several searches, but the query explains
why it entered this run.

Step 4: Ask ChatGPT to reject weak matches

You can connect ChatGPT through the SocialListeningAPI MCP and
ask it to run the Reddit searches, or pass API results into your own ChatGPT workflow. In both
cases, use a prompt with an explicit reject path.

Review these public Reddit posts and comments for product research.

Keep a result only when the author describes one of these:
- a clear problem
- a current workaround
- a product recommendation request
- a comparison between named tools
- a missing capability

Reject jokes, copied news, job posts, vague mentions, and results where the keyword
has a different meaning.

For each kept result, return:
- subreddit
- post or comment
- the problem in the author's own terms
- product or workaround named
- why the result fits
- published date
- source URL

Separate direct statements from your inference. Do not draft a reply.
Enter fullscreen mode Exit fullscreen mode

Ask for the author's own terms because polished summaries can erase useful language. If five people
describe the same problem in five different ways, those phrases may be more valuable than a generic
label.

Step 5: Read the whole thread before using the finding

A comment can look clear when removed from its parent discussion and mean something else in the
thread. Before adding a result to a research report, check:

  1. The post date
  2. The subreddit and its purpose
  3. The parent post or comment
  4. Whether the author is speaking from experience
  5. Whether another comment corrects the claim
  6. Whether the linked product or policy has changed

Treat public opinions as opinions. A highly upvoted comment is still not proof that every customer
has the same problem.

If you decide to reply, read the subreddit rules and disclose your product connection when it is
relevant. Keep replies under human control. This workflow does not automate comments or direct
messages.

Step 6: Store URLs before running the search again

For a one-time research task, a ChatGPT conversation may be enough. A recurring workflow needs
external storage.

Save the result ID or source URL, query, subreddit, result type, published date, and first-seen time
in a database, n8n Data Table, or sheet. On the next run, exclude URLs already stored.

Scheduling and deduplication happen outside SocialListeningAPI. Use cron, n8n, Make, Zapier, or your
own worker when you need repeated searches.

Start weekly. Daily searches can produce nearly identical result sets for narrow phrases, which
uses credits and creates more review work without adding much information.

Step 7: Add a ChatGPT scheduled reminder

ChatGPT scheduled tasks can run in the background and return to the same chat on a schedule. I would
use this as a reminder before building a fully automatic workflow. It keeps the first few searches under human review and makes bad queries easier to spot.

Open the ChatGPT conversation that contains
your query list and ask:

Create a scheduled task in this chat.

Every Monday at 9:00 AM local time, run the weekly
Reddit product research check.

Include this checklist in the reminder:
1. Search Reddit posts and comments through SocialListeningAPI for:
   - recommend a project management tool
   - alternative to CompetitorName
   - CompetitorName too expensive
2. Check the saved-source-URL sheet before reviewing results.
3. Exclude links already seen.
4. Group new results into recommendation request, product problem,
   competitor comparison, feature request, unrelated, or unclear.
5. Keep the source URL beside every result.
6. Do not draft or publish Reddit replies.
Enter fullscreen mode Exit fullscreen mode

OpenAI's scheduled tasks guide says you can create and
manage tasks from ChatGPT on the web or desktop app when the feature is enabled. Open Scheduled to
check recent runs, pause the reminder, or change its timing. Test the prompt once in a normal chat
before scheduling it, then review the first few reminders.

The scheduled task handles the reminder. SocialListeningAPI performs each search when requested,
and your sheet or database stores old URLs. ChatGPT scheduled tasks can use connected tools available
to the chat, but I would keep the first version manual until the queries and rejection rules produce
a useful brief.

Output format

Keep the final report small and sourced:

Repeated problems
- Problem, number of distinct sources, representative URLs

Recommendation questions
- Requested outcome, tools already tried, source URL

Competitor comparisons
- Products compared, stated decision factor, source URL

Unclear or conflicting claims
- What is uncertain, source URLs

Queries that produced no useful results
- Query and reason it should be changed or removed
Enter fullscreen mode Exit fullscreen mode

The last section prevents a bad query from staying in the schedule forever.

Conclusion

Use the Reddit search API to collect current public posts and comments. Use ChatGPT to sort the
results. Keep the original source URL beside every finding, and read the thread before responding.

I hope this was helpful. If you're looking for a full social listening experience, try Mentionkit. SociallisteningAPI powers Mentionkit under the hood.

Top comments (0)