API reference
This document is the Piwik API Reference. It lists all functions that can be called, documents the parameters, and links to examples for every call in the various formats. For more information, check out the Piwik Analytics API user documentation page.
Some examples first
- XML of the visits of the last 10 days, one entry per day
- XML containing keywords from the last 3 weeks, one entry per week
- XML containing the keywords from the last 3 days which match the pattern "piwik"
- RSS feed containing the top 30 keywords for the last 3 weeks, ordered by the number of actions people did when coming from these keywords
Standard parameters
- idSite
- the integer id of your website, eg. idSite=1
- you can also specify a list of idSites comma separated, eg. idSite=1,4,5,6
- if you want to get data for all websites, set idSite=all
- period ; the period you request the statistics for. Can be any of: day, week, month or year. All reports are returned for the dates based on the website's time zone.
- 'day' returns data for a given day.
- 'week' returns data for the week that contains the specified 'date'
- 'month' returns data for the month that contains the specified 'date'
- 'year' returns data for the year that contains the specified 'date'
- date
- standard format = YYYY-MM-DD
- magic keywords = today or yesterday. They are relative the website timezone. For example, for a website with UTC+12 timezone, "date=today" for an API request at 5PM UTC on 2010-01-01 will return the reports for 2010-01-02.
- range of dates
- lastX for the last X periods including today (eg &date=last10&period=day would return an entry for each of the last 10 days including today). This is relative to the website timezone.
- previousX returns the last X periods before today (eg. &date=last52&period=week will return an entry for each of the 52 weeks before this week). This is relative to the website timezone.
- YYYY-MM-DD,YYYY-MM-DD for every day in the date range
- format ; defines the format of the output
- xml
- json (if you want to do cross domain request in ajax and get json data, you can wrap the json data around a function call by using the jsoncallback parameter)
- csv (Comma separated values)
- tsv (Tab Separated Values, similar to CSV but loads properly in Excel)
- html
- php ; when you export in PHP format it is serialized by default (set serialize=0 to get the raw php data structure). You can have a visual output of the data by setting prettyDisplay=1
- rss (when date is a range for example date=last10 or date=previous15)
- original ; to fetch the original PHP data structure. This is useful when you call the Piwik API internally using the PHP code
Make an authenticated call
In the example above, the request works because the statistics are public (the anonymous user has a view access to the website). Usually you don't want your statistics to be public.
- when you go in your piwik installation you are requested to login
- when you call the API over http you need to authenticate yourself
This is done by adding a secret parameter in the URL. This parameter is as secret as your login and password!
You can get this token in the Manage Users admin area.
Then you simply have to add the parameter &token_auth=YOUR_TOKEN at the end of your API call URL.
Other optional parameters
Each API call can contain parameters that do not appear in the list of parameters, but act as "filters". Filters can be presentation filters (eg. specify the language for internationalization), or act as data helpers (sort results, search for a dataset subset, fetch children of a given entity).
Here is an overview of the parameters you can add to any request returning data tables:
- filter_offset ; defines the offset of the starting row being returned
- filter_limit ; defines the number of rows to be returned. Set to -1 to return all rows. By default, only the top 100 rows are returned.
- filter_truncate ; if set, will truncate the table after $filter_truncate rows. The last row will be named 'Others' (localized in the requested language) and the columns will be an aggregate of statistics of all truncated rows.
- filter_pattern ; defines the text we want to search for in the filter_column. Only the row with the given column matching the pattern will be returned.
- filter_column ; defines the column that we want to search for a text (see filter_pattern).
- filter_sort_order ; defines the order of the results, asc or desc
- filter_sort_column ; defines to column to be sorted by
- filter_excludelowpop ; defines the column to use for the threshold of value filter_excludelowpop_value ; only the columns with a value greater than filter_excludelowpop_value will be returned
- filter_excludelowpop_value defines the minimum value for the filter_excludelowpop column
- filter_column_recursive ; defines the column to be searched for when recursively searching for a pattern filter_pattern_recursive
- filter_pattern_recursive ; defines the text we are searching for. Only the matching rows are returned. This filter is applied to recursive tables (Actions / Downloads / Outlinks tables)
- disable_generic_filters ; if set to 1, all the generic filters above will not be applied (useful because the filters above are applied all the time with default values. Sometimes this is annoying so we want to disable this behaviour)
- disable_queued_filters ; if set to 1, all the filters that are mostly presentation filters (replace a column name, apply callbacks on the column to add new information such as the browser icon URL, etc.) will not be applied (rarely useful).
- idSubtable is used to request a subtable of a given row. In Piwik, some rows are linked to a sub table. For example, each row in the Referers.getSearchEngines response have a "idsubdatatable" field. This integer idsubdatatable is the idSubtable of the table that contains all keywords for this search engine. You can then request the keywords for this search engine by calling Referers.getKeywordsFromSearchEngineId with the parameter idSubtable=X (replace X with the idsubdatatable value found in the Referers.getSearchEngines response, for the search engine you are interested in).
- language ; if specified, returned data strings that can be internationalized will be translated. For example, dates and times returned by the Live API can be translated in the specified language. Expected value is the 2 language letters code, eg. en, fr, de, es, etc. You can get the available list of language by calling the LanguagesManager API.
Passing an Array Parameter
Some parameters can optionally accept arrays. For example, the urls parameter of SitesManager.addSite, SitesManager.addSiteAliasUrls, and SitesManager.updateSite allow for an array of urls to be passed. To pass an array add the bracket operators and an index to the parameter name in the get request. So, to call SitesManager.addSite with two urls you would use the following array:
Methods
We will add the documentation of every method soon, but hopefully their name are already quite descriptive.
Module API
- API.getDefaultMetrics () [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html ]- API.getDefaultProcessedMetrics () [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html ]
- API.getMetadata (idSite, apiModule, apiAction, apiParameters = 'Array') [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html ]
- API.getReportMetadata (idSites = '') [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html ]
- API.getProcessedReport (idSite, date, period, apiModule, apiAction, apiParameters = '') [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html , RSS of the last 10 days, 5 weeks, XML of the last 10 days ]
Module Actions
- Actions.getPageUrls (idSite, period, date, expanded = '', idSubtable = '') [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html , RSS of the last 10 days, 5 weeks, XML of the last 10 days ]- Actions.getPageTitles (idSite, period, date, expanded = '', idSubtable = '') [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html , RSS of the last 10 days, 5 weeks, XML of the last 10 days ]
- Actions.getDownloads (idSite, period, date, expanded = '', idSubtable = '') [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html , RSS of the last 10 days, 5 weeks, XML of the last 10 days ]
- Actions.getOutlinks (idSite, period, date, expanded = '', idSubtable = '') [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html , RSS of the last 10 days, 5 weeks, XML of the last 10 days ]
Module DBStats
- DBStats.getDBStatus () [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html ]- DBStats.getTableStatus (table, field = '') [ No example available ]
- DBStats.getAllTablesStatus () [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html ]
Module ExampleAPI
- ExampleAPI.getPiwikVersion () [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html ]- ExampleAPI.getAnswerToLife () [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html ]
- ExampleAPI.getObject () [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html ]
- ExampleAPI.getSum (a = '0', b = '0') [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html ]
- ExampleAPI.getNull () [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html ]
- ExampleAPI.getDescriptionArray () [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html ]
- ExampleAPI.getCompetitionDatatable () [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html ]
- ExampleAPI.getMoreInformationAnswerToLife () [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html ]
- ExampleAPI.getMultiArray () [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html ]
Module Goals
- Goals.getGoals (idSite) [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html ]- Goals.addGoal (idSite, name, matchAttribute, pattern, patternType, caseSensitive = '', revenue = '') [ No example available ]
- Goals.updateGoal (idSite, idGoal, name, matchAttribute, pattern, patternType, caseSensitive = '', revenue = '') [ No example available ]
- Goals.deleteGoal (idSite, idGoal) [ No example available ]
- Goals.get (idSite, period, date, idGoal = '', columns = 'Array') [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html , RSS of the last 10 days, 5 weeks, XML of the last 10 days ]
- Goals.getConversions (idSite, period, date, idGoal = '') [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html , RSS of the last 10 days, 5 weeks, XML of the last 10 days ]
- Goals.getConversionRate (idSite, period, date, idGoal = '') [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html , RSS of the last 10 days, 5 weeks, XML of the last 10 days ]
- Goals.getRevenue (idSite, period, date, idGoal = '') [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html , RSS of the last 10 days, 5 weeks, XML of the last 10 days ]
Module LanguagesManager
- LanguagesManager.isLanguageAvailable (languageCode) [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html ]- LanguagesManager.getAvailableLanguages () [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html ]
- LanguagesManager.getAvailableLanguagesInfo () [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html ]
- LanguagesManager.getAvailableLanguageNames () [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html ]
- LanguagesManager.getTranslationsForLanguage (languageCode) [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html ]
- LanguagesManager.getLanguageForUser (login) [ No example available ]
- LanguagesManager.setLanguageForUser (login, languageCode) [ No example available ]
- LanguagesManager.getLanguageForSession () [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html ]
- LanguagesManager.setLanguageForSession (languageCode) [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html ]
Module Live
- Live.getLastVisitForVisitor (visitorId, idSite) [ No example available ]- Live.getLastVisitsForVisitor (visitorId, idSite, limit = '10') [ No example available ]
- Live.getLastVisits (idSite, limit = '10', minIdVisit = '') [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html ]
- Live.getLastVisitsDetails (idSite, period = '', date = '', limit = '25', filter_offset = '0', minIdVisit = '') [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html , RSS of the last 10 days, 5 weeks, XML of the last 10 days ]
- Live.getUsersInLastXMin (idSite, minutes = '30') [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html ]
- Live.getUsersInLastXDays (idSite, days = '10') [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html ]
- Live.getPageImpressionsInLastXDays (idSite, days = '10') [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html ]
- Live.getPageImpressionsInLastXMin (idSite, minutes = '30') [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html ]
Module PDFReports
- PDFReports.addReport (idSite, description, period, reports, emailMe = '1', additionalEmails = '') [ No example available ]- PDFReports.updateReport (idReport, idSite, description, period, reports, emailMe = '1', additionalEmails = '') [ No example available ]
- PDFReports.deleteReport (idReport) [ No example available ]
- PDFReports.getReports (idSite = '', period = '', idReport = '', ifSuperUserReturnOnlySuperUserReports = '') [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html , RSS of the last 10 days, 5 weeks, XML of the last 10 days ]
- PDFReports.generateReport (idReport, date, idSite = '', outputType = '', periodUsedFullReport = 'day') [ No example available ]
- PDFReports.sendEmailReport (idReport, idSite) [ No example available ]
- PDFReports.getPeriodToFrequency () [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html ]
Module Provider
- Provider.getProvider (idSite, period, date) [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html , RSS of the last 10 days, 5 weeks, XML of the last 10 days ]Module Referers
- Referers.getRefererType (idSite, period, date, typeReferer = '') [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html , RSS of the last 10 days, 5 weeks, XML of the last 10 days ]- Referers.getKeywords (idSite, period, date, expanded = '') [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html , RSS of the last 10 days, 5 weeks, XML of the last 10 days ]
- Referers.getSearchEnginesFromKeywordId (idSite, period, date, idSubtable) [ No example available ]
- Referers.getSearchEngines (idSite, period, date, expanded = '') [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html , RSS of the last 10 days, 5 weeks, XML of the last 10 days ]
- Referers.getKeywordsFromSearchEngineId (idSite, period, date, idSubtable) [ No example available ]
- Referers.getCampaigns (idSite, period, date, expanded = '') [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html , RSS of the last 10 days, 5 weeks, XML of the last 10 days ]
- Referers.getKeywordsFromCampaignId (idSite, period, date, idSubtable) [ No example available ]
- Referers.getWebsites (idSite, period, date, expanded = '') [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html , RSS of the last 10 days, 5 weeks, XML of the last 10 days ]
- Referers.getUrlsFromWebsiteId (idSite, period, date, idSubtable) [ No example available ]
- Referers.getNumberOfDistinctSearchEngines (idSite, period, date) [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html , RSS of the last 10 days, 5 weeks, XML of the last 10 days ]
- Referers.getNumberOfDistinctKeywords (idSite, period, date) [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html , RSS of the last 10 days, 5 weeks, XML of the last 10 days ]
- Referers.getNumberOfDistinctCampaigns (idSite, period, date) [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html , RSS of the last 10 days, 5 weeks, XML of the last 10 days ]
- Referers.getNumberOfDistinctWebsites (idSite, period, date) [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html , RSS of the last 10 days, 5 weeks, XML of the last 10 days ]
- Referers.getNumberOfDistinctWebsitesUrls (idSite, period, date) [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html , RSS of the last 10 days, 5 weeks, XML of the last 10 days ]
Module SEO
- SEO.getRank (url) [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html ]Module SitesManager
- SitesManager.getJavascriptTag (idSite, piwikUrl = '') [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html ]- SitesManager.getSiteFromId (idSite) [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html ]
- SitesManager.getSiteUrlsFromId (idSite) [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html ]
- SitesManager.getAllSitesId () [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html ]
- SitesManager.getSitesWithAdminAccess () [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html ]
- SitesManager.getSitesWithViewAccess () [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html ]
- SitesManager.getSitesWithAtLeastViewAccess (limit = '') [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html ]
- SitesManager.getSitesIdWithAdminAccess () [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html ]
- SitesManager.getSitesIdWithViewAccess () [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html ]
- SitesManager.getSitesIdWithAtLeastViewAccess () [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html ]
- SitesManager.getSitesIdFromSiteUrl (url) [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html ]
- SitesManager.addSite (siteName, urls, excludedIps = '', excludedQueryParameters = '', timezone = '', currency = '') [ No example available ]
- SitesManager.deleteSite (idSite) [ No example available ]
- SitesManager.addSiteAliasUrls (idSite, urls) [ No example available ]
- SitesManager.setGlobalExcludedIps (excludedIps) [ No example available ]
- SitesManager.getExcludedQueryParametersGlobal () [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html ]
- SitesManager.setGlobalExcludedQueryParameters (excludedQueryParameters) [ No example available ]
- SitesManager.getExcludedIpsGlobal () [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html ]
- SitesManager.getDefaultCurrency () [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html ]
- SitesManager.setDefaultCurrency (defaultCurrency) [ No example available ]
- SitesManager.getDefaultTimezone () [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html ]
- SitesManager.setDefaultTimezone (defaultTimezone) [ No example available ]
- SitesManager.updateSite (idSite, siteName, urls = '', excludedIps = '', excludedQueryParameters = '', timezone = '', currency = '') [ No example available ]
- SitesManager.getCurrencyList () [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html ]
- SitesManager.getCurrencySymbols () [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html ]
- SitesManager.getTimezonesList () [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html ]
- SitesManager.getPatternMatchSites (pattern) [ No example available ]
Module UserCountry
- UserCountry.getCountry (idSite, period, date) [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html , RSS of the last 10 days, 5 weeks, XML of the last 10 days ]- UserCountry.getContinent (idSite, period, date) [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html , RSS of the last 10 days, 5 weeks, XML of the last 10 days ]
- UserCountry.getNumberOfDistinctCountries (idSite, period, date) [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html , RSS of the last 10 days, 5 weeks, XML of the last 10 days ]
Module UserSettings
- UserSettings.getResolution (idSite, period, date) [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html , RSS of the last 10 days, 5 weeks, XML of the last 10 days ]- UserSettings.getConfiguration (idSite, period, date) [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html , RSS of the last 10 days, 5 weeks, XML of the last 10 days ]
- UserSettings.getOS (idSite, period, date) [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html , RSS of the last 10 days, 5 weeks, XML of the last 10 days ]
- UserSettings.getBrowser (idSite, period, date) [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html , RSS of the last 10 days, 5 weeks, XML of the last 10 days ]
- UserSettings.getBrowserType (idSite, period, date) [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html , RSS of the last 10 days, 5 weeks, XML of the last 10 days ]
- UserSettings.getWideScreen (idSite, period, date) [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html , RSS of the last 10 days, 5 weeks, XML of the last 10 days ]
- UserSettings.getPlugin (idSite, period, date) [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html , RSS of the last 10 days, 5 weeks, XML of the last 10 days ]
Module UsersManager
- UsersManager.setUserPreference (userLogin, preferenceName, preferenceValue) [ No example available ]- UsersManager.getUserPreference (userLogin, preferenceName) [ No example available ]
- UsersManager.getUsers () [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html ]
- UsersManager.getUsersLogin () [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html ]
- UsersManager.getUsersSitesFromAccess (access) [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html ]
- UsersManager.getUsersAccessFromSite (idSite) [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html ]
- UsersManager.getSitesAccessFromUser (userLogin) [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html ]
- UsersManager.getUser (userLogin) [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html ]
- UsersManager.getUserByEmail (userEmail) [ No example available ]
- UsersManager.addUser (userLogin, password, email, alias = '') [ No example available ]
- UsersManager.updateUser (userLogin, password = '', email = '', alias = '') [ No example available ]
- UsersManager.deleteUser (userLogin) [ No example available ]
- UsersManager.userExists (userLogin) [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html ]
- UsersManager.userEmailExists (userEmail) [ No example available ]
- UsersManager.setUserAccess (userLogin, access, idSites) [ No example available ]
- UsersManager.getTokenAuth (userLogin, md5Password) [ No example available ]
Module VisitFrequency
- VisitFrequency.get (idSite, period, date, columns = '') [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html , RSS of the last 10 days, 5 weeks, XML of the last 10 days ]- VisitFrequency.getVisitsReturning (idSite, period, date) [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html , RSS of the last 10 days, 5 weeks, XML of the last 10 days ]
- VisitFrequency.getActionsReturning (idSite, period, date) [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html , RSS of the last 10 days, 5 weeks, XML of the last 10 days ]
- VisitFrequency.getSumVisitsLengthReturning (idSite, period, date) [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html , RSS of the last 10 days, 5 weeks, XML of the last 10 days ]
- VisitFrequency.getBounceCountReturning (idSite, period, date) [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html , RSS of the last 10 days, 5 weeks, XML of the last 10 days ]
- VisitFrequency.getConvertedVisitsReturning (idSite, period, date) [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html , RSS of the last 10 days, 5 weeks, XML of the last 10 days ]
Module VisitTime
- VisitTime.getVisitInformationPerLocalTime (idSite, period, date) [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html , RSS of the last 10 days, 5 weeks, XML of the last 10 days ]- VisitTime.getVisitInformationPerServerTime (idSite, period, date) [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html , RSS of the last 10 days, 5 weeks, XML of the last 10 days ]
Module VisitorInterest
- VisitorInterest.getNumberOfVisitsPerVisitDuration (idSite, period, date) [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html , RSS of the last 10 days, 5 weeks, XML of the last 10 days ]- VisitorInterest.getNumberOfVisitsPerPage (idSite, period, date) [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html , RSS of the last 10 days, 5 weeks, XML of the last 10 days ]
Module VisitsSummary
- VisitsSummary.get (idSite, period, date, columns = '') [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html , RSS of the last 10 days, 5 weeks, XML of the last 10 days ]- VisitsSummary.getVisits (idSite, period, date) [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html , RSS of the last 10 days, 5 weeks, XML of the last 10 days ]
- VisitsSummary.getUniqueVisitors (idSite, period, date) [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html , RSS of the last 10 days, 5 weeks, XML of the last 10 days ]
- VisitsSummary.getActions (idSite, period, date) [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html , RSS of the last 10 days, 5 weeks, XML of the last 10 days ]
- VisitsSummary.getMaxActions (idSite, period, date) [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html , RSS of the last 10 days, 5 weeks, XML of the last 10 days ]
- VisitsSummary.getBounceCount (idSite, period, date) [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html , RSS of the last 10 days, 5 weeks, XML of the last 10 days ]
- VisitsSummary.getVisitsConverted (idSite, period, date) [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html , RSS of the last 10 days, 5 weeks, XML of the last 10 days ]
- VisitsSummary.getSumVisitsLength (idSite, period, date) [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html , RSS of the last 10 days, 5 weeks, XML of the last 10 days ]
- VisitsSummary.getSumVisitsLengthPretty (idSite, period, date) [ Example in XML, PHP, Json, Csv, Tsv (Excel), Basic html , RSS of the last 10 days, 5 weeks, XML of the last 10 days ]
Piwik metrics definition
Here is a list of metrics returned by the API and their definition.
General
- nb_uniq_visitors - Number of unique visitors
- nb_visits - Number of Visits (30 min of inactivity considered a new visit)
- nb_actions - Number of actions (page views, outlinks and downloads)
- sum_visit_length - Total time spent, in seconds
- bounce_count - Number of visits that bounced (viewed only one page)
- max_actions - Maximum number of actions in a visit
- nb_visits_converted - Number of visits that converted a goal
- nb_conversions - Number of goal conversions
- revenue - Total revenue of goal conversions
Metrics specific to page views URLs
- nb_hits - Number of views on this page
- entry_nb_visits - Number of visits that started on this page
- entry_nb_uniq_visitors - Number of unique visitors that started their visit on this page
- entry_nb_actions - Number of page views for visits that started on this page
- entry_sum_visit_length - Time spent, in seconds, by visits that started on this page
- entry_bounce_count - Number of visits that started on this page, and bounced (viewed only one page)
- exit_nb_visits - Number of visits that finished on this page
- exit_nb_uniq_visitors - Number of unique visitors that ended their visit on this page
- sum_time_spent - Total time spent on this page, in seconds
- sum_daily_nb_uniq_visitors - Sum of daily unique visitors over days in the period. Piwik doesn't process unique visitors across the full period.
- sum_daily_entry_nb_uniq_visitors - Sum of daily unique visitors that started their visit on this page
- sum_daily_exit_nb_uniq_visitors - (deprecated) Same as sum_daily_entry_nb_uniq_visitors
- exit_bounce_count - (deprecated) Same as entry_bounce_count
Processed metrics
- avg_time_on_page - Average time spent, in seconds, on this page
- bounce_rate - Ratio of visitors leaving the website after landing on this page
- exit_rate - Ratio of visitors that do not view any other page after this page
See also
- Find other documentation on Piwik web analytics API
- Learn more about the power of Metadata API
