Skip to content

Quickstart

Read a Reddit post and its comments with one HTTPS request, as JSON or as Markdown for a model.

Updated

threadapi reads public Reddit for programs and AI agents. One request returns a post with its comment tree, as JSON or as one Markdown document, with a digest of what the thread agrees and argues about. There are also subreddit listings and search, a remote MCP server, and nothing to run on your side: no Reddit app, no OAuth with Reddit, no proxies.

  1. Get a key

    Sign in at threadapi.dev with Google, GitHub or an email code. New accounts get 100 free credits. Create a key under API keys; it starts with tapi_.

  2. Read a thread

    curl "https://api.threadapi.dev/v1/reddit/post?format=md&url=https://www.reddit.com/r/programming/comments/1x144ok/" \
      -H "Authorization: Bearer $THREADAPI_API_KEY"
    import os, requests
    
    r = requests.get(
        "https://api.threadapi.dev/v1/reddit/post",
        params={"url": "https://www.reddit.com/r/programming/comments/1x144ok/"},
        headers={"Authorization": f"Bearer {os.environ['THREADAPI_API_KEY']}"},
    )
    r.raise_for_status()
    thread = r.json()
    print(thread["post"]["title"], thread["meta"]["comments_returned"])
    const params = new URLSearchParams({
      url: "https://www.reddit.com/r/programming/comments/1x144ok/",
      format: "md",
    });
    const res = await fetch(`https://api.threadapi.dev/v1/reddit/post?${params}`, {
      headers: { Authorization: `Bearer ${process.env.THREADAPI_API_KEY}` },
    });
    console.log(await res.text());
  3. Check what it cost

    Every successful response has an X-Credits-Used header. A post with up to 500 comments costs 1 credit; max_comments defaults to 200. See pricing.

Endpoints

For language models

Type to search…

↑↓ navigate ↵ select Esc close