List tracked sites, or read a site's numbers
const url = 'https://api.nexacloser.com/v1/api-v1?action=get_sites&days=1';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://api.nexacloser.com/v1/api-v1?action=get_sites&days=1' \ --header 'Authorization: Bearer <token>'One endpoint, picked by action:
action=get_siteslists the websites tracked by NexaCloser analytics.action=get_analytics&site_id=…&days=…returns visitors, page views, sessions, form conversion rate and the top page for the lastdaysdays (1 to 90, default 1).
An organization key sees every site of its workspace. A personal key sees the sites it can see in that workspace.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”Required for get_analytics. From get_sites.
For get_analytics. Window in days, clamped to 1–90.
Responses
Section titled “Responses”The sites, or the site’s numbers.
object
object
The user the key acts as.
object
Form submits ÷ form starts, in percent. null when no form was started.
object
Examples
{ "sites": [ { "site_id": "a1b2c3d4", "name": "Main website", "domain": "www.example.com" } ], "user_id": "0e985456-cd0a-4417-acb0-6faffd37b88e"}{ "visitors": 12, "pageviews": 14, "sessions": 16, "conversion_rate": null, "top_page": { "url": "https://www.example.com/pricing", "views": 6 }}Headers
Section titled “Headers”Requests allowed in the current short window.
Requests left in the current short window.
Missing site_id, or an unknown action (the body lists the available actions).
Older endpoints return a short English message instead of a code.
object
Example
{ "error": "Missing site_id"}Missing, wrong, revoked or expired key.
Older endpoints return a short English message instead of a code.
object
Example
{ "error": "Unauthorized"}The site does not exist or is not in this workspace.
Older endpoints return a short English message instead of a code.
object
Example
{ "error": "Site not found"}Too many requests. Wait Retry-After seconds.
object
Seconds to wait.
Example
{ "error": "rate_limited", "message": "Too many requests", "retry_after": 7}Headers
Section titled “Headers”Seconds to wait before retrying.
