Skip to main content
GET
/
api
/
v1
/
iframes
/
{id}
/
analytics
Widget Analytics
curl --request GET \
  --url https://api.example.com/api/v1/iframes/{id}/analytics
{
  "window": "<string>",
  "kpi": {},
  "previous_period_kpi": {},
  "series": {},
  "top_referrers": [
    {}
  ],
  "top_countries": [
    {}
  ],
  "top_country_coords": [
    {}
  ]
}
Returns KPIs for the selected window, the previous period for comparison, daily time series, and top referrers/countries.

Authentication

Requires a Bearer token (API key) or a dashboard session.

Path Parameters

id
string
required
The widget config UUID.

Query Parameters

window
string
default:"30d"
Reporting window: 7d, 30d, or 90d.

Response

window
string
The window that was applied.
kpi
object
total_sessions, total_leads, total_messages, conversion_rate, avg_session_duration_seconds, avg_messages_per_session, identified_sessions, anonymous_sessions.
previous_period_kpi
object
The same KPI shape for the immediately preceding period.
series
object
Daily time series: sessions, leads, messages, each an array of { day, count }.
top_referrers
array
Up to 10 { url, count } entries.
top_countries
array
Up to 10 { country, count } entries.
top_country_coords
array
Map-ready { country, name, lat, lng, count } entries for the top countries.

Example

curl
curl "https://www.hitheo.ai/api/v1/iframes/CONFIG_ID/analytics?window=7d" \
  -H "Authorization: Bearer $THEO_API_KEY"