Skip to the content

Scraper API

Stack Overflow

stackexchange.questionAvailable

Stack Overflow question

The question — title, text, tags, score, views, who asked it, dates — and its answers: text, score, which one was accepted, who wrote each, and dates.

Give it a question's id, or its address on Stack Overflow or another Stack Exchange site.

1 unit a run, for runs that return data. Runs that fail cost nothing. How units work

Counted
1 unit a run
Inputs
4, 1 required
Record
22 fields
A run takes
up to 5 minutes
Records kept
7 days
Measured
its success, on the status page

POST/v1/scrapers/stackexchange.question/runs

{
"input": {
"question": "11227809",
"max_answers": 3
}
}

sent, and answered

a record of the run22 fields

{
site: "stackoverflow"
question_id: 11227809
title: "Why is conditional processing of a sorted array faster than of an unso…
url: "https://stackoverflow.com/questions/11227809/why-is-conditional-proces…
tags: [ "java", "c++", "performance" ]
score: 27549
answer_count: 25
view_count: 2034929
is_answered: true
… 13 more fields

ok1 unit a run

A record this scraper returned for this input. The first 9 of its 22 fields are set down here; the whole record is below.

stackoverflow.com
The page Stack Overflow question reads, as a browser shows it
The page this scraper reads, photographed in a browser on 19 November 2026. It belongs to its publisher, who has no part in this service.

What it is used for

Read a question with its answers
A question on Stack Overflow or another Stack Exchange site, with its answers, their scores, the accepted one and when each was posted.
Give answers to a language model
Hand a question and its best answers to a model as plain text with the code kept, with the license the text is published under.
Follow a question you rely on
Read it again and check last_activity_at and accepted_answer_id to see whether a new answer was posted or a different one accepted.

What you send

A question's id, or its address on Stack Overflow or another Stack Exchange site. These are its 4 inputs, as its schema has them.

questionstring Required
The question's id, or its address on the site.
sitestring Optional
The site the id belongs to; stackoverflow unless you say otherwise. An address names its own site.Default stackoverflow
max_answersinteger Optional
Return at most this many answers: 30 unless you say otherwise, up to 100; 0 returns none.Default 30
answer_sortstring Optional
votes (highest first), creation or activity. votes unless you say otherwise.Default votes

A request, ready to send

It starts a run with the input shown at the top of this page, waits up to 60 seconds for it, and reads its records. Put your key in the variable it reads.

# Start a run and wait up to 60 seconds for it to finish
curl -X POST "https://api.enrichednow.com/v1/scrapers/stackexchange.question/runs?wait=60" \
  -H "Authorization: Bearer $ENRICHEDNOW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"input":{"question":"11227809","max_answers":3}}'

# Read its records, with the id the first call answered
curl "https://api.enrichednow.com/v1/runs/$RUN_ID/records?limit=100" \
  -H "Authorization: Bearer $ENRICHEDNOW_API_KEY"
from enrichednow import EnrichedNow

client = EnrichedNow()  # reads ENRICHEDNOW_API_KEY

# Start a run, wait for it to end, and get its records
result = client.scrape("stackexchange.question", {
    "question": "11227809",
    "max_answers": 3,
})
print(result.run.id, result.run.status, result.run.record_count)

# Read its records: pages are fetched as you go
for record in result.records:
    print(record)

Install it with pip install enrichednow, then save as run.py and run python3 run.py

import EnrichedNow from "enrichednow";

const client = new EnrichedNow(); // reads ENRICHEDNOW_API_KEY

// Start a run, wait for it to end, and get its records
const { run, records } = await client.scrape("stackexchange.question", {
  question: "11227809",
  max_answers: 3,
});
console.log(run.id, run.status, run.record_count);

// Read its records: pages are fetched as you go
for await (const record of records) console.log(record);

Install it with npm install enrichednow, then save as run.mjs and run node run.mjs

package main

import (
	"context"
	"fmt"
	"log"
	"time"

	enrichednow "github.com/enrichednow/enrichednow-go"
)

func main() {
	client, err := enrichednow.NewClient() // reads ENRICHEDNOW_API_KEY
	if err != nil {
		log.Fatal(err)
	}
	ctx, cancel := context.WithTimeout(context.Background(), 10*time.Minute)
	defer cancel()

	// Start a run, wait for it to end, and get its records
	run, records, err := client.Scrape(ctx, "stackexchange.question", map[string]any{"question": "11227809", "max_answers": 3})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(run.ID, run.Status, run.RecordCount)

	// Read its records: pages are fetched as you go
	for records.Next() {
		fmt.Println(string(records.Current()))
	}
	if err := records.Err(); err != nil {
		log.Fatal(err)
	}
}

Install it with go get github.com/enrichednow/enrichednow-go@latest, then save as run.go and run go run run.go

import com.enrichednow.EnrichedNowClient;
import com.enrichednow.ScrapeResult;
import java.util.Map;

public class Run {
    public static void main(String[] args) {
        EnrichedNowClient client = EnrichedNowClient.fromEnv(); // reads ENRICHEDNOW_API_KEY

        // Start a run, wait for it to end, and get its records
        ScrapeResult result = client.scrape("stackexchange.question", Map.of("question", "11227809", "max_answers", 3));
        System.out.println(result.run().id() + " " + result.run().status() + " " + result.run().recordCount());

        // Read its records: pages are fetched as you go
        for (Map<String, Object> record : result.records()) {
            System.out.println(record);
        }
    }
}

Add com.enrichednow:enrichednow-java:0.4.0 to your Maven or Gradle build, then save as Run.java

enrichednow run stackexchange.question --input-json '{"question":"11227809","max_answers":3}'

Install it with curl -fsSL https://raw.githubusercontent.com/enrichednow/enrichednow-cli/main/install.sh | sh

What comes back

The question — title, text, tags, score, views, who asked it, dates — and its answers: text, score, which one was accepted, who wrote each, and dates. A record has 22 fields. One we could not read is null, never an empty string or a zero.

A record stackexchange.question returned
{
  "site": "stackoverflow",
  "question_id": 11227809,
  "title": "Why is conditional processing of a sorted array faster than of an unsorted array?",
  "url": "https://stackoverflow.com/questions/11227809/why-is-conditional-processing-of-a-sorted-array-faster-than-of-an-unsorted-array",
  "tags": [
    "java",
    "c++",
    "performance"
  ],
  "score": 27549,
  "answer_count": 25,
  "view_count": 2034929,
  "is_answered": true,
  "accepted_answer_id": 11227902,
  "body": "In this C++ code, sorting the data (before the timed region) makes the primary loop ~6x faster:\n\n#include <algorithm>\n#include <ctime>\n#include <iostream>\n\nint main()\n{\n    // Generate data\n    const unsigned arraySize = 32768;\n    int … [truncated]",
  "owner_name": "GManNickG",
  "owner_id": 87234,
  "owner_reputation": 507457,
  "owner_url": "https://stackoverflow.com/users/87234/gmannickg",
  "created_at": "2012-06-27T13:51:36Z",
  "last_activity_at": "2026-09-04T02:36:50Z",
  "last_edited_at": "2026-04-08T05:35:32Z",
  "closed_reason": null,
  "license": "CC BY-SA 4.0",
  "answers": [
    {
      "answer_id": 11227902,
      "url": "https://stackoverflow.com/a/11227902",
      "is_accepted": true,
      "score": 35296,
      "body": "You are a victim of branch prediction fail.\n\nWhat is Branch Prediction?\n\nConsider a railroad junction:\n\nImage by Mecanismo, via Wikimedia Commons. Used under the CC-By-SA 3.0 license.\n\nNow for the sake of argument, suppose this is back in … [truncated]",
      "owner_name": "Mysticial",
      "owner_id": 922184,
      "owner_reputation": 473543,
      "owner_url": "https://stackoverflow.com/users/922184/mysticial",
      "created_at": "2012-06-27T13:56:42Z",
      "last_edited_at": "2024-03-04T17:37:13Z",
      "license": "CC BY-SA 4.0"
    },
    {
      "answer_id": 11227877,
      "url": "https://stackoverflow.com/a/11227877",
      "is_accepted": false,
      "score": 4767,
      "body": "Branch prediction.\n\nWith a sorted array, the condition data[c] >= 128 is first false for a streak of values, then becomes true for all later values. That's easy to predict. With an unsorted array, you pay for the branching cost.",
      "owner_name": "Daniel Fischer",
      "owner_id": 1011995,
      "owner_reputation": 184644,
      "owner_url": "https://stackoverflow.com/users/1011995/daniel-fischer",
      "created_at": "2012-06-27T13:54:45Z",
      "last_edited_at": "2020-06-20T09:12:55Z",
      "license": "CC BY-SA 4.0"
    }
  ],
  "fetched_at": "2026-11-19T18:07:41.316308Z"
}

The scraper returned this record for the input above, reading a saved copy of the page, not the live site.

Values shortened for this page: tags: 5 items, the first 3 shown; body: 3,023 characters, the first 235 shown; answers: 3 items, the first 2 shown; answers[0].body: 6,995 characters, the first 238 shown.

The fields of a record

sitestring
The Stack Exchange site the question is on, as it was asked for: stackoverflow, superuser, math, or a host name.
question_idinteger
The site's id of the question.
titlestring
The question's title.
urlstring or null
The question's address on the site.
tagslist of strings
The question's tags, e.g. ["python", "asyncio"].
scoreinteger or null
The question's votes: up minus down.
answer_countinteger or null
How many answers the question has.
view_countinteger or null
How often the question was viewed.
is_answeredboolean or null
True when an answer was accepted or has a positive score.
accepted_answer_idinteger or null
The id of the accepted answer; null when none was accepted.
bodystring or null
The question as plain text: paragraphs on their own lines, code kept as written.
owner_namestring or null
The display name of the account that posted it; null when the account was deleted.
owner_idinteger or null
The site's numeric id of that account.
owner_reputationinteger or null
That account's reputation on the site.
owner_urlstring or null
That account's public profile on the site.
created_atdatetime or null
When the question was asked, in UTC.
last_activity_atdatetime or null
When the question, an answer or a comment last changed, in UTC.
last_edited_atdatetime or null
When the question was last edited, in UTC; null when it never was.
closed_reasonstring or null
Why the question was closed, in the site's words, e.g. "Duplicate"; null for an open question.
licensestring or null
The licence the text is published under, e.g. "CC BY-SA 4.0".
answerslist of objects
The question's answers in the order asked for, as many as max_answers allows.Each holds answer_id, url, is_accepted, score, body, owner_name, owner_id, owner_reputation, owner_url, created_at, last_edited_at, license.
fetched_atdatetime
When the question was read, in UTC.

The whole schema, in its reference

Units and limits

Counted per request
Billed per request: a run that returns data costs 1 unit, however many records it returns.
A miss costs nothing
A run that fails, that meets something not supported yet, or that you cancel costs nothing. You pay for runs that return data.
What bounds a run
A run may take up to 5 minutes. Its records are read in pages of up to 1,000 and are kept for 7 days.

What it does not do

  • Comments on the question and on its answers are not read.
  • Text is returned as plain text, with code as written; formulae on sites that use them stay in their TeX form.
  • Stack Exchange's API answers a caller without an application key about 300 requests a day from one network address; these scrapers use no key, so the allowance is shared and heavy use can reach it. A question is two requests, one with max_answers 0. When the allowance is used up the run ends as failed, with the reason rate_limited, and costs nothing.

The bounds its schema sets

max_answers
0 to 100; 30 unless you say otherwise
answer_sort
votes, creation, activity; votes unless you say otherwise

Scraper API pricing: how units workThe five ways a run ends

Questions

What does Stack Overflow question return?

The question — title, text, tags, score, views, who asked it, dates — and its answers: text, score, which one was accepted, who wrote each, and dates. A record has 22 fields, among them site, question_id, title, url, tags and score. A value that could not be read is null, never an empty string or a zero.

What do I send?

A question's id, or its address on Stack Overflow or another Stack Exchange site. The input question is required. Optional: site, max_answers and answer_sort.

How is it counted?

Billed per request: a run that returns data costs 1 unit, however many records it returns. A run that fails, that meets something not supported yet, or that you cancel costs nothing. The first 1,000 units each month are free.

How much does one run return?

Its schema sets these bounds: max_answers 0 to 100 (30 unless you say otherwise); answer_sort votes, creation, activity (votes unless you say otherwise). A run may take up to 5 minutes.

What does it not do?

Comments on the question and on its answers are not read. Text is returned as plain text, with code as written; formulae on sites that use them stay in their TeX form. Stack Exchange's API answers a caller without an application key about 300 requests a day from one network address; these scrapers use no key, so the allowance is shared and heavy use can reach it. A question is two requests, one with max_answers 0. When the allowance is used up the run ends as failed, with the reason rate_limited, and costs nothing.

How long are the records kept, and in what format do they come?

Records are kept for 7 days after the run ended, and read in pages of up to 1,000. They come as JSON, as NDJSON with one record a line, or as CSV with a column for each field.

Can an AI assistant call it?

Yes. Through the EnrichedNow MCP server an assistant calls the tool run_scraper with the scraper_id stackexchange.question and the same input. It costs what the same API call costs.

Stack Overflow

Questions and answers on Stack Overflow and every other Stack Exchange site: Super User, Server Fault, Ask Ubuntu, Mathematics and the rest.

  • Stack Overflow search

    stackexchange.search

    Words, tags or both, and the Stack Exchange site to search: Stack Overflow unless you name another. A page of the questions found: title, the question's text, tags, score, answer and view counts, whether it has an accepted answer, who asked it, and dates.

Stack Overflow on the line-up

Where
Worldwide

Run it on an input of your own.

Create an account, make a key, and send the request above with your own input. The first 1,000 units each month are free.