What developers are actually stuck on, as data
The Stack Overflow API returns Q&A data — questions, answers, users and tags — as clean JSON.
87 active endpoints, on 0, 1 and 2 credit tiers.
- POST/stackoverflow/v1/questions
- POST/stackoverflow/v1/question
- POST/stackoverflow/v1/answers
- POST/stackoverflow/v1/user
- POST/stackoverflow/v1/user_questions
- POST/stackoverflow/v1/user_answers
- POST/stackoverflow/v1/user_tags
- +80 more
What Stack Overflow endpoints does ReefAPI ship?
87 live read endpoints. Read-only data API: no writes, no account actions, no dashboard access on the target site.
Stack Overflow API
3 of 87 endpoints, ready to run
Questions matching a query with their tags, view counts, scores, answer state and the asker's profile — and the body when you ask for it.
{ "ok": true, "meta": { "api": "stackoverflow", "endpoint": "search", "mode": "live", "latency_ms": 699.8, "record_count": 100, "cache_hit": false }, "data": { "items": [ { "tags": [ "python", "python-3.x", "asynchronous" ], "is_answered": true, "view_count": 441483, "accepted_answer_id": 53420574, "answer_count": 10, "score": 303, "last_activity_date": 1741159243, "creation_date": 1528450083, "last_edit_date": 1607151686, "question_id": 50757497, "content_license": "CC BY-SA 4.0", "link": "https://stackoverflow.com/questions/50757497/simplest-async-await-example-possible-in-python", "title": "Simplest async/await example possible in Python", "body": "<p>I've read many examples, blog posts, questions/answers about <code>asyncio</code> / <code>async</code> / <code>await</code> in Python 3.5+, many were complex, the simplest I found was probably <a href=\"https://stackoverflow.com/a/37345564/1422096\">this one</a>.<br />\nStill it uses <code>ensure_future</code>, and for learning purposes about asynchronous programming in Python, I would like to see an even more minimal example, and what are the <em>minimal tools necessary</em> to do a basic async / await example.</p>\n<p>Question: is it possible to give a <strong>simple example showing how <code>async</code> / <code>await</code> works</strong>, by using only these two keywords + code to run the async loop + other Python code but no other <code>asyncio</code> functions?</p>\n<p>Example: something like this:</p>\n<pre><code>import asyncio\n\nasync def async_foo():\n print("async_foo started")\n await asyncio.sleep(5)\n print("async_foo done")\n\nasync def main():\n asyncio.ensure_future(async_foo()) # fire and forget async_foo()\n print('Do some actions 1')\n await asyncio.sleep(5)\n print('Do some actions 2')\n\nloop = asyncio.get_event_loop()\nloop.run_until_complete(main())\n</code></pre>\n<p>but without <code>ensure_future</code>, and still demonstrates how await / async works.</p>\n", "id": 50757497, "type": "question" }, { "tags": [ "python", "python-3.5", "python-asyncio" ], "is_answered": true, "view_count": 120239, "accepted_answer_id": 37345564, "answer_count": 6, "score": 212, "last_activity_date": 1769052974, "creation_date": 1463494380, "last_edit_date": 1463745276, "question_id": 37278647, "content_license": "CC BY-SA 3.0", "link": "https://stackoverflow.com/questions/37278647/fire-and-forget-python-async-await", "title": ""Fire and forget" python async/await", "body": "<p>Sometimes there is some non-critical asynchronous operation that needs to happen but I don't want to wait for it to complete. In Tornado's coroutine implementation you can \"fire & forget\" an asynchronous function by simply ommitting the <code>yield</code> key-word.</p>\n\n<p>I've been trying to figure out how to \"fire & forget\" with the new <code>async</code>/<code>await</code> syntax released in Python 3.5. E.g., a simplified code snippet:</p>\n\n<pre class=\"lang-python prettyprint-override\"><code>async def async_foo():\n print(\"Do some stuff asynchronously here...\")\n\ndef bar():\n async_foo() # fire and forget \"async_foo()\"\n\nbar()\n</code></pre>\n\n<p>What happens though is that <code>bar()</code> never executes and instead we get a runtime warning:</p>\n\n<pre class=\"lang-python prettyprint-override\"><code>RuntimeWarning: coroutine 'async_foo' was never awaited\n async_foo() # fire and forget \"async_foo()\"\n</code></pre>\n", "id": 37278647, "type": "question" }, { "tags": [ "c#", "python", "asynchronous" ], "is_answered": true, "view_count": 862, "closed_date": 1503952105, "answer_count": 1, "score": 5, "last_activity_date": 1503941206, "creation_date": 1503920149, "last_edit_date": 1503941206, "question_id": 45918049, "link": "https://stackoverflow.com/questions/45918049/are-the-async-await-keywords-in-python-3-5-inspired-by-async-await-in-c", "closed_reason": "Opinion-based", "title": "Are the async/await keywords in python 3.5 inspired by async/await in C#?", "body": "<p><code>async</code>/<code>await</code> (syntax and keywords) in python 3.5 is very similar to <code>async</code>/<code>await</code> in C#.</p>\n\n<p>C# example:</p>\n\n<pre><code>async void asyncTask(){\n await asyncMethod()\n}\n</code></pre>\n\n<p>Python example:</p>\n\n<pre><code>async def asyncTask(): \n await async_method()\n</code></pre>\n\n<p><strong>Question</strong>: is the async/await in python 3.5 inspired by async/await in C#? If yes, why?</p>\n", "id": 45918049, "type": "question" } ], "site": "stackoverflow", "attribution": "Stack Exchange API; content license CC BY-SA, preserve item link and author attribution." } }
How the Stack Overflow API works
Stack Overflow is a normal ReefAPI surface — the same four rules that hold for every other engine on the key.
No OAuth app, no request signing, no per-site account. One key covers all 184 engines.
Every route is a POST with a JSON body. Parameters are validated against the published schema before anything is charged.
Credits, not seats. Failed and blocked calls are never charged, and cache hits cost nothing.
One envelope everywhere. meta carries latency_ms, record_count and the endpoint that answered.
Finding out what people get wrong about your library
Support tickets tell you what your customers ask you. Stack Overflow tells you what everyone else could not work out and never asked.
{"q": "your-library timeout", "filter": "withbody"}The withbody filter returns the question text, not just the title — which is where the actual confusion is visible.
{"tag": "your-library", "sort": "votes"}The tag's highest-voted questions are your documentation backlog, ranked by how many people had the problem.
A hundred results came back in about a second, each with view count, score and answered state — the three fields that turn a list of questions into a priority order.
curl -X POST https://api.reefapi.com/stackoverflow/v1/search \
-H "x-api-key: $REEF_KEY" \
-H "content-type: application/json" \
-d '{"q":"async await"}'{
"ok": true,
"data": { … },
"meta": {
"api": "stackoverflow",
"endpoint": "search",
"mode": "live",
"latency_ms": …,
"record_count": …
},
"error": null
}Fields that read like one thing and mean another
The schema is Stack Exchange's own, which means several fields have names that invite the wrong assumption: two unrelated popularity numbers, a close reason written for humans rather than machines, and titles that arrive still HTML-escaped. Every value below is from live calls against stackoverflow, serverfault, askubuntu and math.
| Field | What it actually is | Measured example |
|---|---|---|
| creation_date, last_activity_date, closed_date | Unix seconds in UTC, never a string | 1340805096 on question 11227809 |
| score vs view_count | Net votes vs page views; unrelated scales | Question 11227809: score 27546, view_count 1997358 |
| accepted_answer_id | The answer id, or null if nothing is accepted | 11227902 on question 11227809 |
| is_accepted | Present on answer items only | true on answer 11227902, whose score 35296 exceeds the question's |
| body | Rendered HTML, not Markdown | "<pre class=\"lang-cpp prettyprint-override\"><code>..." |
| title | HTML-entity escaped | "What does the "yield" keyword do in Python?" |
| closed_reason | A human-readable phrase, not a code | "exact duplicate" on question 1725517 |
| tags | Flat array of lowercase strings | ["java", "c++", "performance"] |
| site | A Stack Exchange slug, not a hostname | stackoverflow, serverfault, askubuntu, math |
| pagesize | Clamped to 100, never rejected | pagesize=500 returned 100 records |
Every response carries an `attribution` string reading "Stack Exchange API; content license CC BY-SA, preserve item link and author attribution." Each item also carries its own content_license: CC BY-SA 4.0 on recent posts and CC BY-SA 3.0 on older ones, both seen in measured responses. If you republish any of this, keep the item's link and author with it.
How wide the coverage is, and the one thing to read carefully
Measured on search and browse endpoints. The licence row is not a formality.
The site parameter reaches every Stack Exchange site, so Server Fault, Super User, Ask Ubuntu and the rest are the same call with one field changed. For a tool with a systems or database audience that is frequently where the real questions are.
View count, score, answer count and whether an accepted answer exists are all on the search row. A question with a quarter of a million views and no accepted answer is a documentation gap you can act on, and it is identifiable without opening anything.
The default response is metadata; asking for the body filter adds the text. That is the right default for scanning, and the flag is there for the pass where you actually want to read what people wrote.
Every response carries the licence and attribution string. Stack Exchange content is Creative Commons with a share-alike requirement — displaying it in a product means displaying the attribution, and having it in the payload is what makes that easy to do rather than easy to forget.
Beyond questions and answers there are user profiles, reputation history, badges, per-user questions and answers, tag statistics and activity feeds. It is the network's read surface rather than a search box.
What people build with Stack Overflow
The jobs this data is most often used for.
endpoints
credits per call
Community-analytics tools call questions and tags to track activity and trends in a technology.
Developer-research products use search and answers to mine solutions for a knowledge base.
Talent tools use user, user_answers and user_badges to gauge a developer's reputation and expertise.
What Stack Overflow data costs
The cheapest call here is 0 credits, so $15/mo (Pro) buys 10,000 of them — $1.50 per 1,000 credits. Credits roll over and never expire, and failed or blocked calls are not charged.
Full pricing →- 1,000 free credits on signup, no card
- One key, all 184 APIs, one credit pool
- Failed and blocked calls are never charged
- Credits roll over and never expire
Call it in two lines
Sign up, get 1,000 credits and one key that works on every engine. Then this is the whole protocol.
curl -X POST https://api.reefapi.com/stackoverflow/v1/search \
-H "x-api-key: $REEF_KEY" \
-H "content-type: application/json" \
-d '{"q":"async await"}'import requests
r = requests.post(
"https://api.reefapi.com/stackoverflow/v1/search",
headers={"x-api-key": REEF_KEY},
json={
"q": "async await"
},
)
print(r.json()["data"])Have a question? We got answers.
The questions people actually ask before wiring up Stack Overflow.
Get a free key →Is this scraping the site or calling the official API?▾
The official one. Every response passes through quota_remaining, which read 299 on measured calls. That is Stack Exchange's own per-day request budget, and it means you get fields a page scrape could not give you, such as content_license, account_id and accept_rate.
Are post bodies Markdown or HTML?▾
HTML, as rendered on the site. A measured fetch of question 11227809 returned a body starting "<p>In this C++ code, sorting the data..." with the code inside <pre class="lang-cpp prettyprint-override"><code> blocks. There is no Markdown variant. The body appears at all only because the default filter is `withbody`; without it you get metadata and no prose.
Why are titles full of " and '?▾
Because Stack Exchange returns titles HTML-escaped and this API does not silently unescape them. Measured titles include "What does the "yield" keyword do in Python?" and "What's your most controversial programming opinion?". Run titles through an HTML entity decoder before display or your users will see the entities. Bodies need no such step because they are already HTML and render correctly as-is.
Why does every item have both owner and author, and both question_id and id?▾
The upstream fields are preserved and normalized aliases are added beside them, so nothing is lost and consumers can use one consistent shape. `owner` is Stack Exchange's original object; `author` mirrors it with the useful subset of user_id, display_name, link, reputation, user_type and profile_image. Likewise `id` and `type` sit next to question_id or answer_id, with type reading "question" or "answer" so you can tell which kind of row you have. Pick one convention and stay on it.
How do I tell whether a question is closed or a duplicate?▾
Read closed_date and closed_reason together; both are null on open questions. A measured search hit, question 1725517, returned closed_date 1360584615 with closed_reason "exact duplicate", while its neighbors in the same result set returned null for both. closed_reason is a phrase written for people rather than an enum, so match on it loosely if you branch on it at all.
Can I query sites other than Stack Overflow?▾
Yes, through the `site` parameter, using the Stack Exchange slug rather than the hostname. Verified live: serverfault, askubuntu and math all returned questions, with math's item links pointing at math.stackexchange.com. An unknown slug is rejected cleanly instead of silently falling back to Stack Overflow - site="notasite" returned INVALID_PARAM with "No site found for name `notasite`" and detail.stackexchange_error_name "bad_parameter".
I asked for 200 results per page and got 100. Why no error?▾
pagesize is clamped rather than rejected: a measured request with pagesize=500 returned exactly 100 records and reported meta.pagesize 100. Page forward instead, using meta.has_more and meta.next_page, both returned on questions, search, answers and the user list actions. Every page you request draws against the same quota_remaining budget.
Why does the question action's meta use prefixed keys?▾
Because that action returns two paginated things in one response and each needs its own cursor. A measured call on question 11227809 returned question_has_more, question_page, question_pagesize and question_quota_remaining for the question itself, plus answers_has_more, answers_page, answers_pagesize, answers_quota_remaining and answers_next_page for the answer list. Page the answers with the answers_* keys; the question_* set will not move.
Should I stick with the default filter?▾
Yes, unless you have a filter id you have verified against this endpoint. The default is `withbody`, which returns the standard field set plus rendered bodies - a measured question came back with 19 fields. An arbitrary Stack Exchange filter id did not degrade gracefully in testing: one returned ok:false with an empty object rather than a reduced field set. Ask for withbody and drop the fields you do not need on your own side.
What is the Stack Overflow API?▾
Stack Overflow API is a ReefAPI endpoint group for stack overflow It returns live JSON through POST requests under /stackoverflow/v1.
Is the Stack Overflow API free to try?▾
Yes. ReefAPI starts with 1,000 free credits, no card required. Stack Overflow calls use the same shared credit balance as every other ReefAPI engine.
Do I need a Stack Overflow login or account?▾
No login to Stack Overflow is needed for the API response. You call ReefAPI with your x-api-key header, and the playground can run live examples before you create a production key.
How fresh is the Stack Overflow data?▾
The page example is captured from a live questions call, and production requests fetch live data through ReefAPI rather than a static sample.
How many credits does the Stack Overflow API use?▾
Stack Overflow actions currently cost 1-2 credits per successful call. Failed or blocked calls are free, and all APIs draw from one credit pool.
18 Developer Tools APIs on the same key
One key, one credit pool, one response envelope. If you are pulling Stack Overflow, you are one call away from the rest of the category — no second contract, no second integration.
Need something this API does not do?
Name the endpoint, the field, or a source we do not carry yet. We ship new APIs every week and you would be first to get the key. Real people read every message and reply the same day.
Try it on your own data before you pay anything
The call above is the real endpoint, not a recording. A free key gives you 1,000 credits, the other 183 APIs, and the same envelope everywhere.
Endpoints, parameters and credit costs on this page are read from the live catalog and cannot drift from what the API accepts. Field notes were captured on 2026-08-30.