Skip to content
cloudhostDocs
API reference

Web analytics and speed insights

Web analytics and speed insights per project: visitors, page views, top lists and Web Vitals from real visitors, with no cookies and no personal data kept. Pro feature.

GET/v1/functions/{name}/analytics/settings

Analytics settings#

Whether web analytics and speed insights are on, the speed sample, the plan's limits and the script tag to add to the site.

Credential
An API key or a dashboard session
Roles
Any role

Parameters

  • namestringpathrequired

    the function's or app's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

Response

200AnalyticsSettings

  • analyticsboolean
  • speed_insightsboolean
  • speed_sampleinteger

    1–100

  • updated_atstring (date-time) | null
  • planstring
  • limitsAnalyticsLimits
  • scriptobject

Errors

StatusDescription
401unauthorized: missing, invalid, expired or revoked credential
404not_found
500internal: an unexpected failure

Example

curl "https://api.ibel.ai/v1/functions/my-api/analytics/settings" \
  -H "Authorization: Bearer $KEY"
PATCH/v1/functions/{name}/analytics/settings

Change analytics settings#

Turn web analytics or speed insights on or off and set the speed sample (1-100 percent of page loads whose vitals are kept). Turning a feature on needs the Pro plan.

Credential
An API key or a dashboard session
Roles
owner, admin, developer

Parameters

  • namestringpathrequired

    the function's or app's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

Request bodyapplication/json

  • analyticsboolean
  • speed_insightsboolean
  • speed_sampleinteger

    1–100

Response

200AnalyticsSettings

  • analyticsboolean
  • speed_insightsboolean
  • speed_sampleinteger

    1–100

  • updated_atstring (date-time) | null
  • planstring
  • limitsAnalyticsLimits
  • scriptobject

Errors

StatusDescription
400bad_request
401unauthorized: missing, invalid, expired or revoked credential
402plan_required: web analytics and speed insights need the Pro plan
403Not allowed: forbidden
404not_found
500internal: an unexpected failure

Example

curl -X PATCH "https://api.ibel.ai/v1/functions/my-api/analytics/settings" \
  -H "Authorization: Bearer $KEY" \
  -d '{"analytics":true,"speed_insights":true,"speed_sample":1}'
GET/v1/functions/{name}/analytics

Web analytics#

Visitors, page views and bounce rate for a period (and the period before), a series by hour (two days or less) or Tehran day, and the top pages, referrers, countries, devices, operating systems and browsers. Filters combine.

Credential
An API key or a dashboard session
Roles
Any role

Parameters

  • namestringpathrequired

    the function's or app's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

  • periodstringquery

    the period ending now (default 7d); ignored when from or to is given

    one of 24h, 7d, 30d, 90d, 12mo

  • fromstring (date-time)query

    start of a custom range (ISO time); clipped to the plan's retention

  • tostring (date-time)query

    end of a custom range (ISO time, default now)

  • environmentstringquery

    default production

    one of production, preview, all

  • pathstringquery

    one page, such as /pricing

    up to 300 characters

  • referrerstringquery

    a referring site's hostname

    up to 300 characters

  • countrystringquery

    two letters; XX is unknown

    up to 2 characters

  • devicestringquery

    device class

    one of desktop, mobile, tablet

  • osstringquery

    an operating system name

    up to 300 characters

  • browserstringquery

    a browser name

    up to 300 characters

  • limitintegerquery

    rows in each top list (1-100, default 10)

    1–100 · default 10

Response

200AnalyticsSummary

  • enabledboolean
  • fromstring (date-time)
  • tostring (date-time)
  • stepstring

    one of hour, day

  • environmentstring
  • filtersmap of string
  • totalsAnalyticsTotals
  • previousAnalyticsTotals
  • seriesobject[]
  • topobject

    a referrer key "" is direct traffic

Errors

StatusDescription
400analytics_bad_period, analytics_bad_range, analytics_bad_environment, analytics_bad_filter, bad_param
401unauthorized: missing, invalid, expired or revoked credential
404not_found
500internal: an unexpected failure

Example

curl "https://api.ibel.ai/v1/functions/my-api/analytics" \
  -H "Authorization: Bearer $KEY"
DELETE/v1/functions/{name}/analytics

Delete analytics data#

Turn both features off and delete every count kept for the project.

