Automattic Stats API
The stats API from Automattic — 43 operation(s) for stats.
The stats API from Automattic — 43 operation(s) for stats.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/automattic-stats-api"
curl "https://apis.io/api/v1/apis?limit=25"
Discovery needs no key. Ratings and market analysis are Pro.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: WordPress.com REST API v1.1 Stats API
version: v1.1
description: 'The WordPress.com REST API, operated by Automattic. Derived by API Evangelist from Automattic''s own self-describing help document at https://public-api.wordpress.com/rest/v1.1/help (Accept: application/json), which publishes every endpoint''s method, path, description, path/query/body parameters and response fields. Security schemes come from https://public-api.wordpress.com/.well-known/openid-configuration. The error envelope was observed live.'
termsOfService: https://wordpress.com/tos/
contact:
name: WordPress.com Developer Resources
url: https://developer.wordpress.com/docs/api/
x-derived-from: https://public-api.wordpress.com/rest/v1.1/help
x-derived-by: API Evangelist enrichment pipeline
servers:
- url: https://public-api.wordpress.com/rest/v1.1
security:
- bearerAuth: []
tags:
- name: stats
paths:
/sites/{site}/stats:
get:
operationId: getSitesBySiteStats
summary: Get a site's stats
description: Get a site's stats
tags:
- stats
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
date:
type: string
description: The most-recent day for which stats are returned
stats:
type: array
items: {}
description: Stats about the requested site
visits:
type: array
items: {}
description: Visits to the requested site
'400':
description: Bad request
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'401':
description: Authorization required
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'403':
description: Forbidden
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'404':
description: Not found
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
parameters:
- name: site
in: path
required: true
schema:
type: string
description: The site's id or domain
- name: context
in: query
required: false
schema:
type: string
enum:
- display
- edit
description: '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..'
- name: http_envelope
in: query
required: false
schema:
type: boolean
description: '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.'
- name: pretty
in: query
required: false
schema:
type: boolean
description: 'false: (default); true: Output pretty JSON'
- name: meta
in: query
required: false
schema:
type: string
description: 'Optional. Loads data from the endpoints found in the ''meta'' part of the response. Comma-separated list. Example: meta=site,likes'
- name: fields
in: query
required: false
schema:
type: string
description: 'Optional. Returns specified fields only. Comma-separated list. Example: fields=ID,title'
- name: callback
in: query
required: false
schema:
type: string
description: An optional JSONP callback function.
/sites/{site}/stats/archives:
get:
operationId: getSitesBySiteStatsArchives
summary: View a site's archives
description: View a site's archives
tags:
- stats
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
date:
type: string
description: The most-recent day for which stats are returned
days:
type: array
items: {}
description: An array of days and the views of archives pages on those days (omitted when summarize=true)
summary:
type: object
description: Summary of archives page views over the specified period (omitted when summarize=false)
period:
type: string
description: The period represented in the stats returned
'400':
description: Bad request
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'401':
description: Authorization required
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'403':
description: Forbidden
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'404':
description: Not found
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
parameters:
- name: site
in: path
required: true
schema:
type: string
description: The site's id or domain
- name: context
in: query
required: false
schema:
type: string
enum:
- display
- edit
description: '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..'
- name: http_envelope
in: query
required: false
schema:
type: boolean
description: '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.'
- name: pretty
in: query
required: false
schema:
type: boolean
description: 'false: (default); true: Output pretty JSON'
- name: meta
in: query
required: false
schema:
type: string
description: 'Optional. Loads data from the endpoints found in the ''meta'' part of the response. Comma-separated list. Example: meta=site,likes'
- name: fields
in: query
required: false
schema:
type: string
description: 'Optional. Returns specified fields only. Comma-separated list. Example: fields=ID,title'
- name: callback
in: query
required: false
schema:
type: string
description: An optional JSONP callback function.
- name: num
in: query
required: false
schema:
type: integer
description: 'Number of periods to include in the results Default: 1.'
- name: period
in: query
required: false
schema:
type: string
enum:
- day
- week
- month
- year
description: 'day: (default) The output will return results over the past [num] days; week: The output will return results over the past [num] weeks; month: The output will return results over the past [num] months; year: The output will return results over the past [num] years'
- name: date
in: query
required: false
schema:
type: string
description: The most recent day to include in results
- name: start_date
in: query
required: false
schema:
type: string
description: the start date to calculate days included in results
- name: max
in: query
required: false
schema:
type: integer
description: 'The maximum number of results to return Default: 10.'
- name: offset
in: query
required: false
schema:
type: integer
description: The offset, in hours, from GMT for which to fetch results. If omitted, defaults to site's offset
- name: summarize
in: query
required: false
schema:
type: boolean
description: Return summary data instead of detailed period data
- name: skip_archives
in: query
required: false
schema:
type: boolean
description: Skip home/archives pages from the results
- name: migrate_archive_homepage
in: query
required: false
schema:
type: boolean
description: Migrate archive homepage views to update the Home page / Archive display
/sites/{site}/stats/clicks:
get:
operationId: getSitesBySiteStatsClicks
summary: View a site's outbound clicks
description: View a site's outbound clicks
tags:
- stats
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
date:
type: string
description: The most-recent day for which stats are returned
days:
type: array
items: {}
description: An array of days and the clicks that occurred on those days (omitted when summarize=true)
summary:
type: object
description: Summary of clicks that occured over the specified period (omitted when summarize=false)
period:
type: string
description: The period represented in the stats returned
'400':
description: Bad request
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'401':
description: Authorization required
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'403':
description: Forbidden
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'404':
description: Not found
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
parameters:
- name: site
in: path
required: true
schema:
type: string
description: The site's id or domain
- name: context
in: query
required: false
schema:
type: string
enum:
- display
- edit
description: '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..'
- name: http_envelope
in: query
required: false
schema:
type: boolean
description: '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.'
- name: pretty
in: query
required: false
schema:
type: boolean
description: 'false: (default); true: Output pretty JSON'
- name: meta
in: query
required: false
schema:
type: string
description: 'Optional. Loads data from the endpoints found in the ''meta'' part of the response. Comma-separated list. Example: meta=site,likes'
- name: fields
in: query
required: false
schema:
type: string
description: 'Optional. Returns specified fields only. Comma-separated list. Example: fields=ID,title'
- name: callback
in: query
required: false
schema:
type: string
description: An optional JSONP callback function.
- name: num
in: query
required: false
schema:
type: integer
description: 'Number of periods to include in the results Default: 1.'
- name: period
in: query
required: false
schema:
type: string
enum:
- day
- week
- month
- year
description: 'day: (default) The output will return results over the past [num] days; week: The output will return results over the past [num] weeks; month: The output will return results over the past [num] months; year: The output will return results over the past [num] years'
- name: date
in: query
required: false
schema:
type: string
description: The most recent day to include in results
- name: start_date
in: query
required: false
schema:
type: string
description: the start date to calculate days included in results
- name: max
in: query
required: false
schema:
type: integer
description: 'The maximum number of results to return Default: 10.'
- name: offset
in: query
required: false
schema:
type: integer
description: The offset, in hours, from GMT for which to fetch results. If omitted, defaults to site's offset
- name: summarize
in: query
required: false
schema:
type: boolean
description: Return summary data instead of detailed period data
/sites/{site}/stats/clicks/emails/summary:
get:
operationId: getSitesBySiteStatsClicksEmailsSummary
summary: View the total number of email clicks for each post.
description: View the total number of email clicks for each post.
tags:
- stats
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
date:
type: string
description: The most-recent day for which stats are returned
period:
type: string
description: The period for which stats are returned
posts:
type: array
items: {}
description: An array of posts with the total views for each post
'400':
description: Bad request
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'401':
description: Authorization required
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'403':
description: Forbidden
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'404':
description: Not found
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
parameters:
- name: site
in: path
required: true
schema:
type: string
description: The site's id or domain.
- name: context
in: query
required: false
schema:
type: string
enum:
- display
- edit
description: '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..'
- name: http_envelope
in: query
required: false
schema:
type: boolean
description: '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.'
- name: pretty
in: query
required: false
schema:
type: boolean
description: 'false: (default); true: Output pretty JSON'
- name: meta
in: query
required: false
schema:
type: string
description: 'Optional. Loads data from the endpoints found in the ''meta'' part of the response. Comma-separated list. Example: meta=site,likes'
- name: fields
in: query
required: false
schema:
type: string
description: 'Optional. Returns specified fields only. Comma-separated list. Example: fields=ID,title'
- name: callback
in: query
required: false
schema:
type: string
description: An optional JSONP callback function.
- name: quantity
in: query
required: false
schema:
type: integer
description: 'Number of periods to include in the results Default: 10.'
- name: period
in: query
required: false
schema:
type: string
enum:
- hour
- day
- week
- month
- year
- alltime
description: 'hour: (default) The output will return results over the past [num] hours; day: The output will return results over the past [num] days; week: The output will return results over the past [num] weeks; month: The output will return results over the past [num] months; year: The output will return results over the past [num] years; alltime: The output will return results from all time'
- name: date
in: query
required: false
schema:
type: string
description: The most recent day to include in results, accepts Y-m-d format
/sites/{site}/stats/clicks/emails/{post_id}:
get:
operationId: getSitesBySiteStatsClicksEmailsByPostId
summary: View chart stats related to email clicks by period.
description: View chart stats related to email clicks by period.
tags:
- stats
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
data:
type: object
description: An object containing the clicks.
'400':
description: Bad request
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'401':
description: Authorization required
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'403':
description: Forbidden
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'404':
description: Not found
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
parameters:
- name: site
in: path
required: true
schema:
type: string
description: The site's id or domain.
- name: post_id
in: path
required: true
schema:
type: integer
description: The post's id
- name: context
in: query
required: false
schema:
type: string
enum:
- display
- edit
description: '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..'
- name: http_envelope
in: query
required: false
schema:
type: boolean
description: '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.'
- name: pretty
in: query
required: false
schema:
type: boolean
description: 'false: (default); true: Output pretty JSON'
- name: meta
in: query
required: false
schema:
type: string
description: 'Optional. Loads data from the endpoints found in the ''meta'' part of the response. Comma-separated list. Example: meta=site,likes'
- name: fields
in: query
required: false
schema:
type: string
description: 'Optional. Returns specified fields only. Comma-separated list. Example: fields=ID,title'
- name: callback
in: query
required: false
schema:
type: string
description: An optional JSONP callback function.
- name: quantity
in: query
required: false
schema:
type: integer
description: Number of periods to include in the results
- name: period
in: query
required: false
schema:
type: string
enum:
- hour
- day
description: 'hour: (default) The output will return results over the next [quantity] hours; day: The output will return results over the next [quantity] days'
- name: date
in: query
required: false
schema:
type: string
description: The most recent day to include in results, accepts Y-m-d or Y-m-d\Th:00:00
/sites/{site}/stats/clicks/emails/{post_id}/client:
get:
operationId: getSitesBySiteStatsClicksEmailsByPostIdClient
summary: View email clicks by client.
description: View email clicks by client.
tags:
- stats
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
clients:
type: object
description: An object containing the email clicks by client.
'400':
description: Bad request
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'401':
description: Authorization required
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'403':
description: Forbidden
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'404':
description: Not found
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
parameters:
- name: site
in: path
required: true
schema:
type: string
description: The site's id or domain.
- name: post_id
in: path
required: true
schema:
type: integer
description: The post's id
- name: context
in: query
required: false
schema:
type: string
enum:
- display
- edit
description: '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..'
- name: http_envelope
in: query
required: false
schema:
type: boolean
description: '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.'
- name: pretty
in: query
required: false
schema:
type: boolean
description: 'false: (default); true: Output pretty JSON'
- name: meta
in: query
required: false
schema:
type: string
description: 'Optional. Loads data from the endpoints found in the ''meta'' part of the response. Comma-separated list. Example: meta=site,likes'
- name: fields
in: query
required: false
schema:
type: string
description: 'Optional. Returns specified fields only. Comma-separated list. Example: fields=ID,title'
- name: callback
in: query
required: false
schema:
type: string
description: An optional JSONP callback function.
/sites/{site}/stats/clicks/emails/{post_id}/country:
get:
operationId: getSitesBySiteStatsClicksEmailsByPostIdCountry
summary: View email clicks by country.
description: View email clicks by country.
tags:
- stats
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
countries:
type: object
description: An object containing the email clicks by country.
'400':
description: Bad request
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'401':
description: Authorization required
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'403':
description: Forbidden
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'404':
description: Not found
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
parameters:
- name: site
in: path
required: true
schema:
type: string
description: The site's id or domain.
- name: post_id
in: path
required: true
schema:
type: integer
description: The post's id
- name: context
in: query
required: false
schema:
type: string
enum:
- display
- edit
description: '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..'
- name: http_envelope
in: query
required: false
schema:
type: boolean
description: '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.'
- name: pretty
in: query
required: false
schema:
type: boolean
description: 'false: (default); true: Output pretty JSON'
- name: meta
in: query
required: false
schema:
type: string
description: 'Optional. Loads data from the endpoints found in the ''meta'' part of the response. Comma-separated list. Example: meta=site,likes'
- name: fields
in: query
required: false
schema:
type: string
description: 'Optional. Returns specified fields only. Comma-separated list. Example: fields=ID,title'
- name: callback
in: query
required: false
schema:
type: string
description: An optional JSONP callback function.
/sites/{site}/stats/clicks/emails/{post_id}/device:
get:
operationId: getSitesBySiteStatsClicksEmailsByPostIdDevice
summary: View email clicks by device.
description: View email clicks by device.
tags:
- stats
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
devices:
type: object
description: An object containing the email clicks by device.
'400':
description: Bad request
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'401':
description: Authorization required
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'403':
description: Forbidden
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'404':
description: Not found
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
parameters:
- name: site
in: path
required: true
schema:
type: string
description: The site's id or domain.
- name: post_id
in: path
required: true
schema:
type: integer
description: The post's id
- name: context
in: query
required: false
schema:
type: string
enum:
- display
- edit
description: '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..'
- name: http_envelope
in: query
required: false
schema:
type: boolean
description: '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.'
- name: pretty
in: query
required: false
schema:
type: boolean
description: 'false: (default); true: Output pretty JSON'
- name: meta
in: query
required: false
schema:
type: string
description: 'Optional. Loads data from the endpoints found in the ''meta'' part of the response. Comma-separated list. Example: meta=site,likes'
- name: fields
in: query
required: false
schema:
type: string
description: 'Optional. Returns specified fields only. Comma-separated list. Example: fields=ID,title'
- name: callback
in: query
required: false
schema:
ty
# --- truncated at 32 KB (177 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/automattic/refs/heads/main/openapi/automattic-stats-api-openapi.yml