Stack Exchange Answers

Answers to Stack Overflow and other Stack Exchange questions, highest score first: score, accepted flag, author, dates, question title, tags, link and an optional plain-text excerpt. Paste question links or ids, or get a site's newest answers.

$0.50 per 1,000 records

You pay only for the records you get. Zero records cost zero. 10,000 free records of this API to start (5,000 at the base price of $1 per 1,000), no card.

Try it
Ready-made, maintained by usPosts, 16 fieldsv1.0

Data from api.stackexchange.com/docs

Get this data

Try it here with a few records, download the sample, fill a Google Sheet, or call it from your own code.

Try it

Question linksoptional
Question links or ids, such as ["https://stackoverflow.com/questions/11227809"]. Links from any Stack Exchange site work; bare ids use site. An answer link returns that answer. Empty: the site's newest answers. One per line, or separated by commas.
Example: https://stackoverflow.com/questions/11227809
Siteoptional
Site for bare ids and for the newest answers: stackoverflow, superuser, serverfault, askubuntu, math, unix and so on, or a domain such as math.stackexchange.com.
Example: stackoverflow
Include textoptional
Add the first 500 characters of each answer as plain text.
Maximum resultsoptional
Most answers per question, highest score first, from 1 to 2,500.
Example: 100

Run it on this page, or call it from your code with the endpoint in the developer section. A free key covers 10,000 records of this API, no card. Create a free key

For developers: the API and MCPThe endpoint, code in curl, JavaScript and Python, every input, and files for your tools
Endpoint
POSThttps://pullrow.dev/v1/apis/stack-exchange-answers/run
  • Small runs answer in the same request; longer ones answer 202 with a run to poll.
  • fields returns only the fields you name. The examples send the ones picked on this page.
  • Idempotency-Key is optional. A retry with it is never charged twice.
  • You pay for records returned. Zero records cost zero.

Every run option, explained

Calling it needs a key
10,000 free records of this API to start. No card.
curl
curl -X POST "https://pullrow.dev/v1/apis/stack-exchange-answers/run" \
  -H "Authorization: Bearer $PULLROW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "input": {
    "question_links": [
      "https://stackoverflow.com/questions/11227809"
    ]
  },
  "max_items": 50
}'

Inputs

Send them as input in the request body. Leave one out to use its default.

question_linkslist
Question links or ids, such as ["https://stackoverflow.com/questions/11227809"]. Links from any Stack Exchange site work; bare ids use site. An answer link returns that answer. Empty: the site's newest answers.
example: https://stackoverflow.com/questions/11227809
sitetext
Site for bare ids and for the newest answers: stackoverflow, superuser, serverfault, askubuntu, math, unix and so on, or a domain such as math.stackexchange.com.
default: stackoverflowexample: stackoverflow
include_textyes/no
Add the first 500 characters of each answer as plain text.
default: falseexample: false
max_resultsnumber
Most answers per question, highest score first, from 1 to 2,500.
default: 100example: 100

What's in each record

16 fields: 14 here, 2 technical ones under Technical details.

Basics

  • Question title

    Title of that question.

    Example Why is conditional processing of a sorted array faster than of an unsorted array?

  • Site

    Site the answer is on, as its domain, such as stackoverflow.com.

    Example stackoverflow.com

  • Score

    Upvotes minus downvotes.

    Example 35,296

  • Accepted

    Yes when the person who asked marked it as the accepted answer.

    Example Yes

  • Author display name

    Display name of the person who wrote the answer.

    Example Mysticial

  • Author reputation

    That author's reputation on the site.

    Example 473,523

  • Tags

    Tags of the question, such as java or c++.

    Example java, c++

  • Text excerpt

    The first 500 characters of the answer in plain text; only with include_text.

    Example You are a victim of branch prediction fail. What is Branch Prediction? Consider a railroad junction: Image by…

  • Content license

    License of the answer text, such as CC BY-SA 4.0.

    Example CC BY-SA 4.0

Dates

  • Created

    When the answer was posted (UTC).

    Example Jun 27, 2012

  • Last activity at

    Last edit or other activity on the answer (UTC).

    Example Mar 4, 2024

  • Last edited

    When the answer was last edited (UTC); empty when it never was.

    Example Mar 4, 2024

Technical detailsField names and types for developers, and the 2 fields hidden above

Hidden by default

