GET /insights

A list stats/metrics/insights that the provided developer token has access to.

Resource URL

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

Query Parameters

Parameter Type Description
context (string)
display:
(default) Formats the output as HTML for display. Shortcodes are parsed, paragraph tags are added, etc..
edit:
Formats the output for editing. Shortcodes are left unparsed, significant whitespace is kept, etc..
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
name (string) Name of WordPress.com Application
id (id) Unique ID for a WordPress.com Application
insights (array) List metrics
today (array) A list of todays metrics
has_custom (bool) If a report has custom (whitelisted) stats

Example

cURL

curl 'https://public-api.wordpress.com/rest/v1/insights'

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/insights',
  false,
  $context
);
$response = json_decode( $response );

?>

Response Body

{"id":null,"name":null,"insights":["rest-api-calls","rest-api-writes","rest-api-reads","rest-api-errors","api-insights-connections","api-insights-posts","api-insights-comments","api-insights-likes","activity_stream_posts\/path","shortcode_published\/youtube","mexp_request_status\/success-youtube","!extra\/embed_soundcloud","activity_stream_posts\/twitter","activity_stream_users\/twitter","highlander-comment-posted\/twitter","twitter-blackbird-pie\/post-view","twitter-blackbird-pie\/comment-view","tweet-store\/success-try-1","widget_added\/twitter","widget_removed\/twitter","widget_added\/twitter_timeline","widget_removed\/twitter_timeline","widget\/twitter","widget\/twitter_timeline","mexp_request_status\/success-twitter","!extra\/embed_slideshare"],"today":{"rest_api_calls":{"number":null,"percent":"%"},"rest_api_writes":{"number":null,"percent":"%"},"rest_api_reads":{"number":null,"percent":"%"},"rest_api_errors":{"number":null,"percent":"%"},"api_insights_connections":{"number":null,"percent":"%"},"api_insights_posts":{"number":null,"percent":"%"},"api_insights_comments":{"number":null,"percent":"%"},"api_insights_likes":{"number":null,"percent":"%"},"activity_stream_posts":{"number":"376559","percent":"-2.5%"},"shortcode_published":{"number":"935234","percent":"0.3%"},"mexp_request_status":{"number":"1208","percent":"-15.3%"},"!extra":{"number":"11781","percent":"-7.3%"},"activity_stream_users":{"number":"3602","percent":"-8.4%"},"highlander_comment_posted":{"number":"1163","percent":"7.8%"},"twitter_blackbird_pie":{"number":"5382","percent":"-0.6%"},"tweet_store":{"number":"9207","percent":"-22%"},"widget_added":{"number":"853","percent":"-3.7%"},"widget_removed":{"number":"388","percent":"-9.1%"},"widget":{"number":"44915620","percent":"-1.4%"}},"has_custom":true}