رفتن به محتوا
cloudhostمستندات
مرجع API

تحلیل بازدید و سرعت صفحه

بازدیدکنندگان، بازدید صفحه، پرتکرارترین‌ها و سرعت صفحه از بازدیدکنندگان واقعی، بدون کوکی و بدون نگه‌داشتن داده‌های شخصی.

توضیح هر مسیر به انگلیسی است، همان متنی که مرجع از کد ساخته می‌شود. مسیرها، نام فیلدها و کدها همان‌اند که در درخواست می‌نویسید.
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.

دسترسی
کلید API یا نشست داشبورد
نقش‌ها
همهٔ نقش‌ها

پارامترها

  • namestringمسیرالزامی

    the function's or app's name

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

پاسخ

200AnalyticsSettings

  • analyticsboolean
  • speed_insightsboolean
  • speed_sampleinteger

    1–100

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

خطاها

وضعیتتوضیح
401unauthorized: missing, invalid, expired or revoked credential
404not_found
500internal: an unexpected failure

نمونه

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.

دسترسی
کلید API یا نشست داشبورد
نقش‌ها
مالک، ادمین، توسعه‌دهنده

پارامترها

  • namestringمسیرالزامی

    the function's or app's name

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

بدنهٔ درخواستapplication/json

  • analyticsboolean
  • speed_insightsboolean
  • speed_sampleinteger

    1–100

پاسخ

200AnalyticsSettings

  • analyticsboolean
  • speed_insightsboolean
  • speed_sampleinteger

    1–100

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

خطاها

وضعیتتوضیح
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

نمونه

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.

دسترسی
کلید API یا نشست داشبورد
نقش‌ها
همهٔ نقش‌ها

پارامترها

  • namestringمسیرالزامی

    the function's or app's name

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

  • periodstringکوئری

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

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

  • fromstring (date-time)کوئری

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

  • tostring (date-time)کوئری

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

  • environmentstringکوئری

    default production

    one of production, preview, all

  • pathstringکوئری

    one page, such as /pricing

    up to 300 characters

  • referrerstringکوئری

    a referring site's hostname

    up to 300 characters

  • countrystringکوئری

    two letters; XX is unknown

    up to 2 characters

  • devicestringکوئری

    device class

    one of desktop, mobile, tablet

  • osstringکوئری

    an operating system name

    up to 300 characters

  • browserstringکوئری

    a browser name

    up to 300 characters

  • limitintegerکوئری

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

    1–100 · default 10

پاسخ

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

خطاها

وضعیتتوضیح
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

نمونه

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.

دسترسی
کلید API یا نشست داشبورد
نقش‌ها
مالک، ادمین، توسعه‌دهنده
تایید دوم
با نشست داشبورد، عامل دوم در ۱۰ دقیقهٔ اخیر لازم است؛ کلید API نیازی ندارد.

پارامترها

  • namestringمسیرالزامی

    the function's or app's name

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

پاسخ

200object

  • deletedboolean

    always true

خطاها

وضعیتتوضیح
401unauthorized: missing, invalid, expired or revoked credential
403Not allowed: forbidden, step_up_required
404not_found
500internal: an unexpected failure

نمونه

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.

دسترسی
کلید API یا نشست داشبورد
نقش‌ها
همهٔ نقش‌ها

پارامترها

  • namestringمسیرالزامی

    the function's or app's name

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

  • bystringکوئریالزامی

    the dimension

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

  • periodstringکوئری

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

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

  • fromstring (date-time)کوئری

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

  • tostring (date-time)کوئری

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

  • environmentstringکوئری

    default production

    one of production, preview, all

  • pathstringکوئری

    one page, such as /pricing

    up to 300 characters

  • referrerstringکوئری

    a referring site's hostname

    up to 300 characters

  • countrystringکوئری

    two letters; XX is unknown

    up to 2 characters

  • devicestringکوئری

    device class

    one of desktop, mobile, tablet

  • osstringکوئری

    an operating system name

    up to 300 characters

  • browserstringکوئری

    a browser name

    up to 300 characters

  • limitintegerکوئری

    rows (1-500, default 100)

    1–500 · default 100

پاسخ

200AnalyticsBreakdown

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

خطاها

وضعیتتوضیح
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

نمونه

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.

دسترسی
کلید API یا نشست داشبورد
نقش‌ها
همهٔ نقش‌ها

پارامترها

  • namestringمسیرالزامی

    the function's or app's name

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

  • devicestringکوئری

    default mobile (tablets count as mobile)

    one of mobile, desktop

  • periodstringکوئری

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

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

  • fromstring (date-time)کوئری

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

  • tostring (date-time)کوئری

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

  • environmentstringکوئری

    default production

    one of production, preview, all

  • limitintegerکوئری

    routes (1-500, default 50)

    1–500 · default 50

