7

It would be really nice if there were a way to get all the data that is displayed on the accounts tab of the Stack Exchange network profile for a user (e.g. mine) as machine-readable data with a single request. AFAIK, getting the badge counts requires making an API call to each site, so that getting the equivalent data for a user with accounts on n sites requires at least n+1 API calls.

2 Answers 2

3

As with suggested edits*, tag wikis, privileges, and so on... we don't expose things in the API until they've settled down quite a bit.

Also, "Whole network" APIs are something that take a bit of work to get adequately performant. A lot of effort went into getting the network profile pages to scale properly, similar effort will be needed on the API for those data sets.

*Which are still not in the API.


As of v2.0, the /users/{ids}/associated method (now consuming account_ids rather than association_guids) returns considerably more information (in the form of network_users). This should be sufficient to mimic the accounts tab.

2
  • 1
    Would it be preferable from SE's perspective if I: (1) made a StackAuth API call followed by API calls to each site on which the target user has an account; or (2) scraped the accounts page of the user's SE profile?
    – Isaac
    Commented Sep 2, 2011 at 23:12
  • If this is status-completed, could you post an answer with at least a link to the relevant documentation (which I could then mark as accepted)?
    – Isaac
    Commented Feb 11, 2012 at 6:45
2

As a sort of quick experiment, I slapped together a regex scraping of a single user's accounts page on SE.com and have put it up on the test deployment of se-flair:

http://test.se-flair.appspot.com/SEaccounts/[assoc-id]/

The return is, at the moment, a JSON object with the display name, the gravatar URL, and an array of sites, where each site has the various statistics displayed on that page. The raw HTML of the user's SE.com accounts page may be cached for up to 8 hours.

Please do not develop against this without talking to me first—the format of the data is subject to change and the service should not be considered at all reliable. Neither the JSON output at this URL nor the underlying scraping are used in se-flair (yet). If/when there's a more stable version with a more fixed output format, it'll be part of a regular (default) deployment of se-flair (at http://se-flair.appspot.com/).

Please do comment with feedback.


edit 2011-09-22: Mostly due to repeated breakage of how I'd been getting Area 51 info, I've converted se-flair to using this scraping of the SE.com profile accounts page. This means that

http://se-flair.appspot.com/SEaccounts/[assoc-id]/

will now get the JSON data and that I consider it fairly reliable. I would strongly suggest not developing against it without talking to me first as the format of the data is still subject to change.

2
  • Don't forget that the API is switching to account IDs (from association GUIDs) with the release of v2.0. Commented Sep 23, 2011 at 17:45
  • @GeorgeEdison: That's good to know—I couldn't have forgotten it because I didn't even know a v2.0 was coming. I'll have to keep an eye out for it to keep se-flair working.
    – Isaac
    Commented Sep 23, 2011 at 18:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .