Skip to main content
edited body
Source Link
Glorfindel
  • 6.9k
  • 3
  • 22
  • 49

(I've included the 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

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:

  1. 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.

  2. 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.

(I've included the becuase 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

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:

  1. 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.

  2. 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.

(I've included the because 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

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:

  1. 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.

  2. 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.

Source Link
Enlico
  • 197
  • 6

How can I retrieve the reputation I (or another user, fwiw) earned for a given tag from questions and answers?

(I've included the becuase 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

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:

  1. 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.

  2. 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.