Stack Overflow+API.SH

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
Stack Overflow user profile
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&amp;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}
1 credit · $1 per 1,000 calls

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.

Beyond Stack Overflow

Pass another Stack Exchange site in the site parameter to run the same search, tag and user routes on communities for servers, math, Unix or gaming, with identical fields.

Stack Overflow data you get

Field names from real responses. Numbers come parsed, URLs absolute, dates in ISO 8601.

One answer by id/stackoverflow/v1/answer
id11227902question_id11227809sitestackoverflowscore35297is_acceptedtruecreated_at2012-06-27T13:56:42.000Zlast_activity_at2024-03-04T17:37:13.000Zlast_edit_at2024-03-04T17:37:13.000Zbody_html<p><strong>You are a victim of <…bodyYou are a victim of branch predi…licenseCC BY-SA 4.0linkhttps://stackoverflow.com/a/1122…
owner[]user_id · name · reputation · link · profile_image · type
question[]id · title · link · tags · score · answer_count · accepted_answer_id
comments[]id · post_id · post_type · score · created_at · owner · reply_to · body_html · body · edited · link
Stack Overflow question with answers/stackoverflow/v1/question
id11227809titleWhy is conditional processing of…linkhttps://stackoverflow.com/questi…score27548view_count2016285answer_count25is_answeredtrueaccepted_answer_id11227902created_at2012-06-27T13:51:36.000Zlast_activity_at2026-09-04T02:36:50.000Zlast_edit_at2026-04-08T05:35:32.000Zbody_html<p>In this C++ code, sorting the…bodyIn this C++ code, sorting the da…licenseCC BY-SA 4.0sitestackoverflowanswers_returned25quota_remaining299
owner[]user_id · name · reputation · link · profile_image · type
comments[]id · post_id · score · created_at · owner · reply_to · body_html · body · edited
answers[]id · score · is_accepted · created_at · last_activity_at · last_edit_at · owner · body_html · body · license · link · comments
Stack Overflow question answers/stackoverflow/v1/question/answers
question_id11227809sitestackoverflowsortvotespage1count20next_page2quota_remaining299
answers[]id · question_id · score · is_accepted · created_at · last_activity_at · last_edit_at · owner · body_html · body · license · comments_count

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

Search and discovery3
Related and linked questions
/stackoverflow/v1/question/related
params id +5 optionaldocstry
$1 · $2 PAYG
1 credit
Stack Overflow question search
/stackoverflow/v1/search
params none required +21 optionaldocstry
$1 · $2 PAYG
1 credit
Tags by popularity
/stackoverflow/v1/tags
params none required +6 optionaldocstry
$1 · $2 PAYG
1 credit
Profiles and accounts4
Stack Overflow user profile
/stackoverflow/v1/user
params id +2 optionaldocstry
$1 · $2 PAYG
1 credit
A user's answers
/stackoverflow/v1/user/answers
params id +5 optionaldocstry
$1 · $2 PAYG
1 credit
A user's questions
/stackoverflow/v1/user/questions
params id +6 optionaldocstry
$1 · $2 PAYG
1 credit
Users leaderboard and directory
/stackoverflow/v1/users
params none required +7 optionaldocstry
$1 · $2 PAYG
1 credit
Comments and reviews4
One answer by id
/stackoverflow/v1/answer
params id +1 optionaldocstry
$1 · $2 PAYG
1 credit
Stack Overflow question with answers
/stackoverflow/v1/question
params id +2 optionaldocstry
$1 · $2 PAYG
1 credit
Stack Overflow question answers
/stackoverflow/v1/question/answers
params id +4 optionaldocstry
$1 · $2 PAYG
1 credit
Comments on a question and its answers
/stackoverflow/v1/question/comments
params id +3 optionaldocstry
$1 · $2 PAYG
1 credit
More data1
Tag info, wiki and synonyms
/stackoverflow/v1/tag
params name +1 optionaldocstry
$1 · $2 PAYG
1 credit

Call the Stack Overflow API

Stack Overflow user profile: GET https://api.api.sh/stackoverflow/v1/user

curl "https://api.api.sh/stackoverflow/v1/user?id=22656" \
  -H "x-api-key: $APISH_KEY"
  1. Create a free accountConfirm your email and get 1,000 free credits every month. No card needed.
  2. Create an API keyOne key works for all 921 platforms.
  3. Send the requestJSON back in one call. Add output=csv or output=ndjson for 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.

More reference APIs all developer & reference APIs →

Start with 1,000 free credits
Every month, on every account. One key works for all 921 platforms.
Get a free API key