پاسخ

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[]

خطاها

وضعیتتوضیح
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

نمونه

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.

دسترسی
کلید API یا نشست داشبورد
نقش‌ها
همهٔ نقش‌ها

پارامترها

  • namestringمسیرالزامی

    the function's or app's name

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

پاسخ

200AnalyticsSettings

  • analyticsboolean
  • speed_insightsboolean
  • speed_sampleinteger

    1–100

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

خطاها

وضعیتتوضیح
401unauthorized: missing, invalid, expired or revoked credential
404not_found
500internal: an unexpected failure

نمونه

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.

دسترسی
کلید API یا نشست داشبورد
نقش‌ها
مالک، ادمین، توسعه‌دهنده

پارامترها

  • namestringمسیرالزامی

    the function's or app's name

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

بدنهٔ درخواستapplication/json

  • analyticsboolean
  • speed_insightsboolean
  • speed_sampleinteger

    1–100

پاسخ

200AnalyticsSettings

  • analyticsboolean
  • speed_insightsboolean
  • speed_sampleinteger

    1–100

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

خطاها

وضعیتتوضیح
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

نمونه

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.

دسترسی
کلید API یا نشست داشبورد
نقش‌ها
همهٔ نقش‌ها

پارامترها

  • namestringمسیرالزامی

    the function's or app's name

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

  • periodstringکوئری

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

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

  • fromstring (date-time)کوئری

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

  • tostring (date-time)کوئری

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

  • environmentstringکوئری

    default production

    one of production, preview, all

  • pathstringکوئری

    one page, such as /pricing

    up to 300 characters

  • referrerstringکوئری

    a referring site's hostname

    up to 300 characters

  • countrystringکوئری

    two letters; XX is unknown

    up to 2 characters

  • devicestringکوئری

    device class

    one of desktop, mobile, tablet

  • osstringکوئری

    an operating system name

    up to 300 characters

  • browserstringکوئری

    a browser name

    up to 300 characters

  • limitintegerکوئری

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

    1–100 · default 10

پاسخ

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

خطاها

وضعیتتوضیح
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

نمونه

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.

دسترسی
کلید API یا نشست داشبورد
نقش‌ها
مالک، ادمین، توسعه‌دهنده
تایید دوم
با نشست داشبورد، عامل دوم در ۱۰ دقیقهٔ اخیر لازم است؛ کلید API نیازی ندارد.

پارامترها

  • namestringمسیرالزامی

    the function's or app's name

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

پاسخ

200object

  • deletedboolean

    always true

خطاها

وضعیتتوضیح
401unauthorized: missing, invalid, expired or revoked credential
403Not allowed: forbidden, step_up_required
404not_found
500internal: an unexpected failure

نمونه

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.

دسترسی
کلید API یا نشست داشبورد
نقش‌ها
همهٔ نقش‌ها

پارامترها

  • namestringمسیرالزامی

    the function's or app's name

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

  • bystringکوئریالزامی

    the dimension

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

  • periodstringکوئری

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

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

  • fromstring (date-time)کوئری

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

  • tostring (date-time)کوئری

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

  • environmentstringکوئری

    default production

    one of production, preview, all

  • pathstringکوئری

    one page, such as /pricing

    up to 300 characters

  • referrerstringکوئری

    a referring site's hostname

    up to 300 characters

  • countrystringکوئری

    two letters; XX is unknown

    up to 2 characters

  • devicestringکوئری

    device class

    one of desktop, mobile, tablet

  • osstringکوئری

    an operating system name

    up to 300 characters

  • browserstringکوئری

    a browser name

    up to 300 characters

  • limitintegerکوئری

    rows (1-500, default 100)

    1–500 · default 100

پاسخ

200AnalyticsBreakdown

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

خطاها

وضعیتتوضیح
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

نمونه

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.

دسترسی
کلید API یا نشست داشبورد
نقش‌ها
همهٔ نقش‌ها

پارامترها

  • namestringمسیرالزامی

    the function's or app's name

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

  • devicestringکوئری

    default mobile (tablets count as mobile)

    one of mobile, desktop

  • periodstringکوئری

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

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

  • fromstring (date-time)کوئری

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

  • tostring (date-time)کوئری

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

  • environmentstringکوئری

    default production

    one of production, preview, all

  • limitintegerکوئری

    routes (1-500, default 50)

    1–500 · default 50

پاسخ

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[]

خطاها

وضعیتتوضیح
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

نمونه

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.

دسترسی
کلید API یا نشست داشبورد
نقش‌ها
همهٔ نقش‌ها

پاسخ

200AnalyticsProjects

  • planstring
  • limitsAnalyticsLimits
  • projectsobject[]

خطاها

وضعیتتوضیح
401unauthorized: missing, invalid, expired or revoked credential
500internal: an unexpected failure

نمونه

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