Back to use cases

    Use case / SOCIAL DATA / Python 3 (optional; the main path is a saved prompt with no code) / Published

    Reddit Search with No Code: See What Reddit Says About Any Topic

    Run Reddit search through Desearch MCP with a saved prompt. Get thread links and a short summary with numbered citations for each topic you choose.

    Card for Reddit Search with No Code: See What Reddit Says About Any Topic

    This Reddit search is for marketers and founders who want to know what people on Reddit think about a topic: the advice they give, the questions they keep asking and what annoys them. Paste one saved prompt into an MCP-compatible assistant with the Desearch MCP server connected, and you get Reddit thread links on your topic plus a short summary with numbered links back to the threads. No code and no scrolling for an hour. There is also a live demo that lists up to 10 public Reddit threads for a topic with one Desearch web search limited to reddit.com. It shows links only, with no summary and no AI-written text.

    The problem

    Reddit is full of honest opinions, but finding the right threads takes time. You search, open a dozen tabs, skim long comment chains and try to remember who said what. By the end you have a feeling, not a list you can share with your team. You want the useful threads and the main opinions in one place, with links so anyone can check the source.

    What the app does

    • Takes a topic or a question in plain words.
    • Searches Reddit with the Desearch ai-search tool, with Reddit as the only source.
    • Returns Reddit thread links with their titles (10 in the measured run).
    • Adds a short summary of what the threads say, with numbered links back to them.
    • With the saved prompt, your assistant also lists the 3 most common questions and the 3 most common complaints.
    • In the live demo, type a topic to get up to 10 public Reddit threads with the subreddit, thread title and link, from one Desearch web search limited to reddit.com. It has no summary. Dates and poster names are not shown.

    How it works

    1. Connect once. Add the hosted Desearch MCP server (https://mcp.desearch.ai/mcp) to an MCP-compatible assistant, with your Desearch API key in the Authorization header.
    2. Search Reddit. The saved prompt calls the ai-search tool with tools: ["reddit"] and result_type: "LINKS_WITH_FINAL_SUMMARY" for your topic.
    3. Read the result. Your assistant turns the threads into a table (title, what the thread is about, the main opinion, the link) and lists the common questions and complaints. It does not name individual posters.

    The live demo first checks the topic: plain words, up to 200 characters. A server function then calls GET /web with site:reddit.com plus your topic. It keeps only Reddit thread links, removes duplicates and keeps up to 10. When a title comes back as a generic Reddit page title, the demo rebuilds it from the link. The API key stays on the server.

    The code

    The GET /web call sends the key in the Authorization header, in redditsearch/client.py:

    PYTHON
        def search(self, query):
            params = urllib.parse.urlencode({'query': query, 'start': 0})
            request = urllib.request.Request('https://api.desearch.ai/web?' + params,
                headers={'Authorization': self.key, 'User-Agent': 'desearch-py-examples/reddit-search-demo'}, method='GET')

    The query is site:reddit.com plus the topic, in redditsearch/threads.py:

    PYTHON
    def build_query(topic):
        return 'site:reddit.com ' + topic

    The key is read from DESEARCH_API_KEY on the server, in redditsearch/service.py:

    PYTHON
                client = self._client or Client(os.getenv('DESEARCH_API_KEY', '').strip())

    The folder layout:

    • redditsearch/client.py: the Desearch web search call.
    • redditsearch/threads.py: the query and Reddit thread links.
    • redditsearch/service.py: input checks, the cache, limits and the JSON response.
    • redditsearch/guards.py and redditsearch/state.py: limits, the daily cap and the cache, in memory locally or in shared state when hosted.
    • api/search.py: the hosted handler for /api/search.
    • app.py: a local server for the page and the API.
    • public/: the search page and a saved sample.
    • tests/: offline tests.

    The no-code saved prompt and the MCP script are in the sibling folder reddit-search-mcp. The no-code MCP ai-search path is still available.

    View the code

    Endpoints

    • GET /web
    • MCP tool ai-search (tools: reddit)

    Example output

    Saved sample from a search on 2026-10-16 for "What do people recommend for keeping houseplants alive in winter?". This page shows that stored request and response.

    Sample request

    The saved prompt calls ai-search with Reddit as the only source:

    JSON
    {
      "prompt": "What do people recommend for keeping houseplants alive in winter?",
      "tools": ["reddit"],
      "result_type": "LINKS_WITH_FINAL_SUMMARY"
    }

    Sample response

    What came backResult
    Reddit thread links10, each one on the topic
    Summarya short summary with numbered links to the threads
    Time12.6 seconds
    Cost$0.004

    Two of the thread titles, as Desearch returned them:

    • "r/houseplants on Reddit: How does anyone keep their plants alive in the winter?!?"
    • "r/IndoorPlants on Reddit: How to keep plants alive in winter"

    The advice in the summary: keep plants away from cold windows and drafts, add a grow light for the darker months, keep a steady watering routine so you neither overwater nor underwater, and raise the humidity for tropical plants.

    The live demo shows a labelled saved sample from a search on 2026-10-26 while live calls are paused.

    Run it yourself

    No code: connect the Desearch MCP server in an MCP-compatible assistant, paste saved-prompt.md, and put your topic in it.

    Script: clone desearch-py-examples and open reddit-search-mcp. Set up the environment:

    BASH
    python -m venv .venv && . .venv/bin/activate
    pip install -r requirements.txt
    export DESEARCH_API_KEY=...   # from console.desearch.ai

    Then search a topic:

    BASH
    python reddit_search.py "What do people recommend for keeping houseplants alive in winter?"

    Useful flags: --links-only (thread links without the summary) and --raw out.json (save the full response to a file).

    Live demo, locally: clone desearch-py-examples and open reddit-search-demo. Then run:

    BASH
    python3 -m pip install -r requirements.txt
    DEMO_STATE=memory DEMO_LIVE=0 python3 app.py

    Open http://127.0.0.1:8000. Live mode needs the server key in DESEARCH_API_KEY and DEMO_LIVE=1.

    What it costs

    The live demo makes one GET /web call per new topic, at $0.001 measured 2026-10-26. Repeat topics are served from a 15-minute cache at no cost.

    One Reddit search with a summary cost $0.004 for 10 threads (cost field in the response, measured 2026-10-16). See pricing.

    Try it

    Open the live Reddit search. Type a topic to get up to 10 public Reddit threads with the subreddit, title and link. Each network gets 5 searches per 10 minutes and 15 per day. Repeat topics are served from a cache at no extra cost.

    Ideas to extend it

    • Run the same topic once a month and compare the common questions and complaints.
    • Search for your product category and turn the top complaints into an FAQ or a landing page section.
    • Pair it with an X search on the same topic to see how the two communities talk about it.

    Use with AI agents

    Point an MCP client at the hosted Desearch server. Replace the placeholder with a key from the console. Do not commit the key.

    JSON
    {
      "mcpServers": {
        "desearch": {
          "url": "https://mcp.desearch.ai/mcp",
          "headers": {
            "Authorization": "Bearer <key>"
          }
        }
      }
    }

    Prompt you can paste for this example:

    Use the Desearch ai-search tool with tools set to reddit and result_type LINKS_WITH_FINAL_SUMMARY for the topic I name. Return a table of up to 10 threads with the title, what the thread is about in one line, the main opinion, and the link. If a title comes back as Welcome to Reddit, write the topic from the link instead. List the 3 most common questions and the 3 most common complaints. Say plainly if fewer than 10 relevant threads came back, and mark any thread that is off-topic. Do not name individual posters.

    Build your own example.

    Give your agents access to web and social search. Get an API key to start building, or talk to us about your integration.

    Read docs