Skip to content
NewIntroducing lobstr.io API v2: Web Data for AI Agents
Stack Overflow APITry it

Try the Stack Overflow API

Pick an operation: its request in cURL, Python or Node, and its answer.

1Request
Words to search for, anywhere in a question (its title, its text, its tags), as Stack Overflow's own search reads them.
Tags the questions must have, all of them (python and asyncio: the questions tagged both), as Stack Overflow writes them (python, c++, asp.net-core).
The order of the questions: relevance, Stack Overflow's own search order; newest, the latest asked first; activity, the latest answered, commented or edited first; votes, the highest scored first among every question that matches, however loosely (with query, popular questions that only mention the words come first).
1 credit a call
Code, from the fields above
curl https://api.lobstr.io/v2/run \
  -H "Authorization: Bearer $LOBSTR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "source": "stackoverflow",
    "operation": "questions/search",
    "options": {
      "query": "httpx timeout",
      "tags": [
        "python"
      ],
      "has_accepted_answer": false,
      "is_closed": false,
      "is_migrated": false,
      "has_notice": false,
      "is_wiki": false,
      "sort": "votes"
    }
  }'
2Response

An example answer. Run it on your own input.

{
  "object": "run",
  "id": "run_5qinq6gxtyhrop2g242vebn6m4",
  "livemode": true,
  "source": "stackoverflow",
  "operation": "questions/search",
  "version": "1.0.1",
  "schema_url": "https://api.lobstr.io/v2/catalog/stackoverflow/questions/search",
  "options": {
    "query": "httpx timeout",
    "tags": [
      "python"
    ],
    "sort": "votes"
  },
  "fields": null,
  "status": "succeeded",
  "count": 1,
  "has_more": false,
  "next": null,
  "cost": {
    "credits": 1
  },
  "results": [
    {
      "object": "question",
      "position": 1,
      "id": 10000001,
      "ids": {
        "question_id": 10000001
      },
      "url": "https://stackoverflow.com/questions/10000001/how-do-i-set-a-timeout-on-an-httpx-request",
      "share_url": "https://stackoverflow.com/q/10000001",
      "title": "How do I set a timeout on an httpx request?",
      "tags": [
        "python",
        "httpx"
      ],
      "body_html": "<p>My request hangs forever when the server does not answer. How do I set a timeout?</p>\n",
      "body_markdown": "My request hangs forever when the server does not answer. How do I set a timeout?",
      "score": 42,
      "upvote_count": 43,
      "downvote_count": 1,
      "favorite_count": 0,
      "view_count": 51200,
      "answer_count": 1,
      "comment_count": 1,
      "is_answered": true,
      "accepted_answer_id": 10000002,
      "close_vote_count": 0,
      "reopen_vote_count": 0,
      "delete_vote_count": 0,
      "created_at": "2024-03-14T09:26:53Z",
      "last_activity_at": "2025-06-02T17:40:11Z",
      "last_edited_at": "2024-03-14T10:02:31Z",
      "owner": {
        "id": 1000001,
        "account_id": 2000001,
        "name": "Jane Doe",
        "url": "https://stackoverflow.com/users/1000001/jane-doe",
        "avatar_url": "https://www.gravatar.com/avatar/00000000000000000000000000000000?s=256&d=identicon&r=PG",
        "type": "registered",
        "reputation": 1234,
        "accept_rate": 80,
        "badges": {
          "gold": 0,
          "silver": 5,
          "bronze": 12
        }
      },
      "last_editor": null,
      "closed": null,
      "locked_at": null,
      "protected_at": null,
      "community_owned_at": null,
      "bounty": null,
      "notice": null,
      "migrated_from": null,
      "migrated_to": null,
      "content_license": null,
      "answers": [
        {
          "id": 10000002,
          "url": "https://stackoverflow.com/questions/10000001/how-do-i-set-a-timeout-on-an-httpx-request/10000002#10000002",
          "share_url": "https://stackoverflow.com/a/10000002",
          "body_html": "<p>Pass <code>timeout=10.0</code> to the client.</p>\n",
          "body_markdown": "Pass `timeout=10.0` to the client.",
          "score": 57,
          "upvote_count": 57,
          "downvote_count": 0,
          "is_accepted": true,
          "created_at": "2024-03-14T09:41:07Z",
          "last_activity_at": "2024-03-14T09:41:07Z",
          "last_edited_at": null,
          "locked_at": null,
          "community_owned_at": null,
          "owner": {
            "id": 1000003,
            "account_id": 2000003,
            "name": "John Smith",
            "url": "https://stackoverflow.com/users/1000003/john-smith",
            "avatar_url": null,
            "type": "registered",
            "reputation": 48210,
            "accept_rate": null,
            "badges": {
              "gold": 12,
              "silver": 80,
              "bronze": 120
            }
          },
          "last_editor": null,
          "bounty_awarded": null,
          "recommended_by": [],
          "posted_by_collectives": [],
          "content_license": "CC BY-SA 4.0",
          "comment_count": 0,
          "comments": []
        }
      ],
      "comments": [
        {
          "id": 130000001,
          "url": "https://stackoverflow.com/questions/10000001/how-do-i-set-a-timeout-on-an-httpx-request#comment130000001_10000001",
          "body_html": "Which version of httpx do you use?",
          "body_markdown": "Which version of httpx do you use?",
          "score": 2,
          "is_edited": false,
          "created_at": "2024-03-14T09:30:12Z",
          "owner": null,
          "reply_to_user": null,
          "content_license": "CC BY-SA 4.0"
        }
      ],
      "source_url": "https://api.stackexchange.com/2.3/search/advanced?site=stackoverflow&page=1&pagesize=100&order=desc&sort=votes&q=httpx%20timeout&tagged=python&filter=tvdphAWpCmQIKKbhPRIUXwhmqHNHrzzUDek3PwM4rHR",
      "observed_at": "2026-12-02T12:00:00Z"
    }
  ]
}

