Take the 2-minute tour ×
Stack Apps is a question and answer site for apps, scripts, and development with the Stack Exchange API. It's 100% free, no registration required.

I have the access_token after authentication from the user. At this point I don't know with which sites this user has registered. Is it possible to get user information like the display name or profile picture from here?

I'm aware of /me , but this requires a site to be specified. I suppose I can find the users associated sites with /me/associated and use that info, but... is there a simpler way?

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

/me/associated is the preferred way to turn an access_token into a list of users, it returns the collection of per-site user details that can be quickly fetched. It's basically the user's account tab.

If you need more details about a user on a give site, then turn around and hit /me (or /users/{ids}) on the sites you've discovered via /me/associated.

As for display names and profile images, you will have to make at least one call to a site specific method; I typically advise consumers to only query the user's top account (by rep) for that information, it's the same on all sites for > 90% of users with multiple accounts (and > 50% of users only have accounts on a single site). However, if you intend to display all of a user's accounts you will have to make multiple requests.

share|improve this answer
add comment

You must log in to answer this question.

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