Account API
The Account API takes your user API key (available from
your user settings page) 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 that extract data from the
Analytics API, as they will always be up to date whenever you add or delete sites, reset site keys, etc.
Send requests to
https://api.clicky.com/api/account/sites with the parameters listed below, either via POST (recommended), or GET.
Help me set up the clicky.com MCP server and access my account. The server URL is `https://clicky.com/mcp`. You'll need my userkey, which you can tell me to copy from `https://clicky.com/user/edit`.
Parameters
- 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', 'php' or 'md'. 'php' will return as a serialized array which you just need to pass through unserialize() to convert into an array with your PHP script. 'md' returns a markdown table (far fewer tokens than json/xml, so it's the best choice when an AI assistant is reading the response). Sending an Accept: text/markdown header instead of the parameter works too when 'output' is absent.
- stats - Optional. Set to 1 and every site row also carries today's full summary under our report-type key names: visitors, visitors-online, visitors-unique, actions, actions-average, time-total, time-average, bounce-rate, goals-tally, goals-revenue (the same ten as type=summary in the Analytics API). The long-standing visitors_online / visitors_today keys are present either way for backwards compatibility, so a stats=1 row has two intentional duplicates: visitors is the same number as visitors_today, and visitors-online the same as visitors_online. The hyphenated names are what every other part of the API uses, so prefer those in new code. Saves an extra API call per site if you're enumerating a whole account.
Caching
Responses are cached server-side for
1 minute on premium accounts (including trial) and
15 minutes on free accounts, so a site you just added may not appear in the list until the cache expires. Repeated calls within that window return the same cached response.
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
https://api.clicky.com/api/account/sites?userkey=YOUR_USER_KEY&output=md
Legacy: username and password
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
📢 Simple, powerful, and easy to use
Join Clicky today and take your analytics to the next level