Stack Overflow API operations

2 operations, one key, the same envelope: results, count, cost and next for the following page.

Get a question

1 credita call

One Stack Overflow question, whole: its text, every answer and every comment, the votes, views, tags, authors, and why it is closed when it is.

OptionTakesWhat it is
question*stringThe question: its id (11227809), its page (https://stackoverflow.com/questions/11227809/...), its short link (https://stackoverflow.com/q/11227809), or the link of one of its answers (https://stackoverflow.com/a/11227902, whose question is found first).

Use the Stack Overflow API in your agent

One key, then your agent or your code calls every operation of this page.

  1. 01

    Connect lobstr.io

    Add the lobstr.io MCP server to Claude, ChatGPT, Cursor or any MCP client, or take an API key for your code.

    Claude
    ChatGPT
    Cursor
  2. 02

    Ask, or call

    Tell your agent what you need from Stack Overflow: it finds the operations that fit and runs them. From your code, it is one POST to /v2/run.

    Find the Python questions on httpx timeouts with an accepted answer, and tell me which fix the most voted answers agree on.

    Search questions
    Get a question
  3. 03

    Pay per call

    1 credit a call that returns data, from your plan’s credits. The free plan gives 100 credits a month.

    100 questions 1
    Empty pageFree
    Failed callFree

Why lobstr.io

What you get when your agent or your code calls Stack Overflow through lobstr.io.

01

One key, every source

No app to register, no daily quota, no filter to build. One lobstr.io key reaches Stack Overflow and 20 other sources, from Google Maps to LinkedIn Sales Navigator, on the same credits.

02

Built for agents

Five MCP tools, nothing to learn: your agent finds the operation, reads what it takes and gives, runs it and follows next. Your code gets the same through the SDKs or plain HTTP.

lobstr.ioConnected
find_operations
get_operation
run_operation
get_balance
send_feedback
03

Measured in public

Every call of the last 90 days counts in the figures on this page, and a failed call is free. Each operation is also run every hour by our own checks.

Last 30 days

lobstr.io or the Stack Exchange API

What Stack Exchange’s own API gives, and what lobstr.io gives, for the same questions.

Stack Exchange APIlobstr.io
Calls a day300 per IP without a key; 10,000 with the key of an app registered on Stack AppsAs many as your credits hold: 1 credit a call, $0.50 to $2 per 1,000 calls
A questionFields such as its text left out by default, asked for with a custom filterWhole in the same call: its text in HTML and Markdown, every answer and every comment, their votes, authors and licence
For agentsAn MCP server, 100 calls a day per Stack Overflow accountThe lobstr.io MCP server, on the same key and credits as every other source
To startAn app registered on Stack Apps, for its keyAn API key, with 100 free credits a month

From Stack Exchange’s API documentation, 3 December 2026.

What it costs

Set what you need from each operation in a month: the credits add up, and the plan that holds them is the price.

Every plan
Search questions1,00010 credits
Get a question100100 credits

1 credit a call: 100 questions.

A month

$20

110 credits a month: Starter holds 10,000.

Live

Stack Overflow API reliability

Every call counts; a day is green at 95% successful.

Successful calls
100.00%
Median call
2.2 s
90 days agoToday
95% or more (SLA)90 to 95%75 to 90%Under 75%

A call fails when the site does not answer or we cannot read its answer; a wrong input is not counted.

Stack Overflow API FAQ

What people ask before calling the Stack Overflow API.

Questions and answers

Is there an official Stack Overflow API?

Yes: the Stack Exchange API, 300 calls a day per IP without a key and 10,000 with the key of an app registered on Stack Apps; a question’s text comes with a custom filter. Stack Overflow also has an MCP server, 100 calls a day per account. lobstr.io gives each question whole, with every answer and every comment, at one price a call.

Do I get the answers with the question?

Yes, in the same call. stackoverflow/questions/search and stackoverflow/questions/get give each question whole: its text in HTML and Markdown, every answer (the accepted one says so) and every comment of both, with their scores, dates, authors and licence. No other call is needed.

How many questions can a search return?

100 a page, up to 25 pages: 2,500 questions. To go further, split the search by dates with createdafter and createdbefore.

What can I search by?

Words, tags (every tag given), words of the title or the text, an author, a link a question holds, dates, how many answers or views it has, and whether it is answered, closed, migrated or community wiki. Sort by relevance, newest, latest activity or votes.

Using the API

Do I need a Stack Apps key?

No. A lobstr.io API key is all it takes, with no app to register, and the free plan gives 100 credits a month.

What does a call cost?

1 credit a call, a page of up to 100 questions or one question, each whole: 1,000 calls cost $0.50 to $2 depending on the plan. An empty page, a question gone and a failed call are free.

Can my AI agent use it?

Yes. Add the lobstr.io MCP server to Claude, ChatGPT, Cursor or any MCP client: the agent finds the operation, runs it and follows next by itself. Setup for each agent.

Is there an SDK?

Yes: lobstrio, on PyPI and npm, with a typed method for each operation (client.stackoverflow.questions.search in Python) and a loop over every page. The SDKs.

Can I combine Stack Overflow with other sources?

Yes, on the same key and the same credits. Find the YouTube tutorials on the same subject and read their transcripts, then the news and what developers post on X. An agent chains them by itself.

How reliable is the Stack Overflow API on lobstr.io?

Every call of the last 90 days is drawn on this page, day by day, and a failed call is free. Each operation is also run every hour by our own checks, so a change on Stack Overflow shows within the hour.

Ready to call it?

An API key in a minute, then the call above, from your code or your agent.