# Stack Overflow API

> Search Stack Overflow’s questions by words, tags, author, dates or state, or get one by its link, each whole with every answer and every comment. JSON with the same fields every time, from your code or your agent.

2 operations, 1 credit a call, one API key. The page for people: https://www.lobstr.io/store/stackoverflow

## Operations

### Search questions: `stackoverflow/questions/search`

One page of a Stack Overflow search, up to 100 questions, each whole: its text, every answer and every comment, the votes, views, tags, authors, and why it is closed when it is.

1 credit a call, 100 questions a page. Its page: https://www.lobstr.io/store/stackoverflow/questions/search. Every option, field and error: https://api.lobstr.io/v2/catalog/stackoverflow/questions/search.md

| Option | Takes | Default | What it is |
| --- | --- | --- | --- |
| `query` | string |  | Words to search for, anywhere in a question (its title, its text, its tags), as Stack Overflow's own search reads them. |
| `tags` | array |  | 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). |
| `excluded_tags` | array |  | Tags the questions must not have, none of them. |
| `title` | string |  | Words the question's title must hold, whole, side by side and in this order: connection pool finds "Connection pool is full", not "Pool of connections"; timeout does not find "ReadTimeout". |
| `body` | string |  | Words the question's text must hold, whole, side by side and in this order (read timeout, not timeout read). |
| `user` | integer |  | The questions of one author: their user id on Stack Overflow (22656), or the address of their profile (https://stackoverflow.com/users/22656/...). |
| `mentions_url` | string |  | A link that the question or one of its answers holds; * stands for any part of it (https://github.com/encode/httpx*). |
| `has_accepted_answer` | boolean |  | True for the questions with an accepted answer only, false for those without. |
| `is_closed` | boolean |  | True for the closed questions only (duplicates, off-topic...), false for the open ones. |
| `is_migrated` | boolean |  | True for the questions moved from Stack Overflow to another Stack Exchange site only, false for the others. |
| `has_notice` | boolean |  | True for the questions with a moderator's notice only (a lock, a call for better answers...), false for the others. |
| `is_wiki` | boolean |  | True for the community wiki questions only, false for the others. |
| `answers_min` | integer |  | The questions with at least this many answers. |
| `views_min` | integer |  | The questions viewed at least this many times. |
| `created_after` | string |  | The questions asked from this date on (2024-01-31, from its midnight UTC) or from this instant (2024-01-31T12:00:00Z). |
| `created_before` | string |  | The questions asked before this date (before its midnight UTC: 2025-02-01 keeps January 31 whole) or this instant. |
| `sort` | relevance, newest, activity, votes | `relevance` | 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). |
| `order` | desc, asc | `desc` | The sort's direction, desc as each sort says or asc to reverse it (the oldest first, the lowest scored first). |

### Get a question: `stackoverflow/questions/get`

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.

1 credit a call. Its page: https://www.lobstr.io/store/stackoverflow/questions/get. Every option, field and error: https://api.lobstr.io/v2/catalog/stackoverflow/questions/get.md

| Option | Takes | Default | What it is |
| --- | --- | --- | --- |
| `question` (required) | string |  | The 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). |

## Call it

From code, one endpoint for every operation:

```bash
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"],"sort":"votes"}}'
```

The answer holds `results` (the records), `count`, `cost.credits` and `next`: the whole call for the following page, to send as it is; null on the last page. SDKs: `pip install lobstrio`, `npm install lobstrio` (https://docs.lobstr.io/sdks).

From an AI agent: the MCP server https://api.lobstr.io/v2/mcp with your API key, in Claude, ChatGPT, Cursor or any MCP client. Its tools: find_operations, get_operation, run_operation, get_balance, send_feedback. Setup for each agent: https://docs.lobstr.io/agents

The API key is in the dashboard, under API: https://app.lobstr.io/dashboard/api. No account yet? An agent can get one for the person it works for: https://www.lobstr.io/auth.md

## Why lobstr.io

- **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.
- **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.
- **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.

## lobstr.io or the Stack Exchange API

| | Stack Exchange API | lobstr.io |
| --- | --- | --- |
| Calls a day | 300 per IP without a key; 10,000 with the key of an app registered on Stack Apps | As many as your credits hold: 1 credit a call, $0.50 to $2 per 1,000 calls |
| A question | Fields such as its text left out by default, asked for with a custom filter | Whole in the same call: its text in HTML and Markdown, every answer and every comment, their votes, authors and licence |
| For agents | An MCP server, 100 calls a day per Stack Overflow account | The lobstr.io MCP server, on the same key and credits as every other source |
| To start | An app registered on Stack Apps, for its key | An API key, with 100 free credits a month |

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

## Price

1 credit a call, whatever the page holds; an empty page and a failed call are free. The plans:

- Free: $0 a month, 100 credits a month
- Starter: $20 a month, 10,000 credits a month
- Pro: $100 a month, 100,000 credits a month
- Team: $500 a month, 1,000,000 credits a month

Every plan compared: https://www.lobstr.io/pricing.md

## Stack Overflow API reliability

Every call of the last 90 days, from our users and from our own checks. Each operation is also run every hour by our own checks. A failed call is free.

| Operation | Calls | Successful | Median call |
| --- | --- | --- | --- |
| `stackoverflow/questions/search` | 42 | 100.00% | 2.7 s |
| `stackoverflow/questions/get` | 39 | 100.00% | 2.1 s |

## Stack Overflow API FAQ

### 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 created_after and created_before.

### 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.

### 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](https://docs.lobstr.io/agents).

### 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](https://docs.lobstr.io/sdks).

### Can I combine Stack Overflow with other sources?

Yes, on the same key and the same credits. Find the [YouTube](https://www.lobstr.io/store/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.

## Related sources

- [YouTube: Search videos](https://www.lobstr.io/store/youtube.md): The tutorials on the same subject, each with its channel, views, duration and chapters. 1 credit a call.
- [YouTube: Get a video's transcript](https://www.lobstr.io/store/youtube.md): What a tutorial says, line by line with when each is said, and its whole text. 1 credit a call.
- [Google News: Search articles](https://www.lobstr.io/store/google_news.md): The news on the same subject, up to 100 articles as Google ranks them, each with its publisher’s link. 1 credit a call.
- [X (Twitter): Search tweets](https://www.lobstr.io/store/x.md): What developers post on X about it, each tweet with its counts, media and author, with your X account. 20 credits a call.
