I like how Area 51 shows users by their total reputation across all sites, as an indication of the user's general familiarity with the Stack Exchange format. Is it possible to get a list of all (or a subset) of users' total reputation? For example, if I wanted to know my ranking in this list, how could I query for this data?
6 Answers
You could use the API to query associated ids by first querying for your association_id
:
http://api.stackoverflow.com/0.8/users/{userId}
And get the association ID from there:
accept_rate: 100
association_id: "56541460-95df-4570-8911-e180125974ce"
user_questions_url: "/users/16587/questions"
user_answers_url: "/users/16587/answers"
Use that association_id
to query the api for your data across the sites:
http://api.stackoverflow.com/0.8/users/{id}/associated
This returns the following information:
* associated_users: [
o {
+ user_id: 16587
+ user_type: "registered"
+ display_name: "George Stocker"
+ reputation: 14929
+ on_site: {
# name: "Stack Overflow"
# logo_url: http://sstatic.net/so/img/logo.png
# api_endpoint: http://api.stackoverflow.com
# site_url: http://stackoverflow.com
# description: "Member of the StackExchange Network"
# icon_url: http://sstatic.net/so/apple-touch-icon.png
}
+ email_hash: "9ed3482ccbb461fbf8796b251caf8f4d"
}
o {
+ user_id: 394
+ user_type: "registered"
+ display_name: "George Stocker"
+ reputation: 118
+ on_site: {
# name: "Server Fault"
# logo_url: http://sstatic.net/sf/img/logo.png
# api_endpoint: http://api.serverfault.com
# site_url: http://serverfault.com
# description: "Member of the StackExchange Network"
# icon_url: http://sstatic.net/sf/apple-touch-icon.png
}
+ email_hash: "9ed3482ccbb461fbf8796b251caf8f4d"
}
o {
+ user_id: 1174
+ user_type: "registered"
+ display_name: "George Stocker"
+ reputation: 981
+ on_site: {
# name: "Super User"
# logo_url: http://sstatic.net/su/img/logo.png
# api_endpoint: http://api.superuser.com
# site_url: http://superuser.com
# description: "Member of the StackExchange Network"
# icon_url: http://sstatic.net/su/apple-touch-icon.png
}
+ email_hash: "9ed3482ccbb461fbf8796b251caf8f4d"
}
o {
+ user_id: 16587
+ user_type: "registered"
+ display_name: "George Stocker"
+ reputation: 11852
+ on_site: {
# name: "Stack Overflow Meta"
# logo_url: http://sstatic.net/mso/img/logo.png
# api_endpoint: http://api.meta.stackoverflow.com
# site_url: http://meta.stackoverflow.com
# description: "Member of the StackExchange Network"
# icon_url: http://sstatic.net/mso/apple-touch-icon.png
}
+ email_hash: "9ed3482ccbb461fbf8796b251caf8f4d"
}
o {
+ user_id: 707
+ user_type: "registered"
+ display_name: "George Stocker"
+ reputation: 101
+ on_site: {
# name: "Stack Apps"
# logo_url: http://sstatic.net/sa/img/logo.png
# api_endpoint: http://api.stackapps.com
# site_url: http://stackapps.com
# description: "Member of the StackExchange Network"
# icon_url: http://sstatic.net/sa/apple-touch-icon.png
}
+ email_hash: "9ed3482ccbb461fbf8796b251caf8f4d"
}
]
-
-
-
@jjnguy At the bottom of this page: api.stackoverflow.com/0.8/help Commented Jun 15, 2010 at 18:34
-
2@Ether I finished the underpinnings last weekend (took a little longer than expected) and am constructing the UI tonight (it's already been sketched out and spec'd). I'm hoping to have it done by this weekend so I can make the contest. Commented Jun 15, 2010 at 18:37
-
@george no, it does what is on the tin -- that site is about network authentication and network enumeration. There is no "global" API other than those two functions. Commented Jun 15, 2010 at 21:52
-
@George - any update on the UI? If you already have a wheel, I'd prefer not to reinvent it for myself :)– DamovisaCommented Jul 14, 2010 at 2:28
-
@Damovisa sidetracked by Niece and little brother visiting last two weeks (leaving this weekend); looking to push it out middle of next week. Commented Jul 14, 2010 at 10:44
This is not exactly what you were asking for, but I just did a few queries on the data-explorer to find the total aggregate reputation for all users on the trilogy sites including breakdowns for specific user groups. Here is the report for StackOverflow:
Category Users Total Rep Avg Rep % Users % Rep
--------------- ------- ---------- ---------- ------- ------
All 251,679 44,636,799 177.36 100.0% 100.0%
Rep>1 127,415 44,512,535 349.35 50.6% 99.7%
Rep>10 101,548 44,362,682 436.86 40.3% 99.4%
Rep>100 35,296 42,212,853 1,195.97 14.0% 94.6%
Rep>1,000 8,290 33,253,355 4,011.26 3.3% 74.5%
Rep>10,000 600 13,041,613 21,736.02 0.2% 29.2%
Rep>100,000 5 656,471 131,294.20 0.0% 1.5%
Rep<10 149,315 265,957 1.78 59.3% 0.6%
Rep<100 216,255 2,411,146 11.15 85.9% 5.4%
Rep<1,000 243,379 11,373,444 46.73 96.7% 25.5%
Rep<10,000 251,079 31,595,186 125.84 99.8% 70.8%
[10..100] 67,068 2,157,989 32.18 26.6% 4.8%
[100..1,000] 27,134 8,972,298 330.67 10.8% 20.1%
[1,000..10,000] 7,700 20,221,742 2,626.20 3.1% 45.3%
If you want to find where you sit in the percentile of users on a given site this is a good start. Here are the links for each site:
-
Getting rankings for an individual site (for just one user) is fairly easy, with a calculation involving position and page number vs. total pages, but getting the rankings across all sites at once is a lot more difficult. Perhaps it would be possible to produce a merged Users table on data-explorer?– EtherCommented Jun 17, 2010 at 22:32
-
wait... so... 3.1% of the users have 45.3% of the reputation together, while 26.6% of the users have only 4.8% of the reputation together. Commented Jun 18, 2010 at 3:06
-
@alexanderpas yep... and the 0.2% of users with more than 10k have another 29.2% of the total reputation. A more interesting query would be the number of questions and answers each type of user contributed, as this might show how much real value low rep users contribute to the site. I'll probably try writing that one next, but it is a bit more difficult as you need to separate good and bad responses. Commented Jun 18, 2010 at 20:24
-
1WHAT? the top 0.2% of users have 29.2% of the total wealth? this is HORRIBLE, something is wrong with our system, we must immediately rebalance reputation equally across everyone. (Sarcasm, in case it wasn't clear.) ;)– EtherCommented Jun 20, 2010 at 16:07
Here is a SEDE query which lists all users, ordered by total reputation. Jon Skeet leads the way with (at the time of writing) 1.13M reputation, so far the only one breaching the 1M limit.
To find your own position in the list (thanks @rene for making this simpler), you'll need to know your network account ID, which you can find in the URL of your network profile. Yours is currently 74602 and we can find you at position 1701:
For reference, here is the complete query:
-- result table, don't rename and keep the site column
create table #results (site nvarchar(250), accountid int,
displayname nvarchar(40), reputation int);
declare @sql nvarchar(max) = '' -- holds build up sql string
-- build one biq union sql, for each db
select @sql = @sql
+ iif( len(@sql) > 1
, 'union all'
, 'insert into #results'
) +
-- here goes the per site query, fully qualify the database objects
N'
select ''' + name + ''', accountid, displayname, reputation
from ' + quotename(name) + '.dbo.users
'
from sys.databases
where database_id > 5
and (name not like '%.Meta' or name = 'StackExchange.Meta')
--print @sql
-- execute it
exec (@sql)
;with allusers as
(
select rank() over (order by sum(reputation) desc) AS 'Rank',
'https://stackexchange.com/users/' + cast(accountid as nvarchar)
+ '|' + max(displayname) AS 'User',
sum(reputation) AS 'Total reputation'
, min(accountid) accountid
from #results
group by accountid
)
-- show results
select 'Selected user' as 'Category'
, [Rank], [User], [Total reputation]
from allusers
where accountid = ##AccountId:int##
union all
select 'All users'
, [Rank], [User], [Total reputation]
from allusers
order by 1 desc, [Total reputation] desc
-- AccountId: The global account ID of the user, which you can find in the URL of their network profile. Visit this link: http://stackexchange.com/users/current to see your own ID; choose if you don't want to focus on a user.
drop table #results
Note that SEDE is updated once a week, on Sunday morning.
-
wrt the user needing to find their own rank, you can do it in one go: data.stackexchange.com/stackoverflow/query/882218/…– rene ModCommented Aug 2, 2018 at 10:46
-
It gives me 23486, but it should only be 15k. Can you check? Commented Feb 22, 2020 at 16:26
-
@user1271772 it includes sites where you have <200 reputation; the flair doesn't.– Glorfindel ModCommented Feb 22, 2020 at 17:58
-
I see. I thought that my 15k in the flair already included all the sites with <200. It turns out that I really do have 15k without the sites with <200. Doesn't it mean I should be a chat moderator across all chat sites? I thought we need 10,000 total reputation for that. Commented Feb 22, 2020 at 20:21
-
@user1271772 you probably are, there aren't just too many flags to handle.– Glorfindel ModCommented Feb 22, 2020 at 20:25
This is why I wrote StackFlair!
StackFlair http://stackflair.somee.com/Generate/3f0eac82-1801-410d-b334-234c18ddeeeb?format=Image
About
There have been several requests on MSO for a way to get a combined flair similar to what is shown on Area51. I took a "I want it, I'll make it" approach. Thus became StackFlair.
StackFlair generates a combined flair representing all of your associated StackExchange accounts. StackFlair includes:
- Your gravatar from your top site (by rep score)
- Your display name from your top site
- Your total reputation
- The number of sites you are a mod on
- The total number of gold badges
- The total number of silver badges
- The total number of bronze badges
- Favicons for your top 6 sites
Area51 is currently excluded as the site is not included in the api.
The default output is html to support linking and titles for the elements contained in the flair. You can also get image output. Themes are a planned feature.
I provide a very simplistic UI for selecting a StackExchange site and inputting a user id. The generated content can also be linked to directly.
Your StackFlair data is stored for 12 hours.
Issues and feature requests can be submitted here
I have a couple apps that might help with this.
The first is StackImage, it creates an image from all of your associated accounts and displays the reputation from them.
The second is StackCenter it displays your reputation and comments from all associated sites.
The easiest way to do this manually is to look at their account tab on their user page.
https://meta.stackoverflow.com/users/132636?tab=accounts#tab-top
https://meta.stackoverflow.com/users/16587?tab=accounts#tab-top
https://meta.stackoverflow.com/users/2915?tab=accounts#tab-top