Developer
API Reference
Pull your analytics data into any tool, dashboard, or automation — with a simple REST API.
1. Authentication
All API endpoints require a valid API key passed as a Bearer token in the Authorization header. Generate keys in your profile settings. API access requires a Pro plan.
Request header
Authorization: Bearer waa_YOUR_API_KEY
https://webanalyzerapp.com/api/v1
| Property | Value |
|---|---|
| Rate limit | 60 requests / minute per key |
| Response format | JSON (UTF-8) |
| Date parameters | YYYY-MM-DD (UTC) |
| Default date range | Last 30 days when from / to are omitted |
2. Errors
All error responses return JSON with an error code and a human-readable message.
| HTTP status | Error code | Meaning |
|---|---|---|
| 401 | unauthenticated | No Authorization header provided. |
| 401 | invalid_api_key | The key does not exist or has been revoked. |
| 403 | pro_required | Your account is not on a Pro plan. |
| 404 | — | Website not found or does not belong to your account. |
| 422 | — | Validation error — check the errors field. |
| 429 | — | Rate limit exceeded (60 req/min per key). |
3. Websites
List all websites
Returns all websites in your account.
Response
{
"data": [
{
"id": 1,
"name": "My Store",
"domain": "https://mystore.com",
"tracking_key": "a1b2c3d4e5f6",
"is_verified": true,
"created_at": "2025-01-15T10:00:00Z"
}
]
}
Get a website
Returns details for a single website.
Response
{
"data": {
"id": 1,
"name": "My Store",
"domain": "https://mystore.com",
"tracking_key": "a1b2c3d4e5f6",
"timezone": "Europe/Istanbul",
"is_verified": true,
"created_at": "2025-01-15T10:00:00Z"
}
}
4. Summary (KPIs)
Returns key performance indicators for the given date range.
| Parameter | Description |
|---|---|
| from | Start date YYYY-MM-DD (default: 30 days ago) |
| to | End date YYYY-MM-DD (default: today) |
Response
{
"data": {
"from": "2025-01-01",
"to": "2025-01-31",
"visitors": 1240,
"sessions": 1880,
"page_views": 5430,
"events": 320,
"bounce_rate": 42.5,
"avg_duration": 187
}
}
5. Top pages
Returns the most-visited pages ranked by view count.
| Parameter | Description |
|---|---|
| from | Start date (default: 30 days ago) |
| to | End date (default: today) |
| limit | Max rows 1–100 (default: 20) |
Response
{
"data": [
{
"path": "/pricing",
"views": 820,
"visitors": 540,
"sessions": 610,
"bounce_rate": 35.2,
"avg_time": 145
}
],
"meta": { "from": "2025-01-01", "to": "2025-01-31" }
}
6. Traffic sources
Returns session counts broken down by acquisition channel (organic, direct, referral, paid, email, social).
| Parameter | Description |
|---|---|
| from | Start date (default: 30 days ago) |
| to | End date (default: today) |
Response
{
"data": [
{ "channel": "organic", "sessions": 640, "pct": 34.0 },
{ "channel": "direct", "sessions": 510, "pct": 27.1 },
{ "channel": "referral", "sessions": 290, "pct": 15.4 }
],
"meta": { "from": "2025-01-01", "to": "2025-01-31" }
}
7. Events
Returns custom event counts. Pass name to filter to a specific event type.
| Parameter | Description |
|---|---|
| from | Start date (default: 30 days ago) |
| to | End date (default: today) |
| name | Filter to a specific event name (optional) |
Response
{
"data": [
{
"name": "signup",
"count": 142,
"last_triggered": "2025-01-31T18:45:00.000000Z"
},
{
"name": "checkout",
"count": 87,
"last_triggered": "2025-01-31T17:22:00.000000Z"
}
],
"meta": { "from": "2025-01-01", "to": "2025-01-31" }
}
8. Quick start
Fetch your 30-day KPIs with a single curl command:
curl
curl https://webanalyzerapp.com/api/v1/websites/1/summary \
-H "Authorization: Bearer waa_YOUR_API_KEY" \
-H "Accept: application/json"
Or with JavaScript (fetch):
JavaScript
const res = await fetch(
'https://webanalyzerapp.com/api/v1/websites/1/summary?from=2025-01-01&to=2025-01-31',
{ headers: { 'Authorization': 'Bearer waa_YOUR_API_KEY' } }
);
const { data } = await res.json();
console.log(`${data.visitors} visitors · ${data.sessions} sessions`);