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:
- Any account association bonus is not listed.
- The default 1 rep, every user has, is not listed.
- 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:
- Get your network ID. Go to stackexchange.com/users/current, and your ID will be in the redirected-to URL.
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"
}
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.