+Stack Overflow API
Questions with every answer, comments, tags, related threads and user reputation from Stack Overflow and other Stack Exchange sites, as JSON.
The API.SH Stack Overflow API returns questions, answers and people from Stack Overflow, and from other Stack Exchange sites through the site parameter. Search takes free text, tags to include or exclude, title and body text, accepted and closed flags, minimum answers and views and a date range, and returns each question's score, views, bounty, owner and body. A question comes with its tags, comments and every answer; other routes page through answers by votes or date, collect every comment on a question and its answers, fetch a single answer with its parent question, and list related or linked questions. Tag routes give question counts, the tag wiki, synonyms, related tags and the top answerers and askers. User routes return reputation and its change by day, week, month, quarter and year, badge counts, top tags, a user's questions and answers, and the reputation leaderboard.
- 12 endpoints
- from $1 / 1,000 calls
- 1,000 free credits / month
- failed calls free
GET https://api.api.sh/stackoverflow/v1/ user
{"id": 22656,"account_id": 11683,"name": "Jon Skeet","link": "https://stackoverflow.com/users/22656/jon-skeet","profile_image": "https://www.gravatar.com/avatar/6d8ebb117e8d83d74ea95fbdd0f87e13?s=256&d=identicon&r=PG","type": "registered","employee": false,"reputation": 1530403,"reputation_change": {"day": 0,"week": 305,"month": 493,"quarter": 493,"year": 8559},"badges": {"gold": 895,"silver": 9325,"bronze": 9364},"location": "Reading, United Kingdom","website": "http://csharpindepth.com","age": null,"about_html": "<p>Author of <a href=\"https://www.manning.com/books/c-sharp-in-depth-fourth-edition?a_aid=jonskeet&a_bid=66d590c3\" rel=\"nofollow norefer…","about": "Author of C# in Depth\n\nDistinguished Engineer at Trainline, previously Staff Engineer at Google.\n\nUsually a Microsoft MVP (C#, 2003-2010, 20…","answer_count": 35806,"question_count": 56,"accept_rate": 86,"profile_views": 2377923,"up_votes": 17430,"down_votes": 8975,"created_at": "2008-09-26T12:05:05.000Z","last_access_at": "2026-11-03T22:53:31.000Z","site": "stackoverflow","top_tags": [{"tag": "c#","answer_count": 19992,"answer_score": 269934,"question_count": 23,"question_score": 2687},{"tag": "java","answer_count": 10585,"answer_score": 159723,"question_count": 1,"question_score": 26},"… 18 more"],"quota_remaining": 299,"cached": false,"credits_used": 1} What you can build with the Stack Overflow API
Finding developer pain points
Search with tagged set to your library, accepted=false and a from_date to list recent questions nobody has solved, sorted by votes, then open each with /stackoverflow/v1/question to read the body and comments.
Q&A datasets for AI evaluation
Collect questions with their answers, accepted flags, scores and license from /stackoverflow/v1/question/answers, plus the comment threads, to build evaluation sets with proper attribution.
Technology popularity tracking
Read /stackoverflow/v1/tags sorted by popularity for question counts, and /stackoverflow/v1/tag for a tag's synonyms, related tags and top answerers, to compare frameworks over time.
Finding subject experts
Browse the leaderboard with /stackoverflow/v1/users and min_reputation, check a candidate's top tags and reputation change by period, and read their highest-voted answers with sort=votes and body=true.
Mapping duplicates and canonical answers
Use /stackoverflow/v1/question/related with type=linked to find the questions pointing at a canonical thread, then fetch its best answer by id for a docs page or a support macro.
Stack Overflow data you get
Field names from real responses. Numbers come parsed, URLs absolute, dates in ISO 8601.
Stack Overflow API endpoints and prices
Every Stack Overflow endpoint costs 1 credit per call: credits are $1 per 1,000 on a monthly plan, $2 pay-as-you-go. Pricing
| Related and linked questions /stackoverflow/ | $1 · $2 PAYG 1 credit |
| Stack Overflow question search /stackoverflow/ | $1 · $2 PAYG 1 credit |
| Tags by popularity /stackoverflow/ | $1 · $2 PAYG 1 credit |
| Stack Overflow user profile /stackoverflow/ | $1 · $2 PAYG 1 credit |
| A user's answers /stackoverflow/ | $1 · $2 PAYG 1 credit |
| A user's questions /stackoverflow/ | $1 · $2 PAYG 1 credit |
| Users leaderboard and directory /stackoverflow/ | $1 · $2 PAYG 1 credit |
| One answer by id /stackoverflow/ | $1 · $2 PAYG 1 credit |
| Stack Overflow question with answers /stackoverflow/ | $1 · $2 PAYG 1 credit |
| Stack Overflow question answers /stackoverflow/ | $1 · $2 PAYG 1 credit |
| Comments on a question and its answers /stackoverflow/ | $1 · $2 PAYG 1 credit |
| Tag info, wiki and synonyms /stackoverflow/ | $1 · $2 PAYG 1 credit |
Call the Stack Overflow API
Stack Overflow user profile: GET https://api.api.sh/stackoverflow/
curl "https://api.api.sh/stackoverflow/v1/user?id=22656" \
-H "x-api-key: $APISH_KEY" import os, requests
res = requests.get(
"https://api.api.sh/stackoverflow/v1/user",
params={"id": "22656"},
headers={"x-api-key": os.environ["APISH_KEY"]},
timeout=120,
)
res.raise_for_status()
data = res.json() const url = new URL("https://api.api.sh/stackoverflow/v1/user");
url.searchParams.set("id", "22656");
const res = await fetch(url, { headers: { "x-api-key": process.env.APISH_KEY } });
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);
const data = await res.json(); # Google Sheets (API.SH add-on)
=APISH("/stackoverflow/v1/user", "id", "22656")
# Zapier, Make, n8n (verified node): pick the API.SH app,
# choose "Stack Overflow" and "Stack Overflow user profile".
# AI agents (Claude, ChatGPT, Cursor): add the
# API.SH MCP server https://api.sh/mcp - Create a free accountConfirm your email and get 1,000 free credits every month. No card needed.
- Create an API keyOne key works for all 921 platforms.
- Send the requestJSON back in one call. Add
output=csvoroutput=ndjsonfor files.
Why API.SH for Stack Overflow data
- Public data only: no Stack Overflow login, cookies or account needed
- One key and one response shape for Stack Overflow and 920 other platforms
- Built and maintained by API.SH, not third-party publishers
- Pay per call; errors on our side cost nothing
- No rate limits: run as many calls in parallel as you need
- Live status for every endpoint
API.SH vs the official Stack Overflow API
Stack Exchange runs a free public API (version 2.x at api.stackexchange.com) that works without a key at a low daily quota; registering an app on Stack Apps raises it, and its search method is deliberately limited. API.SH needs no Stack Apps registration and returns the same kind of data in the JSON shape it uses for every other source.
The Stack Overflow data dump is a periodic snapshot, and Crawlbase or Apify scrapers give page fields you still have to clean. API.SH returns live questions, answers and comments with scores, accepted flags and licenses already structured.
Stack Overflow API questions
What Stack Overflow data can I get?+
Questions: search (/stackoverflow/v1/search), one question with answers, paged answers, all comments and related or linked questions. Answers: one answer by id with its question. Tags: tag list by popularity and one tag with wiki and synonyms. Users: profile, a user's questions, a user's answers and the users leaderboard.
How much does the Stack Overflow API cost?+
Every Stack Overflow endpoint costs 1 credit per call. On a monthly plan 1,000 credits cost $1 (Starter is $50/month for 50,000 credits). Pay-as-you-go is $2 per 1,000 credits, with top-ups from $15 that never expire.
Is there a free tier?+
Yes. Every account gets 1,000 free credits every month. That is 1,000 calls to /stackoverflow/v1/answer at 1 credit each.
Is there an official Stack Overflow API?+
Yes, the Stack Exchange API, which covers Stack Overflow and the other network sites and is free with daily quotas. API.SH is an option when you want no app registration or quota tracking and the same key for your other data sources.
Do I need a Stack Overflow account or API key?+
Not from Stack Overflow. You use your API.SH key, and only public content is returned; nothing is posted, voted or edited.
How do I get the accepted answer for a question?+
Call /stackoverflow/v1/question with the question id. Every answer comes with its accepted flag and score, and answer_sort orders them by votes, activity or creation. For long threads, /stackoverflow/v1/question/answers pages through them with next_page.
Does it work for other Stack Exchange sites?+
Yes. Every route takes site, so the same calls work on Super User, Server Fault, Mathematics, Ask Ubuntu and the rest of the network.
Can I use the Stack Overflow API from Python?+
Yes, with the Python SDK or any HTTP client: GET https://api.api.sh/stackoverflow/v1/search?q=async+await&tagged=javascript&sort=votes with your key in x-api-key returns the questions as JSON, with next_page for more.
How do I get started?+
Open an account at api.sh, copy your key and search with /stackoverflow/v1/search?tagged=python&sort=votes. The docs at https://api.sh/docs list every filter. JS and Python SDKs are available, and the routes work in Google Sheets, Zapier, Make, n8n and through the MCP server at https://api.sh/mcp.
Does the Stack Overflow API have a rate limit?+
No. API.SH puts no rate limit on your key: send as many Stack Overflow calls in parallel as you need and pay only for the calls that run. If Stack Overflow itself slows down, the call returns 503 with a retry-after header and is not charged.