Skip to main content
4 of 4
Commonmark migration

bump

I've just delved into the stackauth methods for the first time today, and I can't help but notice that there's no real URL friendly key exposed.

For example, I want a unique URL for each API endpoint in my app, so that it can be bookmarked. E.g. http://www.column80.com/?site=stackoverflow

But none of the keys provided are any good. name has spaces (who wants a %20 in their URL?). site_url is even worse for including in a URL (it contains http:// etc), and you haven't specified that the index is reliable (and even if it were, http://www.column80.com/?site=1 doesn't mean anything to anyone, especially not if you want to do SEO in the future - and it means doing a for x=... loop instead of a for each loop).

So my only option at the moment is to roll my own, which is

  1. Annoying
  2. Unreliable
  3. Slow(er than it has to be)

A unique key would fix that, because keys can be descriptive, and generally don't contain spaces, and even a 3-letter (mso etc) key is more descriptive than 1

Update

See this meta question here. It would appear that site_name is in fact very likely to change. I know these are edge-cases for initial launch/beta sites, but the fact still remains...

Also, as I suspected, the index is not a reliable key. The two new sites have been inserted as keys 4 and 5, bumping stackapps up to 6. Which means that if someone had bookmarked http://sa.column80.com/?api=4 for StackApps, today they would be receiving Web Apps quite unexpectedly. I know that this is because of my poor design, but I think I've made it fairly clear that there's no real way around this.

Mark Henderson
  • 3.4k
  • 2
  • 18
  • 20