Portfolio with Stack Exchange Basic Info

164 Views Asked by At

I am currently wanting to develop a webpage that displays my achievements in Stack Exchange.

Just the basic info... Badges earned, and reputation.

I am a beginner in Javascript. I reviewed the Javascript SDK briefly but cannot seem to get past the intro. Apparently, to access the information I need to have an access token to load the '/me' urls.

Here's a link to the api : https://api.stackexchange.com/docs/js-lib

Am I taking the right approach to this? All I need to load is the reputation and badges earned. And reload these values everytime the page is refreshed.

1

There are 1 best solutions below

0
On BEST ANSWER

Thanks to LJ_1102, the problem is solved...

Heres the url I needed: https://api.stackexchange.com/users/2086142?site=stackoverflow

Which returns

{
    "items": [
        {
            "badge_counts": {
            "bronze": 45,
            "silver": 19,
            "gold": 2
            },
            "account_id": 2384980,
            "is_employee": false,
            "last_modified_date": 1577652604,
            "last_access_date": 1625099866,
            "reputation_change_year": 28,
            "reputation_change_quarter": 18,
            "reputation_change_month": 0,
            "reputation_change_week": 0,
            "reputation_change_day": 0,
            "reputation": 1602,
            "creation_date": 1361259689,
            "user_type": "registered",
            "user_id": 2086142,
            "accept_rate": 58,
            "location": "Petaluma, CA",
            "website_url": "http://spritebots.com",
            "link": "https://stackoverflow.com/users/2086142/jsetting32",
            "profile_image": "https://i.stack.imgur.com/dPs0T.jpg?s=256&g=1",
            "display_name": "jsetting32"
        }
    ],
    "has_more": false,
    "quota_max": 300,
    "quota_remaining": 227
}

Where keys badge_counts and reputation are what I need!