Get Stack Exchange Q&A Thread
stackexchange_get_threadFetch a complete Q&A thread — question body and all answers, accepted answer first then sorted by score, rendered as clean markdown with fenced code blocks. Accepts an integer question ID or a full Stack Exchange question URL (e.g. "https://stackoverflow.com/questions/11227809/why-is-processing-a-sorted-array-faster" or "11227809"). HTML is normalized to markdown automatically; attribution (author + link) included per CC BY-SA 4.0. Get question IDs from stackexchange_search_questions or stackexchange_get_tag_faq.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| site | No | Stack Exchange site — use the api_site_parameter value (e.g. "stackoverflow", "superuser"). Defaults to "stackoverflow". Must match the site where the question lives. Call stackexchange_list_sites to discover valid values. | stackoverflow |
| maxAnswers | No | Maximum number of answers to include (1–100, default 10). Answers are sorted: accepted first, then by score. | |
| questionIdOrUrl | Yes | Numeric question ID (e.g. "11227809") or a full Stack Exchange question URL (e.g. "https://stackoverflow.com/questions/11227809/why-is-processing-a-sorted-array-faster"). The integer immediately following /questions/ is extracted from URLs. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cap | No | The maxAnswers cap applied to this request. | |
| link | No | Direct URL to the question. | |
| tags | No | Tags applied to this question. | |
| error | No | Present when the call failed. Absent on success. | |
| score | No | Question score (upvotes minus downvotes). | |
| shown | No | Number of answers returned. | |
| title | No | Question title. | |
| answers | No | Answers sorted: accepted answer first, then by score descending. | |
| quotaMax | No | Maximum API quota calls per day (300 keyless, ~10,000 with API key). | |
| truncated | No | True when answers were capped at maxAnswers. | |
| authorLink | No | Question author profile URL when available. | |
| authorName | No | Question author display name when available. | |
| questionId | No | Numeric question ID — identifies this thread on the site. | |
| answerCount | No | Total answers the question has upstream. When greater than the returned answers[] length, more answers exist — raise maxAnswers to fetch them. | |
| authorUserId | No | Question author numeric user ID when available — pass to stackexchange_get_user to fetch the full profile. | |
| bodyMarkdown | No | Question body normalized from HTML to markdown. | |
| quotaRemaining | No | Remaining API quota calls for the current day. | |
| acceptedAnswerId | No | ID of the accepted answer when one exists. |