6

I'm looking to make an app that shows your reputation changes throughout the network. /me/reputation-history/full almost accomplishes this, but it's on a per-site basis. I only want one query to get the last x changes over the whole network, like the new black topbar achievements dropdown does.

If there's a way to do this, it's . Otherwise, it's a .

2

1 Answer 1

1

One evening, after being inspired by How to get (unread) achievements?, I did some analysis with mitmproxy. This was at a time that the publicly released version of the API was 2.2; it turned out that the Stack Exchange mobile apps use a (then) undocumented API v2.3 method for this: /me/achievements.

A GET call to https://api.stackexchange.com/2.3/me/achievements?pageSize=100&filter=*-t3H1VAnvpZbcZ&access_token=[ACCESS_TOKEN]&key=[KEY] yields the following result:

{
    "quota_max": 10000,
    "quota_remaining": 7999,
    "has_more": false,
    "items": [
        {
            "achievement_type": "reputation",
            "account_id": 6085540,
            "reputation_change": 2,
            "is_unread": false,
            "link": "https://ux.stackexchange.com/questions/130203/whats-the-best-way-to-combine-an-action-outside-of-the-ui-with-an-action-in-the/130208#130208",
            "creation_date": 1574444062,
            "title": "What's the best way to combine an action outside of the UI with an action in the UI?",
            "on_site": {
                "icon_url": "https://cdn.sstatic.net/Sites/ux/img/apple-touch-icon.png",
                "aliases": [
                    "http://ui.stackexchange.com"
                ],
                "site_url": "https://ux.stackexchange.com",
                "api_site_parameter": "ux",
                "name": "User Experience",
                "high_resolution_icon_url": "https://cdn.sstatic.net/Sites/ux/img/[email protected]"
            }
        },
        {
            "achievement_type": "reputation",
            "account_id": 6085540,
            "reputation_change": 10,
            "is_unread": false,
            "link": "https://meta.stackexchange.com/questions/334137/dismiss-the-meet-the-overflow-and-podcast-episode-banners-network-wide/334202#334202",
            "creation_date": 1574443466,
            "title": "Dismiss the "Meet The Overflow" and Podcast Episode banners network-wide",
            "on_site": {
                "icon_url": "https://meta.stackexchange.com/content/Sites/stackexchangemeta/img/apple-touch-icon.png",
                "site_url": "https://meta.stackexchange.com",
                "api_site_parameter": "meta",
                "name": "Meta Stack Exchange",
                "high_resolution_icon_url": "https://meta.stackexchange.com/content/Sites/stackexchangemeta/img/[email protected]"
            }
        },

...

It works with any Stack App token, not just the ones from the mobile apps. You'll probably need one with scope read_inbox, though I haven't tested that.

There's a related GET call to https://mobile.stackexchange.com/1/push/topbar-counts?filter=vqc7J which returns the number of unread inbox items and the total new reputation (the green +x badge), but it only works with a token which belongs to the mobile apps. It returns something like this:

{
    "total": 1,
    "quota_max": 2147483647,
    "quota_remaining": 2147483647,
    "has_more": false,
    "page": 1,
    "type": "mobile_top_bar_counts",
    "items": [
        {
            "unread_inbox_count": 0,
            "account_id": 6085540,
            "unviewed_non_rep_count": 0,
            "unviewed_rep_count": 0
        }
    ],
    "page_size": 1
}

The filter seems to be necessary; without it, I get a backoff response.

3
  • It is also good to know that you need the "read_inbox" scope and the custom filter *-t3H1VAnvpZbcZ used for 2.3/me/achievements does not contain all site information, otherwise it has all the other values ​​like the default filter. Nov 25, 2019 at 9:55
  • What exactly do you mean with "token which belongs to the mobile apps". Can ever one get such a token? Nov 25, 2019 at 10:03
  • 1
    The official Stack Exchange mobile apps use the API as well. By analyzing network traffic (with something like mitmproxy) you can see which API methods they call but you can also extract the access token and key. It's not something you can rely on if you build apps for other users.
    – Glorfindel
    Nov 25, 2019 at 10:05

You must log in to answer this question.