Credential
An API key or a dashboard session
Roles
owner, admin, developer
Step-up
With a dashboard session, a second factor confirmed in the last 10 minutes; API keys pass.

Parameters

  • namestringpathrequired

    the function's or app's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

Response

200object

  • deletedboolean

    always true

Errors

StatusDescription
401unauthorized: missing, invalid, expired or revoked credential
403Not allowed: forbidden, step_up_required
404not_found
500internal: an unexpected failure

Example

curl -X DELETE "https://api.ibel.ai/v1/functions/my-api/analytics" \
  -H "Authorization: Bearer $KEY"
GET/v1/functions/{name}/analytics/breakdown

One analytics list in full#

Every value of one dimension over the period, most visitors first, up to 500 rows.

Credential
An API key or a dashboard session
Roles
Any role

Parameters

  • namestringpathrequired

    the function's or app's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

  • bystringqueryrequired

    the dimension

    one of path, referrer, country, device, os, browser

  • periodstringquery

    the period ending now (default 7d); ignored when from or to is given

    one of 24h, 7d, 30d, 90d, 12mo

  • fromstring (date-time)query

    start of a custom range (ISO time); clipped to the plan's retention

  • tostring (date-time)query

    end of a custom range (ISO time, default now)

  • environmentstringquery

    default production

    one of production, preview, all

  • pathstringquery

    one page, such as /pricing

    up to 300 characters

  • referrerstringquery

    a referring site's hostname

    up to 300 characters

  • countrystringquery

    two letters; XX is unknown

    up to 2 characters

  • devicestringquery

    device class

    one of desktop, mobile, tablet

  • osstringquery

    an operating system name

    up to 300 characters

  • browserstringquery

    a browser name

    up to 300 characters

  • limitintegerquery

    rows (1-500, default 100)

    1–500 · default 100

Response

200AnalyticsBreakdown

  • bystring
  • fromstring (date-time)
  • tostring (date-time)
  • rowsAnalyticsRow[]

Errors

StatusDescription
400analytics_bad_period, analytics_bad_range, analytics_bad_environment, analytics_bad_filter, bad_param
401unauthorized: missing, invalid, expired or revoked credential
404not_found
500internal: an unexpected failure

Example

curl "https://api.ibel.ai/v1/functions/my-api/analytics/breakdown?by=by" \
  -H "Authorization: Bearer $KEY"
GET/v1/functions/{name}/speed-insights

Speed insights#

Page speed from real visitors on mobile or desktop: a score from 0 to 100, the 75th percentile of LCP, INP, CLS, FCP and TTFB with the share of good, needs-improvement and poor reports, a series, and the same per route. CLS is a plain number, the other metrics milliseconds.

Credential
An API key or a dashboard session
Roles
Any role

Parameters

  • namestringpathrequired

    the function's or app's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

  • devicestringquery

    default mobile (tablets count as mobile)

    one of mobile, desktop

  • periodstringquery

    the period ending now (default 7d); ignored when from or to is given

    one of 24h, 7d, 30d, 90d, 12mo

  • fromstring (date-time)query

    start of a custom range (ISO time); clipped to the plan's retention

  • tostring (date-time)query

    end of a custom range (ISO time, default now)

  • environmentstringquery

    default production

    one of production, preview, all

  • limitintegerquery

    routes (1-500, default 50)

    1–500 · default 50

Response

200SpeedInsights

  • enabledboolean
  • fromstring (date-time)
  • tostring (date-time)
  • stepstring

    one of hour, day

  • environmentstring
  • devicestring

    one of mobile, desktop

  • scoreinteger | null
  • ratingstring | null

    one of good, needs_improvement, poor, null

  • ninteger
  • metricsobject
  • seriesobject[]
  • routesobject[]

Errors

StatusDescription
400analytics_bad_period, analytics_bad_range, analytics_bad_environment, analytics_bad_device, bad_param
401unauthorized: missing, invalid, expired or revoked credential
404not_found
500internal: an unexpected failure

Example

curl "https://api.ibel.ai/v1/functions/my-api/speed-insights" \
  -H "Authorization: Bearer $KEY"
GET/v1/apps/{name}/analytics/settings

Analytics settings#

Whether web analytics and speed insights are on, the speed sample, the plan's limits and the script tag to add to the site.

