{"operation":"questions/search","version":"1.0.1","status":"pilot","title":"Search questions","summary":"One page of a Stack Overflow search, up to 100 questions, each whole: its text, every answer and every comment, the votes, views, tags, authors, and why it is closed when it is.","use_when":"You need what Stack Overflow's developers asked and answered about something: search its questions by words, by tags (every tag given), by words of the title or the body, by author, by a link they hold, by date, by how many answers or views they have, or by whether they are answered, closed, migrated or community wiki. Each question comes whole in the same call: its text in HTML and in Markdown, every answer (the accepted one says so) and every comment of both, with their scores, dates, authors and licence; no other call is needed to read them. Sort by relevance (Stack Overflow's own search), newest, latest activity or votes. Follow `next` for the following page: a search goes to 25 pages of 100, 2,500 questions; narrow it by dates (`created_after`, `created_before`) to go further. For one question you already have, by its id or its link, use stackoverflow/questions/get.","categories":["Developers"],"icon":"question_lens","source":"stackoverflow","input":{"type":"object","additionalProperties":false,"properties":{"query":{"type":"string","minLength":1,"maxLength":500,"description":"Words to search for, anywhere in a question (its title, its text, its tags), as Stack Overflow's own search reads them.","examples":["httpx timeout"]},"tags":{"type":"array","items":{"type":"string","pattern":"^[A-Za-z0-9#+.\\-]{1,35}$"},"minItems":1,"maxItems":5,"description":"Tags the questions must have, all of them (python and asyncio: the questions tagged both), as Stack Overflow writes them (python, c++, asp.net-core). A question has at most five.","examples":[["python","python-asyncio"]]},"excluded_tags":{"type":"array","items":{"type":"string","pattern":"^[A-Za-z0-9#+.\\-]{1,35}$"},"minItems":1,"maxItems":10,"description":"Tags the questions must not have, none of them. Needs another criterion beside it (words, tags...).","examples":[["django"]]},"title":{"type":"string","minLength":1,"maxLength":500,"description":"Words the question's title must hold, whole, side by side and in this order: `connection pool` finds \"Connection pool is full\", not \"Pool of connections\"; `timeout` does not find \"ReadTimeout\". To find a subject, `query` reaches further.","examples":["connection pool"]},"body":{"type":"string","minLength":1,"maxLength":500,"description":"Words the question's text must hold, whole, side by side and in this order (`read timeout`, not `timeout read`). To find a subject, `query` reaches further.","examples":["read timeout"]},"user":{"type":["integer","string"],"description":"The questions of one author: their user id on Stack Overflow (22656), or the address of their profile (https://stackoverflow.com/users/22656/...).","examples":[22656]},"mentions_url":{"type":"string","minLength":1,"maxLength":500,"description":"A link that the question or one of its answers holds; `*` stands for any part of it (https://github.com/encode/httpx*).","examples":["https://github.com/encode/httpx*"]},"has_accepted_answer":{"type":"boolean","description":"True for the questions with an accepted answer only, false for those without. Both when left out."},"is_closed":{"type":"boolean","description":"True for the closed questions only (duplicates, off-topic...), false for the open ones. Both when left out."},"is_migrated":{"type":"boolean","description":"True for the questions moved from Stack Overflow to another Stack Exchange site only, false for the others. Both when left out."},"has_notice":{"type":"boolean","description":"True for the questions with a moderator's notice only (a lock, a call for better answers...), false for the others. Both when left out."},"is_wiki":{"type":"boolean","description":"True for the community wiki questions only, false for the others. Both when left out."},"answers_min":{"type":"integer","minimum":0,"description":"The questions with at least this many answers.","examples":[1]},"views_min":{"type":"integer","minimum":0,"description":"The questions viewed at least this many times.","examples":[1000]},"created_after":{"type":"string","description":"The questions asked from this date on (2024-01-31, from its midnight UTC) or from this instant (2024-01-31T12:00:00Z).","examples":["2024-01-01"]},"created_before":{"type":"string","description":"The questions asked before this date (before its midnight UTC: 2025-02-01 keeps January 31 whole) or this instant. A month is its first day in `created_after` and the next month's here: 2025-01-01 and 2025-02-01.","examples":["2025-01-01"]},"sort":{"enum":["relevance","newest","activity","votes"],"default":"relevance","description":"The order of the questions: relevance, Stack Overflow's own search order; newest, the latest asked first; activity, the latest answered, commented or edited first; votes, the highest scored first among every question that matches, however loosely (with `query`, popular questions that only mention the words come first). For the most voted on a subject, sort by relevance and compare their `score`."},"order":{"enum":["desc","asc"],"default":"desc","description":"The sort's direction, desc as each sort says or asc to reverse it (the oldest first, the lowest scored first)."},"page":{"type":"integer","minimum":1,"maximum":25,"default":1,"description":"The page to start at, 100 questions a page; `next` goes on from there, to page 25."},"cursor":{"type":"string","pattern":"^[A-Za-z0-9_=-]{40,8000}$","description":"Where to go on, from `next` in an answer, as it is: opaque, and only for the search it was given with (otherwise `invalid_cursor`)."}}},"pagination":{"style":"page","page_size":100,"next":{"query":"<as it was written>","cursor":"<opaque>"},"last_page":25},"record":{"type":"object","additionalProperties":false,"required":["object","position","id","ids","url","share_url","title","tags","body_html","body_markdown","score","upvote_count","downvote_count","favorite_count","view_count","answer_count","comment_count","is_answered","accepted_answer_id","close_vote_count","reopen_vote_count","delete_vote_count","created_at","last_activity_at","last_edited_at","owner","last_editor","closed","locked_at","protected_at","community_owned_at","bounty","notice","migrated_from","migrated_to","content_license","answers","comments","source_url","observed_at"],"$defs":{"user":{"type":["object","null"],"description":"A user as a post shows them; null when the post has none. A deleted user keeps a name, the type `does_not_exist` and no id; the Community user, which owns what nobody does, is -1.","additionalProperties":false,"required":["id","account_id","name","url","avatar_url","type","reputation","accept_rate","badges"],"properties":{"id":{"type":["integer","null"],"description":"The user's id on Stack Overflow."},"account_id":{"type":["integer","null"],"description":"Their network account's id, the same on every Stack Exchange site."},"name":{"type":["string","null"],"description":"Their display name, as written."},"url":{"type":["string","null"],"description":"Their profile on Stack Overflow."},"avatar_url":{"type":["string","null"]},"type":{"type":["string","null"],"description":"registered, unregistered, moderator, team_admin or does_not_exist (deleted)."},"reputation":{"type":["integer","null"]},"accept_rate":{"type":["integer","null"],"description":"The share of their questions' answers they accepted, in percent, when Stack Overflow shows it."},"badges":{"type":["object","null"],"additionalProperties":false,"required":["gold","silver","bronze"],"properties":{"gold":{"type":["integer","null"]},"silver":{"type":["integer","null"]},"bronze":{"type":["integer","null"]}}}}},"comment":{"type":"object","additionalProperties":false,"required":["id","url","body_html","body_markdown","score","is_edited","created_at","owner","reply_to_user","content_license"],"properties":{"id":{"type":"integer"},"url":{"type":["string","null"]},"body_html":{"type":["string","null"],"description":"The comment as the page shows it, in HTML."},"body_markdown":{"type":["string","null"],"description":"The comment as its author wrote it, in Markdown."},"score":{"type":["integer","null"],"description":"Its upvotes (comments have no downvotes)."},"is_edited":{"type":["boolean","null"]},"created_at":{"type":["string","null"],"format":"date-time"},"owner":{"$ref":"#/$defs/user"},"reply_to_user":{"$ref":"#/$defs/user","description":"The user the comment answers (@name), when it answers one."},"content_license":{"type":["string","null"],"description":"CC BY-SA 4.0, 3.0 or 2.5, by the date it was written."}}},"collective":{"type":["object","null"],"description":"A collective of Stack Overflow: a company's or a technology's space on the site (Google Cloud, Microsoft Azure).","additionalProperties":false,"required":["name","slug","url","description","external_links"],"properties":{"name":{"type":["string","null"]},"slug":{"type":["string","null"]},"url":{"type":["string","null"]},"description":{"type":["string","null"]},"external_links":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["type","url"],"properties":{"type":{"type":["string","null"],"description":"website, twitter, github, facebook, instagram, support or linkedin."},"url":{"type":["string","null"]}}}}}},"migration":{"type":["object","null"],"additionalProperties":false,"required":["question_id","site","migrated_at"],"properties":{"question_id":{"type":["integer","null"],"description":"The question's id on the other site."},"site":{"type":["object","null"],"additionalProperties":false,"required":["name","url","api_site_parameter"],"properties":{"name":{"type":["string","null"],"description":"Unix & Linux, Super User..."},"url":{"type":["string","null"]},"api_site_parameter":{"type":["string","null"],"description":"The site's name in the Stack Exchange API (unix, superuser)."}}},"migrated_at":{"type":["string","null"],"format":"date-time"}}}},"properties":{"object":{"const":"question"},"position":{"type":"integer","minimum":1,"description":"The question's rank in the search, across pages."},"id":{"type":"integer","description":"The question's id on Stack Overflow, as in its address."},"ids":{"type":"object","additionalProperties":false,"required":["question_id"],"properties":{"question_id":{"type":"integer"}}},"url":{"type":["string","null"],"description":"The question's page."},"share_url":{"type":["string","null"],"description":"Its short link (stackoverflow.com/q/<id>)."},"title":{"type":["string","null"],"description":"As written, not HTML-escaped."},"tags":{"type":"array","items":{"type":"string"}},"body_html":{"type":["string","null"],"description":"The question as the page shows it, in HTML."},"body_markdown":{"type":["string","null"],"description":"The question as its author wrote it, in Markdown."},"score":{"type":["integer","null"],"description":"Upvotes less downvotes."},"upvote_count":{"type":["integer","null"]},"downvote_count":{"type":["integer","null"]},"favorite_count":{"type":["integer","null"],"description":"What the API counts as the question's favorites. Stack Overflow's saves are private, and this count is 0 on nearly every question however popular (273 of 274 read on 02/12/2026): not a measure of interest."},"view_count":{"type":["integer","null"]},"answer_count":{"type":["integer","null"]},"comment_count":{"type":["integer","null"]},"is_answered":{"type":["boolean","null"],"description":"Whether it has an accepted answer or an answer scored above 0."},"accepted_answer_id":{"type":["integer","null"],"description":"The accepted answer's id, among `answers`."},"close_vote_count":{"type":["integer","null"],"description":"Votes to close it, cast and pending."},"reopen_vote_count":{"type":["integer","null"],"description":"Votes to reopen it, cast and pending."},"delete_vote_count":{"type":["integer","null"],"description":"Votes to delete it, cast and pending."},"created_at":{"type":["string","null"],"format":"date-time"},"last_activity_at":{"type":["string","null"],"format":"date-time","description":"Its last answer, comment or edit."},"last_edited_at":{"type":["string","null"],"format":"date-time"},"owner":{"$ref":"#/$defs/user","description":"Who asked it."},"last_editor":{"$ref":"#/$defs/user","description":"Who edited it last."},"closed":{"type":["object","null"],"description":"Why and by whom the question is closed; null while it is open.","additionalProperties":false,"required":["closed_at","reason","description_html","by_users","original_questions"],"properties":{"closed_at":{"type":["string","null"],"format":"date-time"},"reason":{"type":["string","null"],"description":"Duplicate, Opinion-based, Needs details or clarity..."},"description_html":{"type":["string","null"],"description":"The reason's own words, as the page shows them."},"by_users":{"type":"array","items":{"$ref":"#/$defs/user"},"description":"Who voted to close it."},"original_questions":{"type":"array","description":"The questions it repeats, for a duplicate.","items":{"type":"object","additionalProperties":false,"required":["id","url","title","answer_count","accepted_answer_id"],"properties":{"id":{"type":["integer","null"]},"url":{"type":["string","null"]},"title":{"type":["string","null"]},"answer_count":{"type":["integer","null"]},"accepted_answer_id":{"type":["integer","null"]}}}}}},"locked_at":{"type":["string","null"],"format":"date-time","description":"When a moderator locked it: no votes, answers or edits since."},"protected_at":{"type":["string","null"],"format":"date-time","description":"Since when only users with reputation may answer it."},"community_owned_at":{"type":["string","null"],"format":"date-time","description":"Since when it is a community wiki."},"bounty":{"type":["object","null"],"description":"An open bounty on the question; null when there is none.","additionalProperties":false,"required":["amount","closes_at","user"],"properties":{"amount":{"type":["integer","null"],"description":"Reputation offered."},"closes_at":{"type":["string","null"],"format":"date-time"},"user":{"$ref":"#/$defs/user","description":"Who offered it."}}},"notice":{"type":["object","null"],"description":"A moderator's notice on the question (a lock's reason, a call for better answers); null when there is none.","additionalProperties":false,"required":["body_html","created_at","owner_user_id"],"properties":{"body_html":{"type":["string","null"]},"created_at":{"type":["string","null"],"format":"date-time"},"owner_user_id":{"type":["integer","null"],"description":"The id of the user who set it."}}},"migrated_from":{"$ref":"#/$defs/migration","description":"Where the question was moved from, when it came from another Stack Exchange site."},"migrated_to":{"$ref":"#/$defs/migration","description":"Where it was moved to, when Stack Overflow sent it to another site."},"content_license":{"type":["string","null"],"description":"The question's licence (CC BY-SA 4.0), when the API says it: on few questions (1 of 153 on 02/12), where its answers and comments always do."},"answers":{"type":"array","description":"Every answer, whole, in the API's order.","items":{"type":"object","additionalProperties":false,"required":["id","url","share_url","body_html","body_markdown","score","upvote_count","downvote_count","is_accepted","created_at","last_activity_at","last_edited_at","locked_at","community_owned_at","owner","last_editor","bounty_awarded","recommended_by","posted_by_collectives","content_license","comment_count","comments"],"properties":{"id":{"type":"integer"},"url":{"type":["string","null"]},"share_url":{"type":["string","null"],"description":"Its short link (stackoverflow.com/a/<id>)."},"body_html":{"type":["string","null"]},"body_markdown":{"type":["string","null"]},"score":{"type":["integer","null"]},"upvote_count":{"type":["integer","null"]},"downvote_count":{"type":["integer","null"]},"is_accepted":{"type":["boolean","null"]},"created_at":{"type":["string","null"],"format":"date-time"},"last_activity_at":{"type":["string","null"],"format":"date-time"},"last_edited_at":{"type":["string","null"],"format":"date-time"},"locked_at":{"type":["string","null"],"format":"date-time"},"community_owned_at":{"type":["string","null"],"format":"date-time"},"owner":{"$ref":"#/$defs/user"},"last_editor":{"$ref":"#/$defs/user"},"bounty_awarded":{"type":["object","null"],"description":"The bounty the answer won; null when it won none.","additionalProperties":false,"required":["amount","users"],"properties":{"amount":{"type":["integer","null"],"description":"Reputation won."},"users":{"type":"array","items":{"$ref":"#/$defs/user"},"description":"Who awarded it."}}},"recommended_by":{"type":"array","description":"The collectives that recommend the answer, and since when.","items":{"type":"object","additionalProperties":false,"required":["collective","recommended_at"],"properties":{"collective":{"$ref":"#/$defs/collective"},"recommended_at":{"type":["string","null"],"format":"date-time"}}}},"posted_by_collectives":{"type":"array","items":{"$ref":"#/$defs/collective"},"description":"The collectives the answer was posted for."},"content_license":{"type":["string","null"]},"comment_count":{"type":["integer","null"]},"comments":{"type":"array","items":{"$ref":"#/$defs/comment"}}}}},"comments":{"type":"array","items":{"$ref":"#/$defs/comment"},"description":"The question's own comments."},"source_url":{"type":"string","description":"The API call the question was read from."},"observed_at":{"type":"string","format":"date-time"}}},"price":{"credits_per_call":1,"description":"1 credit a call, one page of up to 100 questions, each whole with its answers and comments. An empty page and a failed call are free.","free":["empty","failed"]},"deadline":{"default_s":30,"max_s":60},"errors":[{"code":"invalid_input","status":422,"detail":true,"message":"Pass the criteria Stack Overflow's search takes: words, tags as Stack Overflow writes them, an author's id or profile, dates (2024-01-31), and a page from 1 to 25."},{"code":"ip_blocked","status":503,"retryable":true,"retry_after":60,"message":"Stack Overflow's API refused the IPs tried for today. Retry later; failed calls are free."},{"code":"site_unavailable","status":503,"retryable":true,"message":"Stack Overflow's API did not answer properly; retry later (not charged)."},{"code":"unexpected_answer","status":424,"retryable":false,"message":"Stack Overflow's API answered in a shape we do not read yet; we are told and fix it (not charged)."}],"examples":[{"request":{"query":"httpx timeout","tags":["python"],"sort":"votes"},"records":[{"object":"question","position":1,"id":10000001,"ids":{"question_id":10000001},"url":"https://stackoverflow.com/questions/10000001/how-do-i-set-a-timeout-on-an-httpx-request","share_url":"https://stackoverflow.com/q/10000001","title":"How do I set a timeout on an httpx request?","tags":["python","httpx"],"body_html":"<p>My request hangs forever when the server does not answer. How do I set a timeout?</p>\n","body_markdown":"My request hangs forever when the server does not answer. How do I set a timeout?","score":42,"upvote_count":43,"downvote_count":1,"favorite_count":0,"view_count":51200,"answer_count":1,"comment_count":1,"is_answered":true,"accepted_answer_id":10000002,"close_vote_count":0,"reopen_vote_count":0,"delete_vote_count":0,"created_at":"2024-03-14T09:26:53Z","last_activity_at":"2025-06-02T17:40:11Z","last_edited_at":"2024-03-14T10:02:31Z","owner":{"id":1000001,"account_id":2000001,"name":"Jane Doe","url":"https://stackoverflow.com/users/1000001/jane-doe","avatar_url":"https://www.gravatar.com/avatar/00000000000000000000000000000000?s=256&d=identicon&r=PG","type":"registered","reputation":1234,"accept_rate":80,"badges":{"gold":0,"silver":5,"bronze":12}},"last_editor":null,"closed":null,"locked_at":null,"protected_at":null,"community_owned_at":null,"bounty":null,"notice":null,"migrated_from":null,"migrated_to":null,"content_license":null,"answers":[{"id":10000002,"url":"https://stackoverflow.com/questions/10000001/how-do-i-set-a-timeout-on-an-httpx-request/10000002#10000002","share_url":"https://stackoverflow.com/a/10000002","body_html":"<p>Pass <code>timeout=10.0</code> to the client.</p>\n","body_markdown":"Pass `timeout=10.0` to the client.","score":57,"upvote_count":57,"downvote_count":0,"is_accepted":true,"created_at":"2024-03-14T09:41:07Z","last_activity_at":"2024-03-14T09:41:07Z","last_edited_at":null,"locked_at":null,"community_owned_at":null,"owner":{"id":1000003,"account_id":2000003,"name":"John Smith","url":"https://stackoverflow.com/users/1000003/john-smith","avatar_url":null,"type":"registered","reputation":48210,"accept_rate":null,"badges":{"gold":12,"silver":80,"bronze":120}},"last_editor":null,"bounty_awarded":null,"recommended_by":[],"posted_by_collectives":[],"content_license":"CC BY-SA 4.0","comment_count":0,"comments":[]}],"comments":[{"id":130000001,"url":"https://stackoverflow.com/questions/10000001/how-do-i-set-a-timeout-on-an-httpx-request#comment130000001_10000001","body_html":"Which version of httpx do you use?","body_markdown":"Which version of httpx do you use?","score":2,"is_edited":false,"created_at":"2024-03-14T09:30:12Z","owner":null,"reply_to_user":null,"content_license":"CC BY-SA 4.0"}],"source_url":"https://api.stackexchange.com/2.3/search/advanced?site=stackoverflow&page=1&pagesize=100&order=desc&sort=votes&q=httpx%20timeout&tagged=python&filter=tvdphAWpCmQIKKbhPRIUXwhmqHNHrzzUDek3PwM4rHR","observed_at":"2026-12-02T12:00:00Z"}]},{"request":{"tags":["python-asyncio"],"is_closed":true,"sort":"newest","cursor":"gAAAAABpLmEXAMPLEcursorSealedByTheApiDoNotReadIt0000000000"}}],"health":{"canaries":[{"query":"httpx timeout","min_records":80},{"tags":["python-asyncio"],"has_accepted_answer":true,"sort":"newest","min_records":80}],"required_fields":["id","url","title","tags","body_html","body_markdown","score","view_count","created_at"],"sparse":{"closed":"A closed question's reasons: a page sorted by relevance often holds none.","bounty":"An open bounty: few questions have one at a time.","notice":"A moderator's notice: a handful of questions in thousands.","migrated_from":"A question moved from another site: rare.","migrated_to":"A question moved to another site: rare.","locked_at":"A lock: a handful of questions in thousands.","content_license":"Said by the API on few questions (1 of 153 on 02/12)."}},"changelog":[{"version":"1.0.1","date":"2026-12-02","notes":"Descriptions only: `title` and `body` find their words whole, side by side and in that order; `created_before` ends before the date's midnight UTC; `votes` ranks every match by score, however loose."},{"version":"1.0.0","date":"2026-12-02","notes":"First version: one page of a Stack Overflow search, 100 questions, by words, tags, title, text, author, link, dates, answers, views and state, sorted by relevance, date, activity or votes; each question whole with its text in HTML and Markdown, every answer and every comment, their votes, dates, authors and licences, why it is closed, its bounty, notice and migration."}],"object":"operation","id":"stackoverflow/questions/search","site":{"title":"Stack Overflow","domain":"stackoverflow.com","color":"#F48024"}}