(I've included the api-v2.3 becuasebecause https://api.stackexchange.com/docs starts with Stack Exchange API v2.3.)
From this answer I see there's no way to get all questions with a specific tag.
However, what about all questions/answers asked/answered by a user with a specific tag?
To avoid this question to be an example of the XY problem, I want to clarify that my final target is to be able to show on a personal site the reputation I earned on this or that tag.
I see the API provides
- a
/users/{ids}/questions
method to query for all questions from given user identities; - a
/users/{ids}/answers
method to query for all answers from given user identities; - a
/questions/{ids}
method to query for a question given its id.
On the one hand, questions come with a tags
field, whereas answers do not. On the other hand, answers come with a question_id
.
Therefore, I think I could do the following:
For questions
1.1. make the
/users/{ids}/questions
request;1.2 filter the obtained questions based on a specific tag;
1.3. extract the
score
field from each question;1.4. sum up all entries.
For answers
2.1 make the
/users/{ids}/answers
request;2.2 for each of them, get the
question_id
;2.3 for each
question_id
, make a new request using the/questions/{ids}
method;2.4 on the array of questions, apply steps from 1.2 to 1.4 above.
Then the two amounts would be added up and multiplied by 10.
However, before venturing, I'd like some feedback on whether I'm taking the correct route or not.