These 2 fields come with each record too. They are internal codes, notes about how the record was read or a copy of what was searched for, so the lists above leave them out.

  • Answer ID answer_idId of the answer on its site.
  • Question ID question_idId of the question it answers.

Field names and types

The names your code reads in each record. "Filled" counts how many of the 3 sample records carry the field.

Field nameTypeShown on this page asFilled
answer_idtextAnswer ID (hidden)3 of 3
question_idtextQuestion ID (hidden)3 of 3
question_titletextQuestion title3 of 3
sitetextSite3 of 3
urllinkLink3 of 3
scorenumberScore3 of 3
is_acceptedyes or noAccepted3 of 3
created_atdate and timeCreated3 of 3
last_activity_atdate and timeLast activity at3 of 3
last_edited_atdate and timeLast edited3 of 3
author_display_nametextAuthor display name3 of 3
author_reputationnumberAuthor reputation3 of 3
author_urllinkAuthor link3 of 3
tagslistTags3 of 3
text_excerpttextText excerpt3 of 3
content_licensetextContent license3 of 3

How it reads the site

Runs on a reader we built and maintain by hand for this site.

Sample records

Sample records
RecordQuestion titleSiteScoreAcceptedAuthor display nameAuthor reputationTagsText excerptContent licenseCreatedLast activity atLast editedLinkAuthor link
1Why is conditional processing of a sorted array faster than of an unsorted array?stackoverflow.com35,296YesMysticial473,523java, c++, performance, cpu-architectureYou are a victim of branch prediction fail. What is Branch Prediction? Consider a railroad junction: Image by Mecanismo, via Wikimedia Commons. Used under the CC-By-SA 3.0 license. Now for the sake of argument, suppose this is back in the 1800s - before long-distance or radio…CC BY-SA 4.0Jun 27, 2012Mar 4, 2024Mar 4, 2024stackoverflow.com/questions/11227809/why-is-conditional-processing-of-a-sorted-array-faster-than-of-an-unsorted-array/11227902stackoverflow.com/users/922184/mysticial
2Why is conditional processing of a sorted array faster than of an unsorted array?stackoverflow.com4,767NoDaniel Fischer184,654java, c++, performance, cpu-architectureBranch prediction. With 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.CC BY-SA 4.0Jun 27, 2012Aug 5, 2016Jun 20, 2020stackoverflow.com/questions/11227809/why-is-conditional-processing-of-a-sorted-array-faster-than-of-an-unsorted-array/11227877stackoverflow.com/users/1011995/daniel-fischer
3Why is conditional processing of a sorted array faster than of an unsorted array?stackoverflow.com3,860NoWiSaGaN48,437java, c++, performance, cpu-architectureThe reason why performance improves drastically when the data is sorted is that the branch prediction penalty is removed, as explained beautifully in Mysticial's answer . Now, if we look at the code if (data[c] >= 128) sum += data[c]; we can find that the meaning of this…CC BY-SA 4.0Jun 28, 2012Jul 3, 2022Jul 3, 2022stackoverflow.com/questions/11227809/why-is-conditional-processing-of-a-sorted-array-faster-than-of-an-unsorted-array/11237235stackoverflow.com/users/866732/wisagan

Sample records from the example output this API publishes. Email addresses and phone numbers in them are masked. Hover over a column name to see the field name your code reads.

Reliability

Counted from real runs. Our own health checks are left out. A run succeeded when it finished and the site neither blocked it nor broke it.

Incidents and repairs

How it is kept working What a repair can't do

A ready-made API, maintained by us. It is not part of the daily check or the automatic rebuild yet.

  • You pay only for records returned. A run that returns none costs nothing.
Known limits
  • Stack Exchange allows 300 requests a day per address without a key, shared with everyone calling from that address; when it is used up the run stops with a note. Up to 100 questions on one site go in a single request, so send links in batches.
  • Answers come highest score first within each group of up to 100 questions on the same site, and each group returns at most 2,500 answers; question_id ties every answer to its question.
  • text_excerpt holds only the first 500 characters of the answer in plain text, and only with include_text; open url for the full answer.
  • With no links, the newest answers on site are returned, up to 2,500 per run.
  • Deleted answers and answers to deleted questions are not returned. Scores, dates and reputation are as of the time of the run.
  • Answers are licensed CC BY-SA by their authors: credit the author (author_display_name and author_url) and link to the answer (url) when you publish them.

Version history

A run uses the live version unless the request names another one with version.