Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get the Stack Overflow reputation of a specific user?

I am trying to display the Stack Overflow reputation of an user in my project. I have the user email. So with user email as input can i get the user's Stack Overflow reputation?

Now i tried using Javascript SDK. Used authenticate method of Stack Overflow. In this case , user must login into Stack Overflow, then i got user's Stack Overflow id and reputation.

  1. Can i get the Stack Overflow reputation of the user passing his emailid without authentication?
  2. Everytime when his reputation is changed in Stack Overflow, is there any option for me to auto update his Stack Overflow reputation value in my site also?
like image 808
Mahahari Avatar asked Aug 05 '15 08:08

Mahahari


People also ask

How do I get 50 reputation on Stack Overflow?

Answer questions posted on StackOverflow. If you want to earn more reputation in a shorter period, post answers on the topic you are expert in. The more your answers(of course the quality ones) are, the more reputation you will earn. Also, make sure that you follow the SO guidelines while answering the question.

Who has the highest reputation on Stack Overflow?

Hans Passant - 634k (Stack Overflow)


2 Answers

For privacy reasons email addresses are not available in the stack exchange-api. They are neither available in the data explorer or the datadumps. As far as I know you won't be able to query the database based on the email address.

By authentication you can find the user based on it's id or using the /me functionality.

Regarding the updates of the reputation, I believe you could use a cron job that updates the reputation on a daily basis.

Depending on how you want to represent the reputation, you could also consider using the Flair option which is provided by Stack Exchange itself. Flairs are small images that depict a summary of the user and shows his/her reputation. These flairs are updated every 24-36 hours by SE and can be accessed by the url: https://stackoverflow.com/users/flair/user_id_here.png

like image 99
DJanssens Avatar answered Feb 28 '23 20:02

DJanssens


You can get the user's reputation through an stack overflow api:

https://stackoverflow.com/users/flair/<user_id>.json

and it returns a json string (take myself as an example)

{
  "id":7360676,
  "gravatarHtml":{},
  "badgeHtml":"<span title=\"3 silver badges\" aria-hidden=\"true\"><span class=\"badge2\">&#9679;</span><span class=\"badgecount\">3</span></span><span class=\"v-visible-sr\">3 silver badges</span><span title=\"14 bronze badges\" aria-hidden=\"true\"><span class=\"badge3\">&#9679;</span><span class=\"badgecount\">14</span></span><span class=\"v-visible-sr\">14 bronze badges</span>",
  "reputation":"341",
  "displayName":"Justin Lee",
  "profileUrl":"https://stackoverflow.com/users/7360676/justin-lee"
}

simply read the reputation field from the return of this api, and you will get the user's stack overflow reputation

like image 40
Justin Lee Avatar answered Feb 28 '23 21:02

Justin Lee