Website button & WhatsApp links
Website button statistics
/v2/widgets/{widgetId}/stats- Scope:
widgets:read - Idempotency-Key:not used
- read only
Impressions (only when enabled, sampled), clicks, attributed conversations and conversion rate — per day, page, utm source / medium, campaign, agent, device and referrer domain. Counts only.
Request
curl -X GET "https://mursilat.com/api/v2/widgets/widgetId/stats?from=2026-10-01&to=2026-10-14" \
-H "Authorization: Bearer $WASLA_API_KEY"const res = await fetch('https://mursilat.com/api/v2/widgets/widgetId/stats?from=2026-10-01&to=2026-10-14', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.WASLA_API_KEY}`,
},
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.error.code}: ${data.error.message}`);
console.log(data);import os
import requests
headers = {"Authorization": f"Bearer {os.environ['WASLA_API_KEY']}"}
res = requests.get(
"https://mursilat.com/api/v2/widgets/widgetId/stats?from=2026-10-01&to=2026-10-14",
headers=headers,
timeout=30,
)
data = res.json()
if not res.ok:
raise RuntimeError(f"{data['error']['code']}: {data['error']['message']}")
print(data)<?php
$ch = curl_init('https://mursilat.com/api/v2/widgets/widgetId/stats?from=2026-10-01&to=2026-10-14');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('WASLA_API_KEY'),
],
]);
$data = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if ($status >= 400) { throw new Exception($data['error']['code'] . ': ' . $data['error']['message']); }
print_r($data);Send this request without a body.
Response
200Example
{
"range": {
"from": "2026-10-01",
"to": "2026-10-14",
"tz": "Africa/Cairo"
},
"totals": {
"impressions": null,
"clicks": 40,
"conversations": 12,
"conversionRate": 0.3
},
"byDay": [
{
"day": "2026-10-14",
"impressions": 0,
"clicks": 3,
"conversations": 1
}
],
"byPage": [
{
"key": "/products/bag",
"clicks": 10,
"conversations": 3
}
],
"bySource": [
{
"key": "facebook / cpc",
"source": "facebook",
"medium": "cpc",
"clicks": 5,
"conversations": 2
}
],
"byCampaign": [
{
"key": "summer",
"clicks": 4,
"conversations": 1
}
],
"byAgent": [
{
"key": "sales",
"clicks": 4,
"conversations": 1
}
],
"byDevice": [
{
"key": "mobile",
"clicks": 30,
"conversations": 9
}
],
"byReferrer": [
{
"key": "facebook.com",
"clicks": 4,
"conversations": 1
}
]
}Fields in this response
Fields of the example answer. Expand objects and arrays.
responseobject9 fields
rangeobject3 fields
- fromstring "2026-10-01"
- tostring "2026-10-14"
- tzstring "Africa/Cairo"
totalsobject4 fields
- impressionsnull null
- clicksinteger 40
- conversationsinteger 12
- conversionRatenumber 0.3
byDayarray1 items
[0]object4 fields
- daystring "2026-10-14"
- impressionsinteger 0
- clicksinteger 3
- conversationsinteger 1
byPagearray1 items
[0]object3 fields
- keystring "/products/bag"
- clicksinteger 10
- conversationsinteger 3
bySourcearray1 items
[0]object5 fields
- keystring "facebook / cpc"
- sourcestring "facebook"
- mediumstring "cpc"
- clicksinteger 5
- conversationsinteger 2
byCampaignarray1 items
[0]object3 fields
- keystring "summer"
- clicksinteger 4
- conversationsinteger 1
byAgentarray1 items
[0]object3 fields
- keystring "sales"
- clicksinteger 4
- conversationsinteger 1
byDevicearray1 items
[0]object3 fields
- keystring "mobile"
- clicksinteger 30
- conversationsinteger 9
byReferrerarray1 items
[0]object3 fields
- keystring "facebook.com"
- clicksinteger 4
- conversationsinteger 1
Parameters
Path
| Name | Type | Constraints | Description |
|---|---|---|---|
widgetIdrequired | Typestring | Constraints— | DescriptionWebsite button id (wgt_…). |
Query
| Name | Type | Constraints | Description |
|---|---|---|---|
fromoptional | Typestring | Constraints— | DescriptionYYYY-MM-DD (default: 30 days before to). |
tooptional | Typestring | Constraints— | DescriptionYYYY-MM-DD (default: today); at most 92 days. |
tzoptional | Typestring | Constraints— | DescriptionIANA time zone of the days (default Africa/Cairo). |
Headers
| Name | Type | Constraints | Description |
|---|---|---|---|
X-Request-Idoptional | Typestring | Constraints— | DescriptionOptional: your own request id, echoed back (otherwise we generate req_…). Quote it to support. |
Errors
Besides the authentication, rate-limit and validation errors every endpoint can return:
404 · WIDGET_NOT_FOUND — Website button not found.
Check the widgetId (GET /v2/widgets).
Correct the cause before repeating the request.
ErrorsHTTP 404 · application/json { "error": { "code": "WIDGET_NOT_FOUND", "message": "Website button not found.", "docsUrl": "https://mursilat.com/developers/v2/errors#WIDGET_NOT_FOUND", "requestId": "req_6604bedc8c489f20e582691a" } }400 · STATS_RANGE_INVALID — Invalid date range.
YYYY-MM-DD, ≤ 92 days.
Correct the cause before repeating the request.
ErrorsHTTP 400 · application/json { "error": { "code": "STATS_RANGE_INVALID", "message": "Invalid date range.", "docsUrl": "https://mursilat.com/developers/v2/errors#STATS_RANGE_INVALID", "requestId": "req_6604bedc8c489f20e582691a" } }403 · SCOPE_REQUIRED — The key lacks the scope of this endpoint.
Add the scope in details.required to the key.
Correct the cause before repeating the request.
ErrorsHTTP 403 · application/json { "error": { "code": "SCOPE_REQUIRED", "message": "The key lacks the scope of this endpoint.", "docsUrl": "https://mursilat.com/developers/v2/errors#SCOPE_REQUIRED", "requestId": "req_6604bedc8c489f20e582691a" } }401 · API_KEY_REQUIRED — No API key was sent.
Send Authorization: Bearer wsl_live_…
Correct the cause before repeating the request.
ErrorsHTTP 401 · application/json { "error": { "code": "API_KEY_REQUIRED", "message": "No API key was sent.", "docsUrl": "https://mursilat.com/developers/v2/errors#API_KEY_REQUIRED", "requestId": "req_6604bedc8c489f20e582691a" } }401 · API_KEY_INVALID — The API key is not valid.
Copy the key again from Settings → API keys (it is shown only once; create a new one if lost).
Correct the cause before repeating the request.
ErrorsHTTP 401 · application/json { "error": { "code": "API_KEY_INVALID", "message": "The API key is not valid.", "docsUrl": "https://mursilat.com/developers/v2/errors#API_KEY_INVALID", "requestId": "req_6604bedc8c489f20e582691a" } }429 · RATE_LIMITED — Rate limit of this key reached.
Wait Retry-After seconds; watch X-RateLimit-Remaining.
Retry after addressing the cause.
ErrorsHTTP 429 · application/json { "error": { "code": "RATE_LIMITED", "message": "Rate limit of this key reached.", "docsUrl": "https://mursilat.com/developers/v2/errors#RATE_LIMITED", "requestId": "req_6604bedc8c489f20e582691a" } }
Try it
Send this request from your browser to the Mursilat API.
documented examplePreview — this copy of the docs isn’t on mursilat.com, so the console shows the documented example instead of calling the API.
Kept only in this tab’s memory: never saved, never put in the URL, sent only to mursilat.com. Reloading the page forgets it.