API Reference

GET Visitor

Retrieve identity and activity details for a known visitor.

GET Visitor

GET https://api.faurya.com/api/v1/visitors/{faurya_visitor_id}

Retrieve identity and activity data for a specific visitor. Requires Bearer Token authentication.

Path parameters

  • faurya_visitor_id (string): Visitor ID from the Faurya browser cookie.

Response

  • 200 OK: Returns visitor identity, visit counts, pageviews, custom goals, and visited pages.
  • 401 Unauthorized: Missing or invalid API key.
  • 404 Not Found: Visitor not found for the authenticated site.

Example request

const visitorId = req.cookies.faurya_visitor_id;

const response = await fetch(
  `https://api.faurya.com/api/v1/visitors/${visitorId}`,
  {
    method: "GET",
    headers: {
      Authorization: `Bearer ${process.env.FAURYA_API_KEY}`,
    },
  },
);

const visitor = await response.json();

Success response

{
  "status": "success",
  "data": {
    "visitorId": "site_123:visitor_456",
    "identity": {
      "country": "US",
      "countryCode": "US",
      "region": "California",
      "city": "San Francisco",
      "browser": { "name": "Chrome" },
      "os": { "name": "macOS" },
      "device": { "type": "desktop" }
    },
    "activity": {
      "visitCount": 2,
      "pageViewCount": 4,
      "timeSinceFirstVisit": 86400000,
      "timeSinceCurrentVisit": 30000,
      "firstVisitAt": "2026-06-28T10:00:00.000Z",
      "lastVisitAt": "2026-06-29T12:00:00.000Z",
      "currentUrl": "example.com/pricing",
      "completedCustomGoals": [
        {
          "name": "newsletter_signup",
          "timestamp": "2026-06-29T12:01:00.000Z"
        }
      ],
      "visitedPages": [
        {
          "url": "example.com/pricing",
          "timestamp": "2026-06-29T12:00:00.000Z"
        }
      ]
    }
  }
}