Account API
The Account API takes your
user API key and returns to you a list of all sites in your account, including hostname, nickname, site ID, sitekey,
admin sitekey, timezone, and a few basic stats (visitors online and visitors 'today').
This is useful for automated processes you have setup to, for example, extract data from the
Analytics API. If your processes refresh their data every day by grabbing the output from this API then they will always be up to date when you add new sites, delete sites, edit existing ones, reset site keys, etc.
Default output is XML but you can request JSON or serialized PHP instead.
Send requests to
https://api.clicky.com/api/account/sites with the parameters listed below, either via GET or POST. We recommend
POST, because parameters in the URL may otherwise end up in server logs, proxy caches, and browser histories, while POST keeps your key out of all that.
userkey
Required. Your user API key, available on your
user preferences page. The key is independent of your password, so it keeps working if you change your password, and it works even if your account uses
Sign in with Google.
output
Optional. Defaults to 'xml' if unspecified. Acceptable values are 'xml', 'json' or 'php'. 'php' will return as a serialized array which you just need to pass through
unserlialize() to convert into an array with your PHP script.
Example API calls
POST (recommended)
curl -d "userkey=YOUR_USER_KEY&output=json" https://api.clicky.com/api/account/sites
GET:
https://api.clicky.com/api/account/sites?userkey=YOUR_USER_KEY -- defaults to XML
https://api.clicky.com/api/account/sites?userkey=YOUR_USER_KEY&output=xml
https://api.clicky.com/api/account/sites?userkey=YOUR_USER_KEY&output=php
https://api.clicky.com/api/account/sites?userkey=YOUR_USER_KEY&output=json
Legacy: username and password
Note: this method is deprecated and will be removed in the near future. Please switch to the user API key above. If you use Sign in with Google, this method no longer applies to you, as the user key works instead.
Requests can also still be authenticated by passing your
username (or email address) and
password as parameters instead of userkey:
https://api.clicky.com/api/account/sites?username=bob&password=jones
📢 Want clearer, faster web analytics?
Sign up for Clicky today and see your data differently