InsightSocial

Stack Overflow scraper API

The InsightSocial Stack Overflow API has 23 endpoints, from 20 credits a call. A question call costs 20 credits, about $0.02 on Pro, and your first 10 calls up to 100 credits each are free.

The Stack Overflow API for public questions, answers, comments, users and tags, as JSON, on Stack Overflow and every other Stack Exchange site, on the same key as 60 other platforms.

23 endpoints · from 20 credits a call · 10 free calls up to 100 credits each · no credit card

curl "https://api.insightsocial.app/v1/stackoverflow/question?question_id=11227809&include=answers" \
-H "x-api-key: $INSIGHTSOCIAL_API_KEY"
200 OKJSON
{
"success": true,
"platform": "stackoverflow",
"endpoint": "/v1/stackoverflow/question",
"schema_version": "2",
"data": {
"site": "stackoverflow",
"question": {
"id": "11227809",
"url": "https://stackoverflow.com/questions/11227809/why-is-conditional-processing-of-a-sorted-array-faster-than-of-an-unsorted-array",
"title": "Why is conditional processing of a sorted array faster than of an unsorted array?",
"tags": [
"java",
"c++",
"performance",
"cpu-architecture",
"branch-prediction"
],
"score": 27548,
"view_count": 2020279,
"answer_count": 25,
"is_answered": true,
"accepted_answer_id": "11227902",
"created_at": "2012-06-27T13:51:36.000Z",
"author": {
"id": "87234",
"name": "example_user",
"reputation": 507447
}
}
},
"unavailable": [],
"credits_used": 0,
"charge_reason": "miss",
"free_call": true
}

What Stack Overflow data can you get?

Public Stack Overflow data only, in the same JSON envelope as every other platform. Every Stack Overflow endpoint is beta: inside data it returns Stack Overflow's own structure under our naming rules (snake_case keys, string ids, ISO times where Stack Overflow gives a timestamp), not the shared profile and post schema, and fields may change.

Questions and answers

A question in full with its answers and comments on request, the answers alone by votes or activity, and up to 100 questions in one call.

Search and lists

Questions by words, tags, author, answer count or date, by closest title, or by tag and time range with the related and linked questions.

Users and reputation

A user's profile, reputation history, badges, top tags, and the questions, answers and comments they wrote.

Edits, comments and tags

Every revision of a post with the text before and after, its full timeline, its comments, and tags with synonyms and top answerers.

What people build with the Stack Overflow API

  • Developer-relations research

    Track the questions asked under your product's tags, how fast they get an accepted answer, and who answers them most.

  • Documentation gaps

    Search questions about your library by title and body, and read the accepted answers to see where your own docs fall short.

  • Training and evaluation sets

    Pull questions with their answers and edit history in batches of 100, and keep the licence and author on every row.

Stack Overflow API endpoints

All 23 Stack Overflow endpoints and their price in credits. 3 are metered: they show a range and charge what the call actually read.

EndpointCreditsWhat it returns
/post/citation20Get a BibTeX, AMS and text citation for a Stack Overflow question or answer.
/post/comments20List every comment on a Stack Overflow question or answer.
/post/revisions20List the versions of a Stack Overflow post, with the text before and after each edit.
/post/timeline20List everything that happened to a Stack Overflow post: edits, locks, answers, comments, votes and reviews.
/posts/comments20–1,260Get the comments on up to 100 Stack Overflow questions and answers in one call.
/question20Get a Stack Overflow question with its text, tags, votes, closed or locked state and, if asked, its answers and comments.
/question/answers20List the answers to a Stack Overflow question by votes, activity or time, with their text and, if asked, their comments.
/questions20List Stack Overflow questions by tag, time range, votes or activity, or the questions related to or linking to one.
/questions/batch20–1,260Get up to 100 Stack Overflow questions in one call, by id.
/questions/search20Search Stack Overflow questions and answers by words, title, body, tag, author or answer count, with snippets.
/questions/title-search20Search Stack Overflow questions whose title is closest to a title.
/sites20List the sites of the Stack Exchange network and the name each takes in the `site` parameter.
/tag20Get a Stack Overflow tag with its description, synonyms, related tags and best answerers.
/tags20List Stack Overflow tags by popularity, activity or name, with question counts.
/user20Get a Stack Overflow user's profile: reputation, badges, activity counts, location, website and profile text.
/user/answers20List the answers a Stack Overflow user has given, by activity, votes or time.
/user/badges20List the badges a Stack Overflow user has earned.
/user/comments20List the comments a Stack Overflow user has written, by time or votes.
/user/questions20List the questions a Stack Overflow user has asked, by activity, votes or time.
/user/reputation20List the changes to a Stack Overflow user's reputation, newest first.
/user/tags20List the tags a Stack Overflow user posts under, with question and answer counts and scores.
/users/batch20–1,260Get up to 100 Stack Overflow users in one call, by id.
/users/search20Search Stack Overflow users by name, reputation or when they joined.

Parameters, response fields and examples for each endpoint are in the Stack Overflow API reference.

InsightSocial vs the official Stack Overflow API

The Stack Exchange API is free and open: anyone can call it, with a daily quota that a registered key raises. If Stack Overflow is all you need, it is a good choice.

InsightSocial APIOfficial Stack Overflow API
AccessOne key for Stack Overflow and 60 other platformsFree; a registered key raises the daily quota
Response shapeThe same envelope, credits and cursor paging as every other platform on your keyIts own envelope, filters and paging
BillingOne credit balance across every platformNo billing; quotas instead
Cost per call20 creditsFree, within daily quotas

The official API is the right tool for posting, messaging or managing accounts you own. This one is read-only public data.

How much does the Stack Overflow API cost?

Stack Overflow calls start at 20 credits. Every endpoint's price is in the table above and in the free GET /v1/endpoints catalogue, so you know the cost before you call. Pro's 10,000 monthly credits cover about 500 questions at 20 credits each.

  • Failed calls are free

    A call that errors or finds nothing costs 0 credits.

  • Repeats and retries

    A repeat call is charged again: the full price when it fetches new data, 2 credits when the answer comes from the shared cache. Add fresh=1 to force a new read. Only a retry with the same Idempotency-Key is free.

  • One balance

    API calls and Chrome extension exports share the same credits. The free plan includes 500 a month.

Not writing code?

Connect InsightSocial to Claude or ChatGPT and ask for Stack Overflow data in plain English. Same account, same credits.

Use it from Claude or ChatGPT

Stack Overflow API: frequently asked questions

Yes. Most endpoints take a site parameter, such as askubuntu, serverfault or math, and default to stackoverflow. /v1/stackoverflow/sites lists every site and the name it takes.