GET /sites/$site/stats/comments
View a site's top comment authors and most-commented posts
Resource Information
Method | GET |
---|---|
URL | https://public-api.wordpress.com/rest/v1.1/sites/$site/stats/comments |
Requires authentication? | Yes |
Method Parameters
Parameter | Type | Description |
---|---|---|
$site | (int|string) | The site's id or domain |
Query Parameters
Parameter | Type | Description |
---|---|---|
context | (string) |
|
http_envelope | (bool) |
|
pretty | (bool) |
|
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 |
---|---|---|
date | (string) | The most-recent day for which stats are returned |
authors | (array) | An array of top comment authors |
posts | (array) | Array of most-commented posts |
monthly_comments | (int) | Average number of comments per month |
total_comments | (int) | Number of total comments |
most_active_day | (string) | Day with most comment-activity |
most_active_time | (string) | Time with most comment-activity |
most_commented_post | (array) | Most commented post |
Resource Errors
This endpoint does not return any errors.
Example
curl \ -H 'authorization: Bearer YOUR_API_TOKEN' \ 'https://public-api.wordpress.com/rest/v1.1/sites/82974409/stats/comments'
<?php $options = array ( 'http' => array ( 'ignore_errors' => true, 'header' => array ( 0 => 'authorization: Bearer YOUR_API_TOKEN', ), ), ); $context = stream_context_create( $options ); $response = file_get_contents( 'https://public-api.wordpress.com/rest/v1.1/sites/82974409/stats/comments', false, $context ); $response = json_decode( $response ); ?>