7

How do I get my total reputation score?
My score is 354, on Stack Overflow, as per my user page.

I browsed the API, and found a call similar to what I require:

      api.stackexchange.com/2.2/users/5232935/reputation?site=stackoverflow

However, when I add up the reputation score, it sums up to just 251, which is not equal to my total reputation.

Do we have any API call to get the total score?

1 Answer 1

9

Just use the plain /users/{ids} route. (For network-wide score, see the bottom section, below.)

if you run it on your userid, it currently returns:

{  "items": [  {
    ...
    "reputation": 354,
    ...

Which is what you expected.


The route you used, /users/{ids}/reputation, has a different purpose. Refer to its doc page:

Gets a subset of the reputation changes for users in {ids}.

Reputation changes are intentionally scrubbed of some data to make it difficult to correlate votes on particular posts with user reputation changes. That being said, this method returns enough data for reasonable display of reputation trends.

(emphasis added)

What this "scrubbing" is, is not adequately documented, but from observation it seems:

  1. Any account association bonus is not listed.
  2. The default 1 rep, every user has, is not listed.
  3. It seems like some (random? recent?) downvote penalties will be added or omitted, to make vote correlation harder.



From this question's title, people may assume that you wanted the user's entire, Stack Exchange wide, score -- as shown on his flair.

To get that, do the following:

  1. Get your network ID. Go to stackexchange.com/users/current, and your ID will be in the redirected-to URL.
  2. Plug that id into the API's /users/{ids}/associated route.
    For example, for the OP we currently get:

    "items": [ {
          "reputation": 354,
          "site_name": "Stack Overflow"
        }, {
          "reputation": 101,
          "site_name": "Ask Ubuntu"
        }, {
          "reputation": 101,
          "site_name": "Stack Apps"
        }
    
  3. Loop through the results, processing the reputation as follows:
    A) Discard any reputation scores less than 200.
    B) Any meta reputation never counts. Meta Stack Exchange is the sole exception.
    C) Sum up the remaining reputation values. In the OP's case, the result is 354.

3
  • 1
    Excellent. I got exactly what I require using the /users/{ids} route. Now, I get the reason for the difference.
    – kensplanet
    Commented Jun 27, 2016 at 12:47
  • Do you have a example for use how test?
    – simon
    Commented Feb 7, 2018 at 17:19
  • @3lmo, Ask a new question if you need to. Commented Feb 7, 2018 at 18:05

You must log in to answer this question.

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