GET /sites/$site

Information about a site ID/domain

Resource URL

Type URL and Format
GET https://public-api.wordpress.com/rest/v1/sites/$site

Method Parameters

Parameter Type Description
$site (int|string) The site ID, The site domain

Query Parameters

Parameter Type Description
http_envelope (bool)
false:
(default)
true:
Some environments (like in-browser Javascript or Flash) block or divert responses with a non-200 HTTP status code. Setting this parameter will force the HTTP status code to always be 200. The JSON response is wrapped in an "envelope" containing the "real" HTTP status code and headers.
pretty (bool)
false:
(default)
true:
Output pretty JSON
meta (string) Optional. Loads data from the endpoints found in the 'meta' part of the response. Comma separated list. Example: meta=site,likes
fields (string) Optional. Returns specified fields only. Comma separated list. Example: fields=ID,title
callback (string) An optional JSONP callback function.

Response Parameters

Parameter Type Description
ID (int) Site ID
name (string) Title of site
description (string) Tagline or description of site
URL (string) Full URL to the site
jetpack (bool) Whether the site is a Jetpack site or not
post_count (int) The number of posts the site has
subscribers_count (int) The number of subscribers the site has
lang (string) Primary language code of the site
icon (array) An array of icon formats for the site
visible (bool) If this site is visible in the user's site list
is_private (bool) If the site is a private site or not
is_following (bool) If the current user is subscribed to this site in the reader
options (array) An array of options/settings for the blog. Only viewable by users with access to the site.
meta (object) Meta data

Example

cURL

curl 'https://public-api.wordpress.com/rest/v1/sites/en.blog.wordpress.com/?pretty=1'

PHP

<?php

$options  = array (
  'http' => 
  array (
    'ignore_errors' => true,
  ),
);

$context  = stream_context_create( $options );
$response = file_get_contents(
  'https://public-api.wordpress.com/rest/v1/sites/en.blog.wordpress.com/?pretty=1',
  false,
  $context
);
$response = json_decode( $response );

?>

Response Body

{
    "ID": 3584907,
    "name": "WordPress.com News",
    "description": "The latest news on WordPress.com and the WordPress community.",
    "URL": "http:\/\/en.blog.wordpress.com",
    "jetpack": false,
    "subscribers_count": 12614350,
    "is_private": false,
    "is_following": false,
    "meta": {
        "links": {
            "self": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/3584907",
            "help": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/3584907\/help",
            "posts": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/3584907\/posts\/",
            "comments": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/3584907\/comments\/",
            "xmlrpc": "https:\/\/en.blog.wordpress.com\/xmlrpc.php"
        }
    }
}