The stackexchange API supports /users/{id}/tags/{tags}/top-answers which returns the top 30 answers a user has posted in response to questions with the given tags (see here). What query would I use to get all answers a user has posted in response to a certain tag? I tried /users/{id}/tags/{tags}/answers, but this is not a valid query.
-
2The API returns the top 20 answerers, not 30 as claimed. There is an open documentation bug on that issue.– Martijn PietersJun 18, 2014 at 18:11
-
Thank you for pointing that out. However, I'm trying to get all answers, not just the top answers. Is that possible? Reading through the docs, it seems to me that I would need to make multiple queries.– Jason BJun 18, 2014 at 18:13
-
You really have to use the api? Or would using data.stackexchange.com be an option?– reneJun 18, 2014 at 18:47
-
@rene I need to use it in a script. How would data.stackexchange.com help me?– Jason BJun 18, 2014 at 19:11
-
If it is not real-time you could export the result of a query to CSV but that is basically it.– reneJun 18, 2014 at 19:14
1 Answer
One way would be to grab all answers posted by a user and then client-side filter that down to the tags you want.
You can pass !9YdnSPSy.
as the filter to /users/{ids}/answers
to make sure tags are included in the output in addition to the default properties of the answer object or build a new filter by clicking "edit" here.
As a side note, API-related questions are usually best asked on Stack Apps.
-
Thanks for directing me to the proper site for future API questions. This works nicely for my purpose.– Jason BJun 18, 2014 at 20:35