GET /sites/$site

Get information about a site.

Resource Information

   
Method GET
URL https://public-api.wordpress.com/rest/v1.1/sites/$site
Requires authentication? No

Method Parameters

Parameter Type Description
$site (int|string) Site ID or 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
user_can_manage (bool) The current user can manage this site
capabilities (array) Array of capabilities for the current user on this site.
jetpack (bool) Whether the site is a Jetpack site or not
is_multisite (bool) Whether the site is a Multisite site or not. Always true for WP.com sites.
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
logo (array) The site logo, set in the Customizer
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
single_user_site (bool) Whether the site is single user. Only returned for WP.com sites and for Jetpack sites with version 3.4 or higher.
is_vip (bool) If the site is a VIP 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 post editing rights to the site. Note: Post formats is deprecated, please see /sites/$id/post-formats/
plan (array) Details of the current plan for this site.
updates (array) An array of available updates for plugins, themes, wordpress, and languages.
jetpack_modules (array) A list of active Jetpack modules.
meta (object) Meta data
quota (array) An array describing how much space a user has left for uploads

Resource Errors

These are the possible errors returned by this endpoint.

HTTP Code Error Identifier Error Message
403 unauthorized User cannot access this private blog.
403 unauthorized User cannot access this restricted blog
403 authorization_required An active access token must be used to query information about the current blog.

Example

curl 'https://public-api.wordpress.com/rest/v1/sites/en.blog.wordpress.com/'
<?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/',
	false,
	$context
);
$response = json_decode( $response );
?>

Response

{
    "ID": 3584907,
    "name": "The WordPress.com Blog",
    "description": "The latest news on WordPress.com and the WordPress community.",
    "URL": "http:\/\/en.blog.wordpress.com",
    "jetpack": false,
    "subscribers_count": 32051175,
    "lang": false,
    "icon": {
        "img": "https:\/\/secure.gravatar.com\/blavatar\/e6392390e3bcfadff3671c5a5653d95b",
        "ico": "https:\/\/secure.gravatar.com\/blavatar\/e6392390e3bcfadff3671c5a5653d95b"
    },
    "logo": {
        "id": 0,
        "sizes": [],
        "url": ""
    },
    "visible": null,
    "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"
        }
    }
}