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) |
|
| pretty | (bool) |
|
| callback | (string) | An optional JSONP callback function. |
Response Parameters
| Parameter | Type | Description |
|---|---|---|
| ID | (int) | Blog ID |
| name | (string) | Title of blog |
| description | (string) | Tagline or description of blog |
| URL | (string) | Full URL to the blog |
| jetpack | (bool) | Whether the blog is a Jetpack blog or not |
| post_count | (int) | The number of posts the blog has |
| lang | (string) | Primary language code of the blog |
| 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",
"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\/"
}
}
}