Credential
An API key or a dashboard session
Roles
Any role

Parameters

  • namestringpathrequired

    the function's or app's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

Response

200AnalyticsSettings

  • analyticsboolean
  • speed_insightsboolean
  • speed_sampleinteger

    1–100

  • updated_atstring (date-time) | null
  • planstring
  • limitsAnalyticsLimits
  • scriptobject

Errors

StatusDescription
401unauthorized: missing, invalid, expired or revoked credential
404not_found
500internal: an unexpected failure

Example

curl "https://api.ibel.ai/v1/apps/my-api/analytics/settings" \
  -H "Authorization: Bearer $KEY"
PATCH/v1/apps/{name}/analytics/settings

Change analytics settings#

Turn web analytics or speed insights on or off and set the speed sample (1-100 percent of page loads whose vitals are kept). Turning a feature on needs the Pro plan.

Credential
An API key or a dashboard session
Roles
owner, admin, developer

Parameters

  • namestringpathrequired

    the function's or app's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

Request bodyapplication/json

  • analyticsboolean
  • speed_insightsboolean
  • speed_sampleinteger

    1–100

Response

200AnalyticsSettings

  • analyticsboolean
  • speed_insightsboolean
  • speed_sampleinteger

    1–100

  • updated_atstring (date-time) | null
  • planstring
  • limitsAnalyticsLimits
  • scriptobject

Errors

StatusDescription
400bad_request
401unauthorized: missing, invalid, expired or revoked credential
402plan_required: web analytics and speed insights need the Pro plan
403Not allowed: forbidden
404not_found
500internal: an unexpected failure

Example

curl -X PATCH "https://api.ibel.ai/v1/apps/my-api/analytics/settings" \
  -H "Authorization: Bearer $KEY" \
  -d '{"analytics":true,"speed_insights":true,"speed_sample":1}'
GET/v1/apps/{name}/analytics

Web analytics#

Visitors, page views and bounce rate for a period (and the period before), a series by hour (two days or less) or Tehran day, and the top pages, referrers, countries, devices, operating systems and browsers. Filters combine.

Credential
An API key or a dashboard session
Roles
Any role

Parameters

  • namestringpathrequired

    the function's or app's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

  • periodstringquery

    the period ending now (default 7d); ignored when from or to is given

    one of 24h, 7d, 30d, 90d, 12mo

  • fromstring (date-time)query

    start of a custom range (ISO time); clipped to the plan's retention

  • tostring (date-time)query

    end of a custom range (ISO time, default now)

  • environmentstringquery

    default production

    one of production, preview, all

  • pathstringquery

    one page, such as /pricing

    up to 300 characters

  • referrerstringquery

    a referring site's hostname

    up to 300 characters

  • countrystringquery

    two letters; XX is unknown

    up to 2 characters

  • devicestringquery

    device class

    one of desktop, mobile, tablet

  • osstringquery

    an operating system name

    up to 300 characters

  • browserstringquery

    a browser name

    up to 300 characters

  • limitintegerquery

    rows in each top list (1-100, default 10)

    1–100 · default 10

Response

200AnalyticsSummary

  • enabledboolean
  • fromstring (date-time)
  • tostring (date-time)
  • stepstring

    one of hour, day

  • environmentstring
  • filtersmap of string
  • totalsAnalyticsTotals
  • previousAnalyticsTotals
  • seriesobject[]
  • topobject

    a referrer key "" is direct traffic

Errors

StatusDescription
400analytics_bad_period, analytics_bad_range, analytics_bad_environment, analytics_bad_filter, bad_param
401unauthorized: missing, invalid, expired or revoked credential
404not_found
500internal: an unexpected failure

Example

curl "https://api.ibel.ai/v1/apps/my-api/analytics" \
  -H "Authorization: Bearer $KEY"
DELETE/v1/apps/{name}/analytics

Delete analytics data#

Turn both features off and delete every count kept for the project.

Credential
An API key or a dashboard session
Roles
owner, admin, developer
Step-up
With a dashboard session, a second factor confirmed in the last 10 minutes; API keys pass.

Parameters

  • namestringpathrequired

    the function's or app's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

Response

200object

  • deletedboolean

    always true

Errors

StatusDescription
401unauthorized: missing, invalid, expired or revoked credential
403Not allowed: forbidden, step_up_required
404not_found
500internal: an unexpected failure

