Aller au contenu principal
5 min de lecture

GET /analytics/:websiteId/visitors

Retrieve individual visitor records with geolocation, device information, referrer data, and engagement metrics. Supports pagination for large datasets.

GET/api/external/v1/analytics/:websiteId/visitors

Get visitor data with pagination

Authentication

AuthenticationBash
curl -X GET 'https://api.zenovay.com/api/external/v1/analytics/a1b2c3d4-e5f6-7890-abcd-ef1234567890/visitors?range=7d&limit=50' \
-H 'X-API-Key: YOUR_API_KEY'

Parameters

NameTypeRequiredDefaultDescription
websiteIdstring (path)Yes-The UUID of the website
rangestring (query)No7dTime range: 24h, 7d, 30d, 90d, 1y
limitinteger (query)No100Number of records to return (max: 1000)
offsetinteger (query)No0Number of records to skip for pagination

Response

Response (200 OK)JSON
{
"success": true,
"data": {
  "visitors": [
    {
      "id": "v1a2b3c4-d5e6-7890-abcd-ef1234567890",
      "country_code": "US",
      "country_name": "United States",
      "city": "San Francisco",
      "device_type": "desktop",
      "browser": "Chrome",
      "os": "macOS",
      "value_score": 85,
      "visited_at": "2026-02-07T10:30:00.000Z",
      "landing_page": "/pricing",
      "referrer": "https://google.com",
      "had_interaction": true
    },
    {
      "id": "v2b3c4d5-e6f7-8901-bcde-f12345678901",
      "country_code": "GB",
      "country_name": "United Kingdom",
      "city": "London",
      "device_type": "mobile",
      "browser": "Safari",
      "os": "iOS",
      "value_score": 42,
      "visited_at": "2026-02-07T09:15:00.000Z",
      "landing_page": "/",
      "referrer": null,
      "had_interaction": false
    }
  ],
  "pagination": {
    "limit": 100,
    "offset": 0,
    "has_more": true
  }
},
"timestamp": "2026-02-07T12:00:00.000Z"
}

Response Fields

FieldTypeDescription
visitorsarrayList of visitor records
visitors[].idstringUnique visitor identifier
visitors[].country_codestringTwo-letter ISO country code
visitors[].country_namestringFull country name
visitors[].citystringCity name
visitors[].device_typestringDevice type: desktop, mobile, tablet
visitors[].browserstringBrowser name
visitors[].osstringOperating system name
visitors[].value_scorenumberVisitor engagement score (0-100)
visitors[].visited_atstringISO 8601 visit timestamp
visitors[].landing_pagestringURL of the first page visited
visitors[].referrerstring|nullReferring URL, null for direct visits
visitors[].had_interactionbooleanWhether the visitor interacted with the page
pagination.limitnumberRecords per page
pagination.offsetnumberCurrent offset
pagination.has_morebooleanWhether more records are available

TypeScript Interface

VisitorsResponseTypeScript
interface Visitor {
id: string;
country_code: string;
country_name: string;
city: string;
device_type: string;
browser: string;
os: string;
value_score: number;
visited_at: string;
landing_page: string;
referrer: string | null;
had_interaction: boolean;
}

interface VisitorsResponse {
success: true;
data: {
  visitors: Visitor[];
  pagination: {
    limit: number;
    offset: number;
    has_more: boolean;
  };
};
timestamp: string;
}

HTTP Status Codes

Status CodeDescription
200Success
400Bad Request - Invalid parameters
401Unauthorized - Invalid or missing API key
403Forbidden - API key does not have access to this website
404Not Found - Website not found
429Too Many Requests - Rate limit exceeded
500Internal Server Error

Code Examples

cURLBash
curl -X GET 'https://api.zenovay.com/api/external/v1/analytics/a1b2c3d4-e5f6-7890-abcd-ef1234567890/visitors?range=7d&limit=50&offset=0' \
-H 'X-API-Key: YOUR_API_KEY' \
-H 'Content-Type: application/json'

Error Handling

Error Response (500 Internal Server Error)JSON
{
"success": false,
"error": {
  "message": "Failed to fetch visitor data",
  "code": "INTERNAL_ERROR",
  "timestamp": "2026-02-07T12:00:00.000Z"
}
}
Cette page vous a-t-elle été utile ?