{"api":{"id":"api_54a61c8c822e613d3f109bc0","slug":"stack-exchange-answers","name":"Stack Exchange Answers","description":"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.","kind":"ready_made","visibility":"public","domain":"stackexchange.com","source_url":"https://api.stackexchange.com/docs","category":"developer","record_type":"post","active_version":"1.0","units_per_1k":500,"health":"unknown","auto_repair":false,"last_checked_at":null,"last_run_at":null,"fields_count":16,"created_at":"2026-12-06T03:33:09.254Z","updated_at":"2026-12-06T03:33:09.254Z","runnable":true,"egress":null,"repairs":[],"repairs_total":0,"how":"Runs on a reader we built and maintain by hand for this site.","fields":[{"name":"answer_id","type":"string","description":"Id of the answer on its site.","required":true,"coverage":1,"example":"11227902"},{"name":"question_id","type":"string","description":"Id of the question it answers.","required":false,"coverage":1,"example":"11227809"},{"name":"question_title","type":"string","description":"Title of that question.","required":false,"coverage":1,"example":"Why is conditional processing of a sorted array faster than of an unsorted array?"},{"name":"site","type":"string","description":"Site the answer is on, as its domain, such as stackoverflow.com.","required":true,"coverage":1,"example":"stackoverflow.com"},{"name":"url","type":"url","description":"Link to the answer.","required":false,"coverage":1,"example":"https://stackoverflow.com/questions/11227809/why-is-conditional-processing-of-a-sorted-array-faster-than-of-an-unsorted-…"},{"name":"score","type":"integer","description":"Upvotes minus downvotes.","required":false,"coverage":1,"example":35296},{"name":"is_accepted","type":"boolean","description":"True when the person who asked marked it as the accepted answer.","required":false,"coverage":1,"example":true},{"name":"created_at","type":"datetime","description":"When the answer was posted (UTC).","required":false,"coverage":1,"example":"2012-06-27T13:56:42.000Z"},{"name":"last_activity_at","type":"datetime","description":"Last edit or other activity on the answer (UTC).","required":false,"coverage":1,"example":"2024-03-04T17:37:13.000Z"},{"name":"last_edited_at","type":"datetime","description":"When the answer was last edited (UTC); empty when it never was.","required":false,"coverage":1,"example":"2024-03-04T17:37:13.000Z"},{"name":"author_display_name","type":"string","description":"Display name of the person who wrote the answer.","required":false,"coverage":1,"example":"Mysticial"},{"name":"author_reputation","type":"integer","description":"That author's reputation on the site.","required":false,"coverage":1,"example":473523},{"name":"author_url","type":"url","description":"The author's profile page on the site, for the CC BY-SA credit.","required":false,"coverage":1,"example":"https://stackoverflow.com/users/922184/mysticial"},{"name":"tags","type":"array","description":"Tags of the question, such as java or c++.","required":false,"coverage":1,"example":["java","c++"]},{"name":"text_excerpt","type":"string","description":"The first 500 characters of the answer in plain text; only with include_text.","required":false,"coverage":1,"example":"You are a victim of branch prediction fail.\nWhat is Branch Prediction?\nConsider a railroad junction:\nImage by…"},{"name":"content_license","type":"string","description":"License of the answer text, such as CC BY-SA 4.0.","required":false,"coverage":1,"example":"CC BY-SA 4.0"}],"inputs":[{"name":"question_links","type":"array","description":"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"]},{"name":"site","type":"string","description":"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":"stackoverflow","example":"stackoverflow"},{"name":"include_text","type":"boolean","description":"Add the first 500 characters of each answer as plain text.","default":false,"example":false},{"name":"max_results","type":"integer","description":"Most answers per question, highest score first, from 1 to 2,500.","default":100,"example":100}],"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":true,"properties":{"answer_id":{"description":"Id of the answer on its site.","type":"string"},"author_display_name":{"description":"Display name of the person who wrote the answer.","type":"string"},"author_reputation":{"description":"That author's reputation on the site.","type":"integer"},"author_url":{"description":"The author's profile page on the site, for the CC BY-SA credit.","format":"uri","type":"string"},"content_license":{"description":"License of the answer text, such as CC BY-SA 4.0.","type":"string"},"created_at":{"description":"When the answer was posted (UTC).","format":"date-time","type":"string"},"is_accepted":{"description":"True when the person who asked marked it as the accepted answer.","type":"boolean"},"last_activity_at":{"description":"Last edit or other activity on the answer (UTC).","format":"date-time","type":"string"},"last_edited_at":{"description":"When the answer was last edited (UTC); empty when it never was.","format":"date-time","type":"string"},"question_id":{"description":"Id of the question it answers.","type":"string"},"question_title":{"description":"Title of that question.","type":"string"},"score":{"description":"Upvotes minus downvotes.","type":"integer"},"site":{"description":"Site the answer is on, as its domain, such as stackoverflow.com.","type":"string"},"tags":{"description":"Tags of the question, such as java or c++.","type":"array"},"text_excerpt":{"description":"The first 500 characters of the answer in plain text; only with include_text.","type":"string"},"url":{"description":"Link to the answer.","format":"uri","type":"string"}},"required":["answer_id","site"],"title":"Stack Exchange Answers","type":"object"},"samples":[{"answer_id":"11227902","question_id":"11227809","question_title":"Why is conditional processing of a sorted array faster than of an unsorted array?","site":"stackoverflow.com","url":"https://stackoverflow.com/questions/11227809/why-is-conditional-processing-of-a-sorted-array-faster-than-of-an-unsorted-array/11227902#11227902","score":35296,"is_accepted":true,"created_at":"2012-06-27T13:56:42.000Z","last_activity_at":"2024-03-04T17:37:13.000Z","last_edited_at":"2024-03-04T17:37:13.000Z","author_display_name":"Mysticial","author_reputation":473523,"author_url":"https://stackoverflow.com/users/922184/mysticial","tags":["java","c++","performance","cpu-architecture"],"text_excerpt":"You are a victim of branch prediction fail.\nWhat is Branch Prediction?\nConsider a railroad junction:\nImage by Mecanismo, via Wikimedia Commons. Used under the CC-By-SA 3.0 license.\nNow for the sake of argument, suppose this is back in the 1800s - before long-distance or radio…","content_license":"CC BY-SA 4.0"},{"answer_id":"11227877","question_id":"11227809","question_title":"Why is conditional processing of a sorted array faster than of an unsorted array?","site":"stackoverflow.com","url":"https://stackoverflow.com/questions/11227809/why-is-conditional-processing-of-a-sorted-array-faster-than-of-an-unsorted-array/11227877#11227877","score":4767,"is_accepted":false,"created_at":"2012-06-27T13:54:45.000Z","last_activity_at":"2016-08-05T07:53:10.000Z","last_edited_at":"2020-06-20T09:12:55.000Z","author_display_name":"Daniel Fischer","author_reputation":184654,"author_url":"https://stackoverflow.com/users/1011995/daniel-fischer","tags":["java","c++","performance","cpu-architecture"],"text_excerpt":"Branch prediction.\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.","content_license":"CC BY-SA 4.0"},{"answer_id":"11237235","question_id":"11227809","question_title":"Why is conditional processing of a sorted array faster than of an unsorted array?","site":"stackoverflow.com","url":"https://stackoverflow.com/questions/11227809/why-is-conditional-processing-of-a-sorted-array-faster-than-of-an-unsorted-array/11237235#11237235","score":3860,"is_accepted":false,"created_at":"2012-06-28T02:14:03.000Z","last_activity_at":"2022-07-03T15:12:52.000Z","last_edited_at":"2022-07-03T15:12:52.000Z","author_display_name":"WiSaGaN","author_reputation":48437,"author_url":"https://stackoverflow.com/users/866732/wisagan","tags":["java","c++","performance","cpu-architecture"],"text_excerpt":"The 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 .\nNow, if we look at the code\nif (data[c] >= 128)\nsum += data[c];\nwe can find that the meaning of this…","content_license":"CC BY-SA 4.0"}],"validation":{"checked_at":"2026-12-06T03:33:09.177Z","field_coverage":{"answer_id":1,"author_display_name":1,"author_reputation":1,"author_url":1,"content_license":1,"created_at":1,"is_accepted":1,"last_activity_at":1,"last_edited_at":1,"question_id":1,"question_title":1,"score":1,"site":1,"tags":1,"text_excerpt":1,"url":1},"fresh_read":false,"identity_unique":true,"issues":["Imported from a hand-built source. Field names and types come from its published schema; no live read was made for this check."],"level":"preview","pages_checked":0,"passed":true,"records_checked":3},"links":{"run":"https://pullrow.dev/v1/apis/api_54a61c8c822e613d3f109bc0/run","openapi":"https://pullrow.dev/v1/apis/api_54a61c8c822e613d3f109bc0/openapi.json","contract":"https://pullrow.dev/v1/apis/api_54a61c8c822e613d3f109bc0/contract.json","page":"https://pullrow.dev/catalog/stack-exchange-answers"},"runs_30d":0,"success_rate_30d":null,"price_per_1k_usd":0.5,"featured":false,"reliability":{"window_days":30,"runs":0,"completed":0,"succeeded":0,"failed":0,"success_rate":null,"last_run_at":null},"demo":{"available":false,"max_records":0,"reason":"Every run of this API costs us money, so it has no free live demo. The sample records on its page show what it returns.","code":"demo_not_available"},"meta":{"limitations":["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."]},"plain":{"summary":null,"source":"rules","fields":[{"name":"answer_id","label":"Answer ID","description":"Id of the answer on its site.","group":"Technical","shown":false,"written":false},{"name":"question_id","label":"Question ID","description":"Id of the question it answers.","group":"Technical","shown":false,"written":false},{"name":"question_title","label":"Question title","description":"Title of that question.","group":"Basics","shown":true,"written":false},{"name":"site","label":"Site","description":"Site the answer is on, as its domain, such as stackoverflow.com.","group":"Basics","shown":true,"written":false},{"name":"url","label":"Link","description":"Link to the answer.","group":"Links","shown":true,"written":false},{"name":"score","label":"Score","description":"Upvotes minus downvotes.","group":"Basics","shown":true,"written":false},{"name":"is_accepted","label":"Accepted","description":"Yes when the person who asked marked it as the accepted answer.","group":"Basics","shown":true,"written":false},{"name":"created_at","label":"Created","description":"When the answer was posted (UTC).","group":"Dates","shown":true,"written":false},{"name":"last_activity_at","label":"Last activity at","description":"Last edit or other activity on the answer (UTC).","group":"Dates","shown":true,"written":false},{"name":"last_edited_at","label":"Last edited","description":"When the answer was last edited (UTC); empty when it never was.","group":"Dates","shown":true,"written":false},{"name":"author_display_name","label":"Author display name","description":"Display name of the person who wrote the answer.","group":"Basics","shown":true,"written":false},{"name":"author_reputation","label":"Author reputation","description":"That author's reputation on the site.","group":"Basics","shown":true,"written":false},{"name":"author_url","label":"Author link","description":"The author's profile page on the site, for the CC BY-SA credit.","group":"Links","shown":true,"written":false},{"name":"tags","label":"Tags","description":"Tags of the question, such as java or c++.","group":"Basics","shown":true,"written":false},{"name":"text_excerpt","label":"Text excerpt","description":"The first 500 characters of the answer in plain text; only with include_text.","group":"Basics","shown":true,"written":false},{"name":"content_license","label":"Content license","description":"License of the answer text, such as CC BY-SA 4.0.","group":"Basics","shown":true,"written":false}],"inputs":[{"name":"question_links","label":"Question links","help":"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","written":false},{"name":"site","label":"Site","help":"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","written":false},{"name":"include_text","label":"Include text","help":"Add the first 500 characters of each answer as plain text.","example":"false","written":false},{"name":"max_results","label":"Maximum results","help":"Most answers per question, highest score first, from 1 to 2,500.","example":"100","written":false}]}},"incidents":[]}