Stack Overflow API API
The Stack Overflow API returns Q&A data — questions, answers, users and tags — as clean JSON.
🤖 Using an AI assistant? Copy this link into ChatGPT / Claude / Cursor — it reads every endpoint and parameter instantly and tells you if this API fits your use case.
The primary questions endpoint returns questions with title, score, tags, view and answer counts and timestamps, and the broad action set covers a single question and its answers, user profiles and their questions, answers, tags and badges, plus full-text search and tag browsing. It is built for developer research, community analytics and knowledge tools that need Stack Overflow data without the official API's throttling. One ReefAPI key, one shared credit pool, the standard envelope.
Real request and response JSON
Captured from the indexed primary action, search, on .
{
"method": "POST",
"url": "https://api.reefapi.com/stackoverflow/v1/search",
"headers": {
"x-api-key": "$REEF_KEY",
"content-type": "application/json"
},
"body": {
"q": "async await"
}
}{
"ok": true,
"meta": {
"api": "stackoverflow",
"endpoint": "search",
"mode": "live",
"latency_ms": 1560.7,
"record_count": 100,
"bytes": 193719,
"cache_hit": false,
"method": "official_stackexchange_api_v2_3",
"has_more": true,
"page": 1,
"pagesize": 100,
"quota_remaining": 299,
"next_page": 2
},
"data": {
"items": [
{
"tags": [
"javascript",
"node.js",
"promise"
],
"owner": {
"account_id": 4326760,
"reputation": 55019,
"user_id": 3533365,
"user_type": "registered",
"accept_rate": 100,
"profile_image": "https://i.sstatic.net/9nmc0DfK.jpg?s=256",
"display_name": "Saad",
"link": "https://stackoverflow.com/users/3533365/saad"
},
"is_answered": true,
"view_count": 2478838,
"protected_date": 1534441280,
"accepted_answer_id": 37576787,
"answer_count": 35,
"score": 3352,
"last_activity_date": 1738027633,
"creation_date": 1464807358,
"last_edit_date": 1615551571,
"question_id": 37576685,
"content_license": "CC BY-SA 4.0",
"link": "https://stackoverflow.com/questions/37576685/using-async-await-with-a-foreach-loop",
"title": "Using async/await with a forEach loop",
"body": "<p>Are there any issues with using <code>async</code>/<code>await</code> in a <code>forEach</code> loop? I'm trying to loop through an array of files and <code>await</code> on the contents of each file.</p>\n<pre><code>import fs from 'fs-promise'\n\nasync function printFiles () {\n const files = await getFilePaths() // Assume this works fine\n\n files.forEach(async (file) => {\n const contents = await fs.readFile(file, 'utf8')\n console.log(contents)\n })\n}\n\nprintFiles()\n</code></pre>\n<p>This code does work, but could something go wrong with this? I had someone tell me that you're not suppo",
"id": 37576685,
"type": "question",
"author": {
"user_id": 3533365,
"display_name": "Saad",
"link": "https://stackoverflow.com/users/3533365/saad",
"reputation": 55019,
"user_type": "registered",
"profile_image": "https://i.sstatic.net/9nmc0DfK.jpg?s=256"
}
},
{
"tags": [
"c#",
".net",
"asynchronous"
],
"owner": {
"account_id": 368977,
"reputation": 33646,
"user_id": 716092,
"user_type": "registered",
"accept_rate": 61,
"profile_image": "https://i.sstatic.net/kcc7I.png?s=256",
"display_name": "Dan Dinu",
"link": "https://stackoverflow.com/users/716092/dan-dinu"
},
"is_answered": true,
"view_count": 1315855,
"protected_date": 1534778591,
"accepted_answer_id": 19985988,
"answer_count": 26,
"score": 1430,
"last_activity_date": 1766067366,
"creation_date": 1358846998,
"last_edit_date": 1538165531,
"question_id": 14455293,
"content_license": "CC BY-SA 4.0",
"link": "https://stackoverflow.com/questions/14455293/how-and-when-to-use-async-and-await",
"title": "How and when to use ‘async’ and ‘await’",
"body": "<p>From my understanding one of the main things that <a href=\"https://learn.microsoft.com/en-us/dotnet/csharp/async\" rel=\"noreferrer\"><code>async</code> and <code>await</code></a> do is to make code easy to write and read - but is using them equal to spawning background threads to perform long duration logic?</p>\n\n<p>I'm currently trying out the most basic example. I've added some comments inline. Can you clarify it for me?</p>\n\n<pre><code>// I don't understand why this method must be marked as `async`.\nprivate async void button1_Click(object sender, EventArgs e)\n{\n Task<int> access =",
"id": 14455293,
"type": "question",
"author": {
"user_id": 716092,
"display_name": "Dan Dinu",
"link": "https://stackoverflow.com/users/716092/dan-dinu",
"reputation": 33646,
"user_type": "registered",
"profile_image": "https://i.sstatic.net/kcc7I.png?s=256"
}
},
{
"tags": [
"javascript",
"node.js",
"asynchronous"
],
"owner": {
"account_id": 459794,
"reputation": 13964,
"user_id": 860478,
"user_type": "registered",
"accept_rate": 79,
"profile_image": "https://i.sstatic.net/iBpsT.png?s=256",
"display_name": "Victor Marchuk",
"link": "https://stackoverflow.com/users/860478/victor-marchuk"
},
"is_answered": true,
"view_count": 602853,
"protected_date": 1565948528,
"accepted_answer_id": 35612484,
"answer_count": 12,
"score": 923,
"last_activity_date": 1685968622,
"creation_date": 1456345726,
"last_edit_date": 1608858445,
"question_id": 35612428,
"content_license": "CC BY-SA 4.0",
"link": "https://stackoverflow.com/questions/35612428/call-async-await-functions-in-parallel",
"title": "Call async/await functions in parallel",
"body": "<p>As far as I understand, in ES7/ES2016 putting multiple <code>await</code>'s in code will work similar to chaining <code>.then()</code> with promises, meaning that they will execute one after the other rather than in parallel. So, for example, we have this code:</p>\n<pre><code>await someCall();\nawait anotherCall();\n</code></pre>\n<p>Do I understand it correctly that <code>anotherCall()</code> will be called only when <code>someCall()</code> is completed? What is the most elegant way of calling them in parallel?</p>\n<p>I want to use it in Node, so maybe there's a solution with async library?</",
"id": 35612428,
"type": "question",
"author": {
"user_id": 860478,
"display_name": "Victor Marchuk",
"link": "https://stackoverflow.com/users/860478/victor-marchuk",
"reputation": 13964,
"user_type": "registered",
"profile_image": "https://i.sstatic.net/iBpsT.png?s=256"
}
}
],
"site": "stackoverflow",
"attribution": "Stack Exchange API; content license CC BY-SA, preserve item link and author attribution."
}
}What the Stack Overflow API API does
| Action | Description | Concrete use case | Key params |
|---|---|---|---|
| questions | Paginated questions by sort/tag; returns score, tags, body, owner/link attribution. | Ops teams call questions to get paginated questions by sort/tag;. | site, sort, tag, tags, page, ... |
| question | Single question by id plus paginated answers. | Developer tools call question to get single question by id plus paginated answers.. | id, site, page, pagesize, filter |
| answers | Answer details by id/ids, or recent answers when no id is supplied. | Validation workflows call answers to get answer details by id/ids, or recent answers when no id is supplied.. | id, ids, site, sort, page, ... |
| user | User profile by id/ids. | Data-quality teams call user to get user profile by id/ids.. | id, site |
| user_questions | Paginated questions for a user. | Ops teams call user_questions to get paginated questions for a user.. | id, site, page, pagesize, sort, ... |
| user_answers | Paginated answers for a user. | Developer tools call user_answers to get paginated answers for a user.. | id, site, page, pagesize, sort, ... |
| user_tags | Paginated tag activity for a user. | Validation workflows call user_tags to get paginated tag activity for a user.. | id, site, page, pagesize, sort |
| user_badges | Paginated badges for a user. | Data-quality teams call user_badges to get paginated badges for a user.. | id, site, page, pagesize, sort |
| search | Advanced full-text/tag search, paginated. | Ops teams call search to get advanced full-text/tag search, paginated.. | q, site, tags, tagged, sort, ... |
| tags | Paginated Stack Exchange tags. | Developer tools call tags to get paginated Stack Exchange tags.. | site, sort, page, pagesize |
| tag_questions | Paginated questions for a tag. | Validation workflows call tag_questions to get paginated questions for a tag.. | tag, site, sort, page, pagesize, ... |
| tag_info | Tag info by tag name. | Data-quality teams call tag_info to get tag info by tag name.. | tag, site |
| comments | Paginated comments for post id/ids. | Ops teams call comments to get paginated comments for post id/ids.. | id, site, page, pagesize, sort, ... |
| answer_comments | Comments left on one or more answers, by answer id. | Developer tools call answer_comments to get comments left on one or more answers, by answer id.. | ids, site, page, pagesize, order, ... |
| answer_questions | The questions that the given answers belong to, by answer id. | Validation workflows call answer_questions to get the questions that the given answers belong to, by answer id.. | ids, site, page, pagesize, order, ... |
| badges | All badges on the site, ranked bronze/silver/gold. | Data-quality teams call badges to get all badges on the site, ranked bronze/silver/gold.. | site, page, pagesize, order, sort |
| badge | Badge details by badge id. | Ops teams call badge to get badge details by badge id.. | ids, site, page, pagesize, order, ... |
| badge_name | Named badges (the ones with a fixed name, e.g. 'Nice Answer'). | Developer tools call badge_name to get named badges (the ones with a fixed name, e.g. | site, page, pagesize, order, sort |
| badge_recipients | Recently awarded badges across the site, with the users who earned them. | Validation workflows call badge_recipients to get recently awarded badges across the site, with the users who earned them.. | site, page, pagesize, order, sort |
| badge_recipients_by_ids | Recent recipients of specific badges, by badge id. | Data-quality teams call badge_recipients_by_ids to get recent recipients of specific badges, by badge id.. | ids, site, page, pagesize, order, ... |
| badge_tags | Tag-based badges (badges earned for activity within a tag). | Ops teams call badge_tags to get tag-based badges (badges earned for activity within a tag).. | site, page, pagesize, order, sort |
| collectives | All Stack Overflow Collectives (curated communities like 'Google Cloud'). | Developer tools call collectives to get all Stack Overflow Collectives (curated communities like 'Google Cloud').. | site, page, pagesize, order |
| collective | Details for a Collective by its slug. | Validation workflows call collective to get details for a Collective by its slug.. | slugs, site, page, pagesize, order |
| collective_questions | Questions associated with a Collective. | Data-quality teams call collective_questions to get questions associated with a Collective.. | slugs, site, page, pagesize, order, ... |
| collective_answers | Answers associated with a Collective. | Ops teams call collective_answers to get answers associated with a Collective.. | slugs, site, page, pagesize, order, ... |
| collective_tags | Tags that belong to a Collective. | Developer tools call collective_tags to get tags that belong to a Collective.. | slugs, site, page, pagesize, order, ... |
| collective_users | Members of a Collective, by reputation. | Validation workflows call collective_users to get members of a Collective, by reputation.. | slugs, site, page, pagesize, order, ... |
| comments_all | Recent comments across the whole site. | Data-quality teams call comments_all to get recent comments across the whole site.. | site, page, pagesize, order, sort |
| comment | Comment details by comment id. | Ops teams call comment to get comment details by comment id.. | ids, site, page, pagesize, order, ... |
| info | Site statistics: total questions, answers, users, badges, API revision. | Developer tools call info to get site statistics. | site |
| posts | Recent posts (questions and answers together) across the site. | Validation workflows call posts to get recent posts (questions and answers together) across the site.. | site, page, pagesize, order, sort, ... |
| post | Post details by id, whether it is a question or an answer. | Data-quality teams call post to get post details by id, whether it is a question or an answer.. | ids, site, page, pagesize, order, ... |
| post_comments | Comments on a post (question or answer), by post id. | Ops teams call post_comments to get comments on a post (question or answer), by post id.. | ids, site, page, pagesize, order, ... |
| post_revisions | Edit history (revisions) of a post, by post id. | Developer tools call post_revisions to get edit history (revisions) of a post, by post id.. | ids, site, page, pagesize, order |
| post_suggested_edits | Suggested edits submitted for a post, by post id. | Validation workflows call post_suggested_edits to get suggested edits submitted for a post, by post id.. | ids, site, page, pagesize, order |
| privileges | The site privilege ladder (what each reputation level unlocks). | Data-quality teams call privileges to get the site privilege ladder (what each reputation level unlocks).. | site, page, pagesize, order |
| question_answers | All answers to one or more questions, by question id. | Ops teams call question_answers to get all answers to one or more questions, by question id.. | ids, site, page, pagesize, order, ... |
| question_comments | Comments on a question, by question id. | Developer tools call question_comments to get comments on a question, by question id.. | ids, site, page, pagesize, order, ... |
| question_linked | Questions that link to the given question(s). | Validation workflows call question_linked to get questions that link to the given question(s).. | ids, site, page, pagesize, order, ... |
| question_related | Questions Stack Overflow considers related to the given question(s). | Data-quality teams call question_related to get questions Stack Overflow considers related to the given question(s).. | ids, site, page, pagesize, order, ... |
| question_timeline | Full event timeline of a question (edits, answers, comments, votes, close/reopen). | Ops teams call question_timeline to get full event timeline of a question (edits, answers, comments, votes, close/reopen).. | ids, site, page, pagesize, order |
| questions_featured | Featured (bountied) questions on the site. | Developer tools call questions_featured to get featured (bountied) questions on the site.. | site, page, pagesize, order, sort, ... |
| questions_no_answers | Questions with zero answers (no answers at all). | Validation workflows call questions_no_answers to get questions with zero answers (no answers at all).. | site, page, pagesize, order, sort, ... |
| questions_unanswered | Questions the community considers unanswered (no accepted/upvoted answer). | Data-quality teams call questions_unanswered to get questions the community considers unanswered (no accepted/upvoted answer).. | site, page, pagesize, order, sort, ... |
| revisions | Revision details by revision guid. | Ops teams call revisions to get revision details by revision guid.. | ids, site, page, pagesize, order |
| search_simple | Title-only question search — find questions whose title contains given text. | Developer tools call search_simple to get title-only question search. | intitle, tag, site, page, pagesize, ... |
| similar | Find questions similar to a title (duplicate detection). | Validation workflows call similar to find questions similar to a title (duplicate detection).. | title, tag, site, page, pagesize, ... |
| search_excerpts | Full-text search returning highlighted match excerpts for questions and answers. | Data-quality teams call search_excerpts to get full-text search returning highlighted match excerpts for questions and answers.. | q, tag, site, page, pagesize, ... |
| suggested_edits | Recent suggested edits across the site. | Ops teams call suggested_edits to get recent suggested edits across the site.. | site, page, pagesize, order, sort |
| suggested_edit | Suggested-edit details by id. | Developer tools call suggested_edit to get suggested-edit details by id.. | ids, site, page, pagesize, order, ... |
| tags_moderator_only | Tags only moderators can apply. | Validation workflows call tags_moderator_only to get tags only moderators can apply.. | site, page, pagesize, order, sort |
| tags_required | Tags that must be present on every question (where the site requires them). | Data-quality teams call tags_required to get tags that must be present on every question (where the site requires them).. | site, page, pagesize, order, sort |
| tag_synonyms | All tag synonyms on the site (e.g. 'js' → 'javascript'). | Ops teams call tag_synonyms to get all tag synonyms on the site (e.g. | site, page, pagesize, order, sort |
| tag_faq | The frequently-asked (FAQ) questions for a tag. | Developer tools call tag_faq to get the frequently-asked (FAQ) questions for a tag.. | tags, site, page, pagesize, order, ... |
| tag_related | Tags that commonly appear together with the given tag. | Validation workflows call tag_related to get tags that commonly appear together with the given tag.. | tags, site, page, pagesize, order, ... |
| tag_synonyms_by_tags | Synonyms that map to a specific tag. | Data-quality teams call tag_synonyms_by_tags to get synonyms that map to a specific tag.. | tags, site, page, pagesize, order, ... |
| tag_top_answerers | Top answerers in a tag (the experts), all-time or last month. | Ops teams call tag_top_answerers to get top answerers in a tag (the experts), all-time or last month.. | tag, site, page, pagesize, order, ... |
| tag_top_askers | Top askers in a tag, all-time or last month. | Developer tools call tag_top_askers to get top askers in a tag, all-time or last month.. | tag, site, page, pagesize, order, ... |
| tag_wikis | The wiki/excerpt body that describes a tag. | Validation workflows call tag_wikis to get the wiki/excerpt body that describes a tag.. | tags, site, page, pagesize, order |
| users | Site users, by reputation (the leaderboard). | Data-quality teams call users to get site users, by reputation (the leaderboard).. | site, page, pagesize, order, sort |
| user_comments | Comments written by a user. | Ops teams call user_comments to get comments written by a user.. | ids, site, page, pagesize, order, ... |
| user_comments_to_user | Comments a user directed at one specific other user. | Developer tools call user_comments_to_user to get comments a user directed at one specific other user.. | ids, toid, site, page, pagesize, ... |
| user_favorites | Questions a user bookmarked (favorited). | Validation workflows call user_favorites to get questions a user bookmarked (favorited).. | ids, site, page, pagesize, order, ... |
| user_mentioned | Comments that @-mention a user. | Data-quality teams call user_mentioned to get comments that @-mention a user.. | ids, site, page, pagesize, order, ... |
| user_network_activity | A user's activity across the entire Stack Exchange network (all sites). | Ops teams call user_network_activity to get a user's activity across the entire Stack Exchange network (all sites).. | id, page, pagesize, order |
| user_posts | All posts (questions and answers) authored by a user. | Developer tools call user_posts to get all posts (questions and answers) authored by a user.. | ids, site, page, pagesize, order, ... |
| user_privileges | The privileges a user has unlocked at their reputation level. | Validation workflows call user_privileges to get the privileges a user has unlocked at their reputation level.. | id, site, page, pagesize, order |
| user_questions_featured | A user's questions that currently carry a bounty (featured). | Data-quality teams call user_questions_featured to get a user's questions that currently carry a bounty (featured).. | ids, site, page, pagesize, order, ... |
| user_questions_no_answers | A user's questions that have no answers. | Ops teams call user_questions_no_answers to get a user's questions that have no answers.. | ids, site, page, pagesize, order, ... |
| user_questions_unaccepted | A user's questions that have answers but none accepted. | Developer tools call user_questions_unaccepted to get a user's questions that have answers but none accepted.. | ids, site, page, pagesize, order, ... |
| user_questions_unanswered | A user's questions the community considers unanswered. | Validation workflows call user_questions_unanswered to get a user's questions the community considers unanswered.. | ids, site, page, pagesize, order, ... |
| user_reputation | A user's reputation changes (the rep events feed). | Data-quality teams call user_reputation to get a user's reputation changes (the rep events feed).. | ids, site, page, pagesize, order |
| user_reputation_history | Public reputation history of a user (each gain/loss event). | Ops teams call user_reputation_history to get public reputation history of a user (each gain/loss event).. | ids, site, page, pagesize, order |
| user_suggested_edits | Suggested edits a user has submitted. | Developer tools call user_suggested_edits to get suggested edits a user has submitted.. | ids, site, page, pagesize, order, ... |
| user_top_answers_in_tags | A user's highest-scoring answers within specific tags. | Validation workflows call user_top_answers_in_tags to get a user's highest-scoring answers within specific tags.. | id, tags, site, page, pagesize, ... |
| user_top_questions_in_tags | A user's highest-scoring questions within specific tags. | Data-quality teams call user_top_questions_in_tags to get a user's highest-scoring questions within specific tags.. | id, tags, site, page, pagesize, ... |
| user_timeline | A user's activity timeline (posts, comments, badges, rep events). | Ops teams call user_timeline to get a user's activity timeline (posts, comments, badges, rep events).. | ids, site, page, pagesize, order |
| user_top_answer_tags | The tags a user is strongest in by answer score. | Developer tools call user_top_answer_tags to get the tags a user is strongest in by answer score.. | id, site, page, pagesize, order |
| user_top_question_tags | The tags a user is strongest in by question score. | Validation workflows call user_top_question_tags to get the tags a user is strongest in by question score.. | id, site, page, pagesize, order |
| user_top_tags | A user's top tags overall (combined question + answer activity). | Data-quality teams call user_top_tags to get a user's top tags overall (combined question + answer activity).. | id, site, page, pagesize, order |
| moderators | All moderators on the site. | Ops teams call moderators to get all moderators on the site.. | site, page, pagesize, order, sort |
| elected_moderators | Moderators who were elected (excludes appointed/employee moderators). | Developer tools call elected_moderators to get moderators who were elected (excludes appointed/employee moderators).. | site, page, pagesize, order, sort |
| errors | The catalog of Stack Exchange API error codes and their meanings. | Validation workflows call errors to get the catalog of Stack Exchange API error codes and their meanings.. | page, pagesize, order |
| error | Simulate one Stack Exchange API error by its id (returns the error as if it occurred). | Data-quality teams call error to get simulate one Stack Exchange API error by its id (returns the error as if it occurred).. | id, page, pagesize, order |
| sites | Every site in the Stack Exchange network (Stack Overflow, Server Fault, Super User, etc.). | Ops teams call sites to get every site in the Stack Exchange network (Stack Overflow, Server Fault, Super User, etc.).. | page, pagesize, order, sort |
| associated_users | A user's accounts across all Stack Exchange sites (network accounts). | Developer tools call associated_users to get a user's accounts across all Stack Exchange sites (network accounts).. | ids, page, pagesize, order |
| merge_history | Account-merge history for a user id. | Validation workflows call merge_history to get account-merge history for a user id.. | ids, page, pagesize, order |
Call search from your stack
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"])const res = await fetch("https://api.reefapi.com/stackoverflow/v1/search", {
method: "POST",
headers: {
"x-api-key": process.env.REEF_KEY,
"content-type": "application/json",
},
body: JSON.stringify({
"q": "async await"
}),
});
const { ok, data, meta, error } = await res.json();Ask your MCP-connected assistant: call reefapi.stackoverflow.search with {"q":"async await"}.Who uses this API and why
- 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.
Questions developers ask before integrating
What is the Stack Overflow API API?
Stack Overflow API API is a ReefAPI endpoint group for stack overflow api It returns live JSON through POST requests under /stackoverflow/v1.
Is the Stack Overflow API API free to try?
Yes. ReefAPI starts with 1,000 free credits, no card required. Stack Overflow API calls use the same shared credit balance as every other ReefAPI engine.
Do I need a Stack Overflow API login or account?
No login to Stack Overflow API 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 API 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 API use?
Stack Overflow API actions currently cost 1-2 credits per successful call. Failed or blocked calls are free, and all APIs draw from one credit pool.
Can I call Stack Overflow API from an AI assistant or MCP client?
Yes. Connect ReefAPI once through MCP and your assistant can call stackoverflow actions with the same key, credit pool and JSON envelope used by normal REST requests.
Is the Stack Overflow API API a Stack Overflow API scraper?
It is the managed alternative to a DIY Stack Overflow API scraper. Instead of building and maintaining your own scraper — proxies, headless browsers, captcha and constant breakage — you call one ReefAPI endpoint and get the same stack overflow api back as clean JSON.
Why does my Stack Overflow API scraper keep getting blocked?
Most Stack Overflow API scrapers break on anti-bot defenses, rate limits and IP bans that need rotating residential proxies and browser fingerprinting to clear. ReefAPI handles all of that for you — no proxies, no captchas, no maintenance — and returns live JSON. Blocked or failed calls are free.