Example

curl -X DELETE "https://api.ibel.ai/v1/apps/my-api/analytics" \
  -H "Authorization: Bearer $KEY"
GET/v1/apps/{name}/analytics/breakdown

One analytics list in full#

Every value of one dimension over the period, most visitors first, up to 500 rows.

Credential
An API key or a dashboard session
Roles
Any role

Parameters

  • namestringpathrequired

    the function's or app's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

  • bystringqueryrequired

    the dimension

    one of path, referrer, country, device, os, browser

  • periodstringquery

    the period ending now (default 7d); ignored when from or to is given

    one of 24h, 7d, 30d, 90d, 12mo

  • fromstring (date-time)query

    start of a custom range (ISO time); clipped to the plan's retention

  • tostring (date-time)query

    end of a custom range (ISO time, default now)

  • environmentstringquery

    default production

    one of production, preview, all

  • pathstringquery

    one page, such as /pricing

    up to 300 characters

  • referrerstringquery

    a referring site's hostname

    up to 300 characters

  • countrystringquery

    two letters; XX is unknown

    up to 2 characters

  • devicestringquery

    device class

    one of desktop, mobile, tablet

  • osstringquery

    an operating system name

    up to 300 characters

  • browserstringquery

    a browser name

    up to 300 characters

  • limitintegerquery

    rows (1-500, default 100)

    1–500 · default 100

Response

200AnalyticsBreakdown

  • bystring
  • fromstring (date-time)
  • tostring (date-time)
  • rowsAnalyticsRow[]

Errors

StatusDescription
400analytics_bad_period, analytics_bad_range, analytics_bad_environment, analytics_bad_filter, bad_param
401unauthorized: missing, invalid, expired or revoked credential
404not_found
500internal: an unexpected failure

Example

curl "https://api.ibel.ai/v1/apps/my-api/analytics/breakdown?by=by" \
  -H "Authorization: Bearer $KEY"
GET/v1/apps/{name}/speed-insights

Speed insights#

Page speed from real visitors on mobile or desktop: a score from 0 to 100, the 75th percentile of LCP, INP, CLS, FCP and TTFB with the share of good, needs-improvement and poor reports, a series, and the same per route. CLS is a plain number, the other metrics milliseconds.

Credential
An API key or a dashboard session
Roles
Any role

Parameters

  • namestringpathrequired

    the function's or app's name

    pattern ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$ · up to 63 characters

  • devicestringquery

    default mobile (tablets count as mobile)

    one of mobile, desktop

  • periodstringquery

    the period ending now (default 7d); ignored when from or to is given

    one of 24h, 7d, 30d, 90d, 12mo

  • fromstring (date-time)query

    start of a custom range (ISO time); clipped to the plan's retention

  • tostring (date-time)query

    end of a custom range (ISO time, default now)

  • environmentstringquery

    default production

    one of production, preview, all

  • limitintegerquery

    routes (1-500, default 50)

    1–500 · default 50

Response

200SpeedInsights

  • enabledboolean
  • fromstring (date-time)
  • tostring (date-time)
  • stepstring

    one of hour, day

  • environmentstring
  • devicestring

    one of mobile, desktop

  • scoreinteger | null
  • ratingstring | null

    one of good, needs_improvement, poor, null

  • ninteger
  • metricsobject
  • seriesobject[]
  • routesobject[]

Errors

StatusDescription
400analytics_bad_period, analytics_bad_range, analytics_bad_environment, analytics_bad_device, bad_param
401unauthorized: missing, invalid, expired or revoked credential
404not_found
500internal: an unexpected failure

Example

curl "https://api.ibel.ai/v1/apps/my-api/speed-insights" \
  -H "Authorization: Bearer $KEY"
GET/v1/analytics

Analytics across the team#

Every app and function of the team: whether each feature is on, and the last 7 days' production visitors and page views.

Credential
An API key or a dashboard session
Roles
Any role

Response

200AnalyticsProjects

  • planstring
  • limitsAnalyticsLimits
  • projectsobject[]

Errors

StatusDescription
401unauthorized: missing, invalid, expired or revoked credential
500internal: an unexpected failure

Example

curl "https://api.ibel.ai/v1/analytics" \
  -H "Authorization: Bearer $KEY"