Analytics API Reference

Please check the official Piwik API documentation as well:

PiwikAnalytics

class piwikapi.analytics.PiwikAnalytics

The Piwik analytics API class

Initalize the object

Return type:None
set_parameter(key, value)

Set a query parameter

Parameters:
  • key (str) – The parameter to set
  • value (TODO, str?) – The value you want to set
Return type:

None

remove_parameter(key)

Removes a query parameter

Parameters:key – The parameter to remove
get_parameter(key)

Get a query parameter

Parameters:key (str) – The parameter to return
Return type:TODO mixed?
set_method(method)
Parameters:method (str) – Method
Return type:None
set_id_site(id_site)
Parameters:id_site (int) – Site ID
Return type:None
set_date(date)
Parameters:date (str) – Date string TODO format
Return type:None
set_period(period)
Parameters:period (str) – Period TODO optinos
Return type:None
set_format(format)
Parameters:format (str) – Format TODO
Return type:None
set_filter_limit(filter_limit)
Parameters:filter_limit (TODO ?) – Filter limit TODO
Return type:None
set_api_url(api_url)
Parameters:api_url (str) – Piwik analytics API URL, the root of your Piwik install
Return type:None
set_segment(segment)
Parameters:segment (str) – Which segment to request, see http://piwik.org/docs/analytics-api/segmentation/
Return type:None
get_query_string()

Return the query string

Raises:ConfigurationError if the API URL was not set
Return type:str
send_request()

Make the analytics API request, returns the request body

Return type:str