Skip to main content
deleted 7 characters in body
Source Link
systempuntoout
  • 8k
  • 4
  • 21
  • 27
{
  "api_sites": [
    {"stackoverflow":{
      "name": "Stack Overflow",
      "logo_url": "http://sstatic.net/so/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/so/apple-touch-icon.png",
      "state": "normal",
      "styling": {
        "link_color": "#0077CC",
        "tag_foreground_color": "#3E6D8E",
        "tag_background_color": "#E0EAF1"
      }
    }},
    {"serverfault":{
      "name": "Server Fault",
      "logo_url": "http://sstatic.net/sf/img/logo.png",
      "api_endpoint": "http://api.serverfault.com",
      "site_url": "http://serverfault.com",
      "description": "Q&A for system administrators and IT professionals",
      "icon_url": "http://sstatic.net/sf/apple-touch-icon.png",
      "state": "normal",
      "styling": {
        "link_color": "#10456A",
        "tag_foreground_color": "#444444",
        "tag_background_color": "#F3F1D9"
      }
    }},
    .....
    {"cooking.stackexchange":{
      "name": "Cooking",
      "logo_url": "http://sstatic.net/cooking/img/logo.png",
      "api_endpoint": "http://api.cooking.stackexchange.com",
      "site_url": "http://cooking.stackexchange.com",
      "description": "Q&A for food and cooking",
      "icon_url": "http://sstatic.net/cooking/apple-touch-icon.png",
      "state": "closed_beta",
      "styling": {
        "link_color": "#0077CC",
        "tag_foreground_color": "#FFF",
        "tag_background_color": "#FFF"
      }
    }},
    {"meta.cooking.stackexchange":{
      "name": "Cooking Meta",
      "logo_url": "http://sstatic.net/cookingmeta/img/logo.png",
      "api_endpoint": "http://api.meta.cooking.stackexchange.com",
      "site_url": "http://meta.cooking.stackexchange.com",
      "description": "Q&A about the cooking site",
      "icon_url": "http://sstatic.net/cookingmeta/apple-touch-icon.png",
      "state": "linked_meta",
      "styling": {
        "link_color": "#3D3D3D",
        "tag_foreground_color": "#666666",
        "tag_background_color": "#FFF"
      }
    }},....}]
}
{
  "api_sites": [
    {"stackoverflow":{
      "name": "Stack Overflow",
      "logo_url": "http://sstatic.net/so/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/so/apple-touch-icon.png",
      "state": "normal",
      "styling": {
        "link_color": "#0077CC",
        "tag_foreground_color": "#3E6D8E",
        "tag_background_color": "#E0EAF1"
      }
    }},
    {"serverfault":{
      "name": "Server Fault",
      "logo_url": "http://sstatic.net/sf/img/logo.png",
      "api_endpoint": "http://api.serverfault.com",
      "site_url": "http://serverfault.com",
      "description": "Q&A for system administrators and IT professionals",
      "icon_url": "http://sstatic.net/sf/apple-touch-icon.png",
      "state": "normal",
      "styling": {
        "link_color": "#10456A",
        "tag_foreground_color": "#444444",
        "tag_background_color": "#F3F1D9"
      }
    }},
    .....
    {"cooking.stackexchange":{
      "name": "Cooking",
      "logo_url": "http://sstatic.net/cooking/img/logo.png",
      "api_endpoint": "http://api.cooking.stackexchange.com",
      "site_url": "http://cooking.stackexchange.com",
      "description": "Q&A for food and cooking",
      "icon_url": "http://sstatic.net/cooking/apple-touch-icon.png",
      "state": "closed_beta",
      "styling": {
        "link_color": "#0077CC",
        "tag_foreground_color": "#FFF",
        "tag_background_color": "#FFF"
      }
    }},
    {"meta.cooking.stackexchange":{
      "name": "Cooking Meta",
      "logo_url": "http://sstatic.net/cookingmeta/img/logo.png",
      "api_endpoint": "http://api.meta.cooking.stackexchange.com",
      "site_url": "http://meta.cooking.stackexchange.com",
      "description": "Q&A about the cooking site",
      "icon_url": "http://sstatic.net/cookingmeta/apple-touch-icon.png",
      "state": "linked_meta",
      "styling": {
        "link_color": "#3D3D3D",
        "tag_foreground_color": "#666666",
        "tag_background_color": "#FFF"
      }
    }},....]
}
{
  "api_sites": [
    {"stackoverflow":{
      "name": "Stack Overflow",
      "logo_url": "http://sstatic.net/so/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/so/apple-touch-icon.png",
      "state": "normal",
      "styling": {
        "link_color": "#0077CC",
        "tag_foreground_color": "#3E6D8E",
        "tag_background_color": "#E0EAF1"
      }
    },
    "serverfault":{
      "name": "Server Fault",
      "logo_url": "http://sstatic.net/sf/img/logo.png",
      "api_endpoint": "http://api.serverfault.com",
      "site_url": "http://serverfault.com",
      "description": "Q&A for system administrators and IT professionals",
      "icon_url": "http://sstatic.net/sf/apple-touch-icon.png",
      "state": "normal",
      "styling": {
        "link_color": "#10456A",
        "tag_foreground_color": "#444444",
        "tag_background_color": "#F3F1D9"
      }
    },
    .....
    "cooking.stackexchange":{
      "name": "Cooking",
      "logo_url": "http://sstatic.net/cooking/img/logo.png",
      "api_endpoint": "http://api.cooking.stackexchange.com",
      "site_url": "http://cooking.stackexchange.com",
      "description": "Q&A for food and cooking",
      "icon_url": "http://sstatic.net/cooking/apple-touch-icon.png",
      "state": "closed_beta",
      "styling": {
        "link_color": "#0077CC",
        "tag_foreground_color": "#FFF",
        "tag_background_color": "#FFF"
      }
    },
    "meta.cooking.stackexchange":{
      "name": "Cooking Meta",
      "logo_url": "http://sstatic.net/cookingmeta/img/logo.png",
      "api_endpoint": "http://api.meta.cooking.stackexchange.com",
      "site_url": "http://meta.cooking.stackexchange.com",
      "description": "Q&A about the cooking site",
      "icon_url": "http://sstatic.net/cookingmeta/apple-touch-icon.png",
      "state": "linked_meta",
      "styling": {
        "link_color": "#3D3D3D",
        "tag_foreground_color": "#666666",
        "tag_background_color": "#FFF"
      }
    ,....}]
}
Source Link
systempuntoout
  • 8k
  • 4
  • 21
  • 27

#BUMP: Although this request seems sealed with a status-declined flag..

i started to play with Stackauth and i have to say that what requested in this post is more than proper and reasonable.

Using /sites i had to craft an utility method that strips the domains from site_urls using regex (^http://(.*).com$ ), adding them to the data structure as keys.

The resulting data is something like this:

{
  "api_sites": [
    {"stackoverflow":{
      "name": "Stack Overflow",
      "logo_url": "http://sstatic.net/so/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/so/apple-touch-icon.png",
      "state": "normal",
      "styling": {
        "link_color": "#0077CC",
        "tag_foreground_color": "#3E6D8E",
        "tag_background_color": "#E0EAF1"
      }
    }},
    {"serverfault":{
      "name": "Server Fault",
      "logo_url": "http://sstatic.net/sf/img/logo.png",
      "api_endpoint": "http://api.serverfault.com",
      "site_url": "http://serverfault.com",
      "description": "Q&A for system administrators and IT professionals",
      "icon_url": "http://sstatic.net/sf/apple-touch-icon.png",
      "state": "normal",
      "styling": {
        "link_color": "#10456A",
        "tag_foreground_color": "#444444",
        "tag_background_color": "#F3F1D9"
      }
    }},
    .....
    {"cooking.stackexchange":{
      "name": "Cooking",
      "logo_url": "http://sstatic.net/cooking/img/logo.png",
      "api_endpoint": "http://api.cooking.stackexchange.com",
      "site_url": "http://cooking.stackexchange.com",
      "description": "Q&A for food and cooking",
      "icon_url": "http://sstatic.net/cooking/apple-touch-icon.png",
      "state": "closed_beta",
      "styling": {
        "link_color": "#0077CC",
        "tag_foreground_color": "#FFF",
        "tag_background_color": "#FFF"
      }
    }},
    {"meta.cooking.stackexchange":{
      "name": "Cooking Meta",
      "logo_url": "http://sstatic.net/cookingmeta/img/logo.png",
      "api_endpoint": "http://api.meta.cooking.stackexchange.com",
      "site_url": "http://meta.cooking.stackexchange.com",
      "description": "Q&A about the cooking site",
      "icon_url": "http://sstatic.net/cookingmeta/apple-touch-icon.png",
      "state": "linked_meta",
      "styling": {
        "link_color": "#3D3D3D",
        "tag_foreground_color": "#666666",
        "tag_background_color": "#FFF"
      }
    }},....]
}

It works and i can use this data structure in my code, but it is slow and unreliable.
I vote with two raised hands that a meaningful key should be added to the response.