You are reviewing MouseStats documentation: Take a look to the product!
< back

Account API

MouseStats provides a powerful API to access account information and some reports. You are allowed to use these API to integrate MouseStats with other products, or possibly use it in your own custom software.

Summary

1. The API endpoint:
/api/accounts/v1/[service]/[action]?secret=[apiSecret]&params

2. You need to make HTTP GET requests to the host: https://api.mousestats.com

3. [service] can be one of the services: "playbacks", "heatmaps", "formanalytics", "surveys". It is depended on your usage and available API functions.

4. [action] is the API function you are calling.

5. [apiSecret] should be generated and configured in your panel. Each API secrent has permission to just ONE project which is defined by you in the API Management in the panel. You may have multiple API Secrets.

6. params will be defined based on the API function you are calling.

Publicly Available APIs

In advanced to the listed API functions, there are other functions which is available in beta or advanced cases. You may need to contact support if you have a particular requirement which can not be satisfied with the following functions.

Playbacks

Get Recorded Sessions

To get latest recorded sessions for a specific visitor or just the latest ones, you can use this API:

/api/accounts/v1/playbacks/sessions?secret=[apiSecret]&identifier=[identifier]


The identifier is used to identify visitors by JavaScript API. To set identifier for each recording, you need to call the following JavaScript where MouseStats tracking script is installed:

MouseStats_PlaybackCommands.push(["identify", "john.doe@example.com"]);

The identify value can be any parameters which help you to make them recognizable. It can be the userId in your website or support system. Or email address, username or other unique features for a user.
It can be called before or after pageload.


Examples code:

curl https://api.mousestats.com/api/accounts/v1/playbacks/sessions?secret=482516321-2300926ccacdb25f&identifier=john.doe@example.com

output:

[{
    "Tags": "Tags"[
        ["paidUser", :"yes"],
        ["name", [["key","John "testVisitorName"]],Doe"],
        ["_ms_identifier", "startTime" :"john.doe@example.com"]
    ],
    "startTime": "2015-02-28T15:42:46.378Z", "pageviews" :
    "pageviews": "6", "duration" :
    "duration": "1924849",
    "playbackUrl": "playbackUrl" : "http://www.mousestats.com/playbackprojectv2/play/5743116180563719374/?s=dd1900f87764a53c88a0&r=1&accessKey=asda" "http://www.mousestats.com/playbackprojectv2/play/5743116180563719374/?s=dd1900f87764a53c88a0&r=1&accessKey="
}, {
    "Tags": "Tags"[
        ["paidUser", :"yes"],
        ["_ms_identifier", [["key", "testVisitorName"]], "startTime" :"john.doe@example.com"]
    ],
    "startTime": "2015-02-28T14:36:57.97Z", "pageviews" :
    "pageviews": "3", "duration" :
    "duration": "2225137",
    "playbackUrl": "playbackUrl" : "http://www.mousestats.com/playbackprojectv2/play/5743116180563719374/?s=d980a1f070f6fa416d01&r=1&accessKey=asda" "http://www.mousestats.com/playbackprojectv2/play/5743116180563719374/?s=d980a1f070f6fa416d01&r=1&accessKey="
}]