I use https://api.stackexchange.com/docs. To get a sample question, I use the address https://api.stackexchange.com/2.2/questions/6827752?&site=stackoverflow. Thanks to this, he gains a question. The following page shows https://api.stackexchange.com/docs/types/question that with the default filter the question will not have a body. I know I use a filter to get a body filter=withbody that is, the address comes out


Now I would like to get answers for the question. That's why I want to use a filter filter=withanswers. This address


returns an error

  "error_id": 400,
  "error_message": "Invalid filter specified",
  "error_name": "bad_parameter"

How do get answers or comments using a filter?


1 Answer 1


You have to use a custom filter, the default provided filters are not going to cut it.

Here is an example for question id 4 on Stack Overflow


The filter value !-y(KwOdKR5Ga7mmruVArx2SJykc-M)3jKiDQBk1fq will return questions, answers and their comments.

See my answer on How to create API filters? to learn how to create filters in the UI.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .