7

Is there a way to get the Site Name, like StackOverflow or ServerFault, etc.? In my app I let the user enter a url with a api for a Site and I will be great If I can tell him something like: "You Are connected to SITE";

3 Answers 3

2

display_name is now returned as part of the /stats method.

1
  • The link is broken. Probably this happened due to a change in the domain used. Current documentation URL api.stackexchange.com/docs
    – Wicket
    Commented May 9, 2023 at 21:33
1

As of May 9, 2023, https://api.stackexchange.com/docs/sites returns a list of sites. The property having the site name is "name".

{
      "aliases": [
        "https://www.stackoverflow.com",
        "https://facebook.stackoverflow.com"
      ],
      "styling": {
        "tag_background_color": "#E0EAF1",
        "tag_foreground_color": "#3E6D8E",
        "link_color": "#0077CC"
      },
      "related_sites": [
        {
          "relation": "meta",
          "api_site_parameter": "meta.stackoverflow",
          "site_url": "https://meta.stackoverflow.com",
          "name": "Meta Stack Overflow"
        },
        {
          "relation": "chat",
          "site_url": "https://chat.stackoverflow.com/",
          "name": "Stack Overflow Chat"
        }
      ],
      "markdown_extensions": [
        "Prettify"
      ],
      "launch_date": 1221436800,
      "open_beta_date": 1217462400,
      "site_state": "normal",
      "high_resolution_icon_url": "https://cdn.sstatic.net/Sites/stackoverflow/Img/[email protected]",
      "favicon_url": "https://cdn.sstatic.net/Sites/stackoverflow/Img/favicon.ico",
      "icon_url": "https://cdn.sstatic.net/Sites/stackoverflow/Img/apple-touch-icon.png",
      "audience": "professional and enthusiast programmers",
      "site_url": "https://stackoverflow.com",
      "api_site_parameter": "stackoverflow",
      "logo_url": "https://cdn.sstatic.net/Sites/stackoverflow/Img/logo.png",
      "name": "Stack Overflow",
      "site_type": "main_site"
    },
0

"styling": { "tag_background_color": "#E0EAF1", "tag_foreground_color": "#3E6D8E", "link_color": "#0077CC" }, "related_sites": [ { "relation": "meta", "api_site_parameter": "meta.stackoverflow", "site_url": "https://meta.stackoverflow.com", "name": "Meta Stack Overflow" }, { "relation": "chat", "site_url": "https://chat.stackoverflow.com/", "name": "Stack Overflow Chat" } ], "markdown_extensions": [ "Prettify" ], "launch_date": 1221436800, "open_beta_date": 1217462400, "site_state": "normal", "high_resolution_icon_url": "https://cdn.sstatic.net/Sites/stackoverflow/Img/[email protected]", "favicon_url"

You must log in to answer this question.

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