Currently, the API doesn't specify what the associated Meta site is for a certain site (I'm talking about the stackauth.com/1.0/sites route). Sure, we could just prepend "meta." to the domain name, but that's not entirely reliable (it might be now, but it might not be in the future). I'm thinking about two possible solutions for this. Either include the meta site as a child of its parent site, like so:
"api_sites": [
{
"name": "Stack Overflow",
"logo_url": "http://sstatic.net/stackoverflow/img/logo.png",
"api_endpoint": "http://api.stackoverflow.com",
"site_url": "http://stackoverflow.com",
"description": "Q&A for professional and enthusiast programmers",
"icon_url": "http://sstatic.net/stackoverflow/img/apple-touch-icon.png",
"state": "normal",
"styling": {
"link_color": "#0077CC",
"tag_foreground_color": "#3E6D8E",
"tag_background_color": "#E0EAF1"
},
"meta": {
"name": "Meta Stack Overflow",
"logo_url": "http://sstatic.net/stackoverflowmeta/img/logo.png",
"api_endpoint": "http://api.meta.stackoverflow.com",
"site_url": "http://meta.stackoverflow.com",
"description": "Q&A about the Stack Exchange engine powering these sites",
"icon_url": "http://sstatic.net/stackoverflowmeta/img/apple-touch-icon.png",
"state": "normal",
"styling": {
"link_color": "#3D3D3D",
"tag_foreground_color": "#6F6F6F",
"tag_background_color": "#E7E7E7"
}
}
},
// ...
]
...or just include the endpoint of the meta site in the main site (and viceversa?):
"api_sites": [
{
"name": "Stack Overflow",
"logo_url": "http://sstatic.net/stackoverflow/img/logo.png",
"api_endpoint": "http://api.stackoverflow.com",
"site_url": "http://stackoverflow.com",
"description": "Q&A for professional and enthusiast programmers",
"icon_url": "http://sstatic.net/stackoverflow/img/apple-touch-icon.png",
"state": "normal",
"styling": {
"link_color": "#0077CC",
"tag_foreground_color": "#3E6D8E",
"tag_background_color": "#E0EAF1"
},
"meta": "http://api.meta.stackoverflow.com"
},
{
"name": "Meta Stack Overflow",
"logo_url": "http://sstatic.net/stackoverflowmeta/img/logo.png",
"api_endpoint": "http://api.meta.stackoverflow.com",
"site_url": "http://meta.stackoverflow.com",
"description": "Q&A about the Stack Exchange engine powering these sites",
"icon_url": "http://sstatic.net/stackoverflowmeta/img/apple-touch-icon.png",
"state": "normal",
"styling": {
"link_color": "#3D3D3D",
"tag_foreground_color": "#6F6F6F",
"tag_background_color": "#E7E7E7"
},
"meta_for": "http://api.stackoverflow.com"
},
// ...
]
I think this would be pretty useful.
/sites
is kind of rough just due to there not being any meta (or even SE 2.0) sites when it was created. It'll be improved in the next version.