API Documentation

Access your analytics data programmatically via our REST API. All endpoints are served from https://api.weldpulse.org.

Authentication

All API requests require a Bearer token in the Authorization header. Create an API key in your project's API Keys settings. Each key is scoped to a single project — it can only access analytics for sites within that project.

curl https://api.weldpulse.org/v1/stats \
  -H "Authorization: Bearer ak_live_your_api_key" \
  -G -d "start=2024-01-01T00:00:00Z" \
  -d "end=2024-01-31T23:59:59Z"

API access requires a Pro or Enterprise plan.

Rate Limits

API requests are rate limited to 100 requests per minute per API key. When the limit is exceeded, the API returns a 429 status code.

Error Responses

All errors return a JSON object with error and code fields.

{
  "error": "Missing required parameters: start, end",
  "code": "BAD_REQUEST"
}
StatusCodeDescription
400BAD_REQUESTMissing or invalid parameters
401UNAUTHORIZEDInvalid or missing API key
403FORBIDDENNo sites configured for the project
429RATE_LIMITEDToo many requests (100/min limit)
500INTERNAL_ERRORInternal server error

Endpoints

GET/v1/stats

Overview statistics for the project

Parameters

startISO 8601requiredStart of date range
endISO 8601requiredEnd of date range

Response

{
  "data": [{
    "visitors": 1234,
    "pageviews": 5678,
    "sessions": 2345,
    "avg_duration": 45.2,
    "bounce_rate": 0.42
  }]
}
GET/v1/pages

Top pages ranked by visitors

Parameters

startISO 8601requiredStart of date range
endISO 8601requiredEnd of date range
limitintegerMax results (default: 10)

Response

{
  "data": [
    {
      "pathname": "/pricing",
      "visitors": 456,
      "pageviews": 890,
      "avg_duration": 32.1,
      "bounce_rate": 0.38
    }
  ]
}
GET/v1/referrers

Traffic sources

Parameters

startISO 8601requiredStart of date range
endISO 8601requiredEnd of date range
limitintegerMax results (default: 10)

Response

{
  "data": [
    {
      "referrer_source": "Google",
      "visitors": 320,
      "pageviews": 580,
      "bounce_rate": 0.45
    }
  ]
}
GET/v1/timeseries

Time-series data for charting

Parameters

startISO 8601requiredStart of date range
endISO 8601requiredEnd of date range
intervalstringBucket interval (default: "1 hour")

Response

{
  "data": [
    {
      "t": "2024-01-15T00:00:00",
      "visitors": 42,
      "pageviews": 98,
      "sessions": 56
    }
  ]
}
GET/v1/realtime

Live visitors in the last 5 minutes

Response

{
  "data": [
    {
      "pathname": "/",
      "country": "US",
      "device_type": "desktop",
      "referrer_source": "Google",
      "current_visitors": 3
    }
  ]
}
GET/v1/events

Custom event summaries

Parameters

startISO 8601requiredStart of date range
endISO 8601requiredEnd of date range

Response

{
  "data": [
    {
      "event_name": "signup_click",
      "total": 234,
      "unique_visitors": 189
    }
  ]
}
GET/v1/geo

Geographic breakdown by country and region

Parameters

startISO 8601requiredStart of date range
endISO 8601requiredEnd of date range
limitintegerMax results (default: 50)

Response

{
  "data": [
    {
      "country": "US",
      "region": "California",
      "visitors": 890,
      "pageviews": 2100
    }
  ]
}
GET/v1/devices

Device, browser, and OS breakdown

Parameters

startISO 8601requiredStart of date range
endISO 8601requiredEnd of date range
limitintegerMax results (default: 50)

Response

{
  "data": [
    {
      "device_type": "desktop",
      "browser": "Chrome",
      "os": "macOS",
      "visitors": 567,
      "pageviews": 1200
    }
  ]
}
GET/v1/sites

List all sites in the project

Response

{
  "data": [
    {
      "id": "uuid",
      "domain": "example.com",
      "name": "Main Site",
      "site_key": "sk_live_...",
      "is_active": true,
      "created_at": "2024-01-01T00:00:00Z"
    }
  ]
}

Common Parameters

ParameterTypeDescription
startISO 8601Start of date range (required for most endpoints)
endISO 8601End of date range (required for most endpoints)
limitintegerMax results (default: 10 for pages/referrers, 50 for geo/devices)
intervalstringTimeseries interval, e.g. "1 hour", "1 day" (timeseries endpoint only)