Skip to content

Website analytics

Websites with the NexaCloser tracking script report visitors to your workspace. One endpoint reads them back, picked by the action query parameter. Use a Full access key. Full schema: API reference.

Terminal window
curl "https://api.nexacloser.com/v1/api-v1?action=get_sites" \
-H "Authorization: Bearer $NEXACLOSER_API_KEY"
{
"sites": [{ "site_id": "a1b2c3d4", "name": "Main website", "domain": "www.example.com" }],
"user_id": "0e985456-cd0a-4417-acb0-6faffd37b88e"
}
Terminal window
curl "https://api.nexacloser.com/v1/api-v1?action=get_analytics&site_id=a1b2c3d4&days=30" \
-H "Authorization: Bearer $NEXACLOSER_API_KEY"
{
"visitors": 12,
"pageviews": 14,
"sessions": 16,
"conversion_rate": null,
"top_page": { "url": "https://www.example.com/pricing", "views": 6 }
}
  • days is the window, 1 to 90 (default 1).
  • conversion_rate is form submits divided by form starts, in percent, or null when nobody started a form.

This is an older endpoint, so its errors are short English messages:

Status error
400 Missing site_id, or Unknown action (the body lists the actions)
401 Unauthorized
404 Site not found: not a site of this workspace
429 rate_limited

Requests count against your workspace’s API limit: 100 per 10 seconds, 200,000 per day.