Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelistoverlay
GET/index.php?module=API&method=Insights.canGenerateInsightsCheck if insights can run for a period · Insights can generate insights#
Ask an LLM
“Can insights be generated for a yearly period, or only shorter ones?”
“Is this date and period combination supported for insights?”
Tell an agent
Check whether insights can be generated for {period} {date}.
Confirm insights support for period {period} on {date}.
GET/index.php?module=API&method=Insights.getInsightsOverviewGet an insights overview across reports · Insights get insights overview#
Ask an LLM
“What notable changes happened across my main reports this week in Matomo?”
“Can I get a quick overview of what grew or dropped compared to the previous period?”
Tell an agent
Get the insights overview for site {idSite}, {period} {date}.
Summarize the key growth and decline insights on site {idSite} for {period} {date}, segment {segment}.
GET/index.php?module=API&method=Insights.getMoversAndShakersOverviewGet movers and shakers across reports · Insights get movers and shakers overview#
Ask an LLM
“Which pages, referrers or countries moved the needle most across all reports?”
“Is there an overview of the biggest movers and shakers for my site?”
Tell an agent
Get the movers and shakers overview for site {idSite}, {period} {date}.
Show the biggest outsized changes across all reports on site {idSite} for {period} {date}.
GET/index.php?module=API&method=Insights.getMoversAndShakersFind movers and shakers in one report · Insights get movers and shakers#
Ask an LLM
“In a single report, which rows changed far more than the site average?”
“Can I limit how many increasers and decreasers are returned for one report?”
Tell an agent
Find movers and shakers in report {reportUniqueId} for site {idSite}, {period} {date}.
Show the top {limitIncreaser} risers in report {reportUniqueId} for site {idSite}, {period} {date}.
GET/index.php?module=API&method=Insights.getInsightsCompare a report against another period · Insights get insights#
Ask an LLM
“Which rows of a report grew by more than 20% versus the previous period?”
“Can I ignore small changes and only see rows with meaningful growth?”
Tell an agent
Generate insights for report {reportUniqueId} on site {idSite}, {period} {date}.
Show rows of {reportUniqueId} on site {idSite} ({period} {date}) with at least {minGrowthPercent}% growth.
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Get an API key
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.
openapi: 3.2.0
info:
title: Matomo Reporting API for plugin Insights API
version: 1.0.0
description: Provides API methods for insight and mover/shaker comparisons between report periods.
servers:
- url: https://demo-proxy.innocraft.cloud/
description: Current Matomo instance
security:
- MatomoToken: []
tags:
- name: Insights
description: Provides API methods for insight and mover/shaker comparisons between report periods.
paths:
/index.php?module=API&method=Insights.canGenerateInsights:
get:
tags:
- Insights
description: Detects whether insights can be generated for this date/period combination or not.
operationId: Insights.canGenerateInsights
parameters:
- $ref: '#/components/parameters/formatOptional'
- name: date
in: query
description: The date or date range to process. 'YYYY-MM-DD', magic keywords (today, yesterday, lastWeek, lastMonth, lastYear), or date range (ie, 'YYYY-MM-DD,YYYY-MM-DD', lastX, previousX).
required: true
schema:
type: string
example: yesterday
- name: period
in: query
description: The period to process, processes data for the period containing the specified date.
required: true
schema:
type: string
enum:
- day
- week
- month
- year
- range
example: day
responses:
'200':
description: 'Whether a previous comparison period exists for the requested date/period combination.
Example responses require Super User access. Use Try it out to see a live response.'
content:
text/xml: []
application/json: []
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
'500':
$ref: '#/components/responses/ServerError'
default:
$ref: '#/components/responses/DefaultError'
summary: Insights can generate insights
x-summary-source: derived
/index.php?module=API&method=Insights.getInsightsOverview:
get:
tags:
- Insights
description: Generates insights for a set of reports. Plugins can add their own reports to be included in the insights overview by listening to the {@hook Insights.addReportToOverview} event.
operationId: Insights.getInsightsOverview
parameters:
- $ref: '#/components/parameters/formatOptional'
- name: idSite
in: query
description: The numeric ID of the website to query.
required: true
schema:
type: integer
example: 1
- name: period
in: query
description: The period to process, processes data for the period containing the specified date.
required: true
schema:
type: string
enum:
- day
- week
- month
- year
- range
example: day
- name: date
in: query
description: The date or date range to process. 'YYYY-MM-DD', magic keywords (today, yesterday, lastWeek, lastMonth, lastYear), or date range (ie, 'YYYY-MM-DD,YYYY-MM-DD', lastX, previousX).
required: true
schema:
type: string
example: yesterday
- name: segment
in: query
description: 'Custom segment to filter the report. Example: "referrerName==example.com" Supports AND (;) and OR (,) operators.'
required: false
schema:
type: string
responses:
'200':
description: 'Insight tables for every report included in the overview.
Example responses require Super User access. Use Try it out to see a live response.'
content:
text/xml: []
application/json: []
application/vnd.ms-excel: []
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
'500':
$ref: '#/components/responses/ServerError'
default:
$ref: '#/components/responses/DefaultError'
summary: Insights get insights overview
x-summary-source: derived
/index.php?module=API&method=Insights.getMoversAndShakersOverview:
get:
tags:
- Insights
description: Detects the movers and shakers for a set of reports. Plugins can add their own reports to be included in this overview by listening to the {@hook Insights.addReportToOverview} event.
operationId: Insights.getMoversAndShakersOverview
parameters:
- $ref: '#/components/parameters/formatOptional'
- name: idSite
in: query
description: The numeric ID of the website to query.
required: true
schema:
type: integer
example: 1
- name: period
in: query
description: The period to process, processes data for the period containing the specified date.
required: true
schema:
type: string
enum:
- day
- week
- month
- year
- range
example: day
- name: date
in: query
description: The date or date range to process. 'YYYY-MM-DD', magic keywords (today, yesterday, lastWeek, lastMonth, lastYear), or date range (ie, 'YYYY-MM-DD,YYYY-MM-DD', lastX, previousX).
required: true
schema:
type: string
example: yesterday
- name: segment
in: query
description: 'Custom segment to filter the report. Example: "referrerName==example.com" Supports AND (;) and OR (,) operators.'
required: false
schema:
type: string
responses:
'200':
description: 'Movers-and-shakers tables for every report included in the overview.
Example responses require Super User access. Use Try it out to see a live response.'
content:
text/xml: []
application/json: []
application/vnd.ms-excel: []
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
'500':
$ref: '#/components/responses/ServerError'
default:
$ref: '#/components/responses/DefaultError'
summary: Insights get movers and shakers overview
x-summary-source: derived
/index.php?module=API&method=Insights.getMoversAndShakers:
get:
tags:
- Insights
description: Detects the movers and shakers of a given date / report combination. A mover and shakers has an higher impact than other rows on average. For instance if a sites pageviews increase by 10% a page that increased by 40% at the same time contributed significantly more to the success than the average of 10%.
operationId: Insights.getMoversAndShakers
parameters:
- $ref: '#/components/parameters/formatOptional'
- name: idSite
in: query
description: The numeric ID of the website to query.
required: true
schema:
type: integer
example: 1
- name: period
in: query
description: The period to process, processes data for the period containing the specified date.
required: true
schema:
type: string
enum:
- day
- week
- month
- year
- range
example: day
- name: date
in: query
description: The date or date range to process. 'YYYY-MM-DD', magic keywords (today, yesterday, lastWeek, lastMonth, lastYear), or date range (ie, 'YYYY-MM-DD,YYYY-MM-DD', lastX, previousX).
required: true
schema:
type: string
example: yesterday
- name: reportUniqueId
in: query
description: Report identifier, for example `Actions_getPageUrls`.
required: true
schema:
type: string
example: VisitsSummary_get
- name: segment
in: query
description: 'Custom segment to filter the report. Example: "referrerName==example.com" Supports AND (;) and OR (,) operators.'
required: false
schema:
type: string
- name: comparedToXPeriods
in: query
description: Number of past periods to compare against.
required: false
schema:
type: integer
default: 1
- name: limitIncreaser
in: query
description: Maximum number of positive movers to include. `0` excludes them.
required: false
schema:
type: integer
default: 4
- name: limitDecreaser
in: query
description: Maximum number of negative movers to include. `0` excludes them.
required: false
schema:
type: integer
default: 4
responses:
'200':
description: 'Movers-and-shakers rows for the requested report.
Example responses require Super User access. Use Try it out to see a live response.'
content:
text/xml: []
application/json: []
application/vnd.ms-excel: []
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
'500':
$ref: '#/components/responses/ServerError'
default:
$ref: '#/components/responses/DefaultError'
summary: Insights get movers and shakers
x-summary-source: derived
/index.php?module=API&method=Insights.getInsights:
get:
tags:
- Insights
description: Generates insights by comparing the report for a given date/period with a different date and calculating the difference. The API can exclude rows which growth is not good enough or did not have enough impact.
operationId: Insights.getInsights
parameters:
- $ref: '#/components/parameters/formatOptional'
- name: idSite
in: query
description: The numeric ID of the website to query.
required: true
schema:
type: integer
example: 1
- name: period
in: query
description: The period to process, processes data for the period containing the specified date.
required: true
schema:
type: string
enum:
- day
- week
- month
- year
- range
example: day
- name: date
in: query
description: The date or date range to process. 'YYYY-MM-DD', magic keywords (today, yesterday, lastWeek, lastMonth, lastYear), or date range (ie, 'YYYY-MM-DD,YYYY-MM-DD', lastX, previousX).
required: true
schema:
type: string
example: yesterday
- name: reportUniqueId
in: query
description: Report identifier, for example `Actions_getPageUrls`.
required: true
schema:
type: string
example: VisitsSummary_get
- name: segment
in: query
description: 'Custom segment to filter the report. Example: "referrerName==example.com" Supports AND (;) and OR (,) operators.'
required: false
schema:
type: string
- name: limitIncreaser
in: query
description: Maximum number of positive movers to include. `0` excludes them.
required: false
schema:
type: integer
default: 5
- name: limitDecreaser
in: query
description: Maximum number of negative movers to include. `0` excludes them.
required: false
schema:
type: integer
default: 5
- name: filterBy
in: query
description: Optional filter for mover type.
required: false
schema:
type: string
default: ''
enum:
- ''
- movers
- new
- disappeared
- name: minImpactPercent
in: query
description: Minimum impact threshold in percent.
required: false
schema:
type: integer
default: 2
- name: minGrowthPercent
in: query
description: Minimum growth threshold in percent compared to the previous period.
required: false
schema:
type: integer
default: 20
- name: comparedToXPeriods
in: query
description: Number of past periods to compare against.
required: false
schema:
type: integer
default: 1
- name: orderBy
in: query
description: Row ordering mode.
required: false
schema:
type: string
default: absolute
enum:
- absolute
- relative
- importance
responses:
'200':
description: 'Insight rows for the requested report.
Example responses require Super User access. Use Try it out to see a live response.'
content:
text/xml: []
application/json: []
application/vnd.ms-excel: []
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
'500':
$ref: '#/components/responses/ServerError'
default:
$ref: '#/components/responses/DefaultError'
summary: Insights get insights
x-summary-source: derived
components:
responses:
Forbidden:
description: Authenticated but not allowed to access the resource.
content:
text/plain:
schema:
type: string
example: 'Error: Not authorised.'
text/html:
schema:
type: string
example: Not authorised.
application/json:
schema:
$ref: '#/components/schemas/Error'
application/xml:
schema:
$ref: '#/components/schemas/ErrorXml'
BadRequest:
description: Bad request (validation or missing parameters).
content:
text/plain:
schema:
type: string
example: 'Error: There was an error.'
text/html:
schema:
type: string
example: There was an error.
application/json:
schema:
$ref: '#/components/schemas/Error'
application/xml:
schema:
$ref: '#/components/schemas/ErrorXml'
NotFound:
description: Resource not found.
content:
text/plain:
schema:
type: string
example: 'Error: The method is not available.'
text/html:
schema:
type: string
example: The method is not available.
application/json:
schema:
$ref: '#/components/schemas/Error'
application/xml:
schema:
$ref: '#/components/schemas/ErrorXml'
Unauthorized:
description: Authentication failed or missing token.
content:
text/plain:
schema:
type: string
example: 'Error: You must be logged in to access this functionality.'
text/html:
schema:
type: string
example: You must be logged in to access this functionality.
application/json:
schema:
$ref: '#/components/schemas/Error'
application/xml:
schema:
$ref: '#/components/schemas/ErrorXml'
ServerError:
description: Unexpected server error.
content:
text/plain:
schema:
type: string
example: 'Error: There was an error.'
text/html:
schema:
type: string
example: There was an error.
application/json:
schema:
$ref: '#/components/schemas/Error'
application/xml:
schema:
$ref: '#/components/schemas/ErrorXml'
DefaultError:
description: Default error response (any non-2xx).
content:
text/plain:
schema:
type: string
example: 'Error: There was an error.'
text/html:
schema:
type: string
example: There was an error.
application/json:
schema:
$ref: '#/components/schemas/Error'
application/xml:
schema:
$ref: '#/components/schemas/ErrorXml'
schemas:
ErrorXml:
description: Generic Matomo error payload in XML.
properties:
error:
properties:
message:
type: string
xml:
attribute: true
example: There was an error
type: object
xml:
name: error
type: object
xml:
name: result
Error:
description: Generic Matomo error payload.
required:
- result
- message
properties:
result:
type: string
example: error
message:
type: string
example: There was an error
code:
type: integer
type: object
additionalProperties: true
parameters:
formatOptional:
name: format
in: query
description: Response format. Defaults to `xml`. Use `original` to get the original PHP data structure.
required: false
schema:
type: string
default: xml
enum:
- xml
- json
- csv
- tsv
- html
- rss
- original
securitySchemes:
MatomoToken:
type: http
description: Paste your token generated from Personal > Security. Swagger will send it as a Bearer token.
scheme: bearer
externalDocs:
description: Matomo Reporting API developer page
url: https://developer.matomo.org/api-reference/reporting-api/