Stack Apps is a question and answer site for apps, scripts, and development with the Stack Exchange API. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In the /me/associated method, I get back a bunch of JSON - but the api_site_parameter name is nowhere to be found.

Why? It's kind of important. Could we have it?

share|improve this question
up vote 6 down vote accepted

I don't see any particular reason not to add it, but there are some workarounds you can use in the meantime:

  • Build a cache of all site information with the site URL as the key, and then look up the api_site_parameter value (and associated information) that way.


  • Use the fact that the domain name can be passed in as the value for site, and clean up the returned site_url to fit, i.e.:

    var api_site = network_user.site_url.substring(
        network_user.site_url.indexOf("//") + 2,
        network_user.site_url.length - 1
share|improve this answer
Really? I could pass for site and it would get me results for Space Exploration? – Undo Aug 3 '13 at 18:32
Yes, so long as it's just the domain name. This is mentioned in the paragraph about the site parameter in the documentation, specifically "This parameter can be the full domain name (ie. ""), or a short form identified by api_site_parameter on the site object." (emphasis mine) – Tim Stone Aug 3 '13 at 18:36
Awesome! So get the URL and rip out http(s)://. Simple! – Undo Aug 3 '13 at 18:42

You must log in to answer this question.

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