Stack Overflow User Answers API
Every answer one user has given, with the question title, score, accepted flag and optional answer text.
GET /v1/stack-overflow/users/{memberId}/answers1 credit Failed requests are free
About this endpoint
GET /v1/stack-overflow/users/{memberId}/answers returns a page of answers by one user. Each answer has id, questionId, questionTitle, tags (empty on this list because it does not carry the question's tags), url, score, votes, isAccepted, author, lastEditor, license, commentCount and the creation, activity and edit times.
Sort by activity (the default), creation or votes. Add include=body for bodyHtml and bodyMarkdown; with it, limit is at most 25. Only creation pages without a ceiling. A sort other than creation returns up to 2,500 rows and then stops with limitReached (625 with include=body); on a user with more than 2,500 answers it stops after the first 100 rows (25 with include=body). Rows with equal scores can repeat or skip on those sorts; use creation to walk the list. A user with no answers is found with an empty list; a user id that does not exist is not_found.
Stack Overflow User Answers API FAQ
How do I get the answer text?
Add include=body. Each row then has bodyHtml and bodyMarkdown, and limit is capped at 25 rows per page.
How many credits does a page cost?
Pricing is documented on the operation in the API registry (shown on this page). Confirm on every response with meta.creditsCharged: that field is the billing source of truth. Each paginated page is a separate billed request.
How is an empty list different from not_found?
A real user with no answers is lookupStatus found with data.answers empty. A user id that does not exist is lookupStatus not_found with the same empty list, so read the status.
Which sort walks every answer?
sort=creation. For a user with more than 2,500 answers, activity and votes return the first 100 rows in pages of limit and then set limitReached; on smaller accounts they stop at 2,500 rows (625 with include=body). Rows with equal scores can repeat or skip on activity and votes.
Other Stack Overflow endpoints
- QuestionGET /v1/stack-overflow/questions/{questionId}
- Questions by idGET /v1/stack-overflow/questions/batch
- QuestionsGET /v1/stack-overflow/questions
- SearchGET /v1/stack-overflow/questions/search
- Similar titlesGET /v1/stack-overflow/questions/title-search
- AnswersGET /v1/stack-overflow/questions/{questionId}/answers
- CommentsGET /v1/stack-overflow/posts/{postId}/comments
- Comments by postGET /v1/stack-overflow/posts/comments