domainstring必填
domain
https://api.sandbase.ai/v1/api/similarweb/traffic-engagementGet a website's traffic and engagement metrics month by month: visits, page views, visit duration, bounce rate and more.
您的输出将显示在这里
完成输入,然后点击运行。
Returns monthly traffic and engagement metrics for a website, such as visits, page views, visit duration and bounce rate. You send a domain, a start_date and end_date in YYYY-MM format, and the metrics you want.
curl -X POST "https://api.sandbase.ai/v1/api/similarweb/traffic-engagement" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"start_date": "2026-09", "end_date": "2026-09", "country": "ww", "domain": "cnn.com", "metrics": "visits", "granularity": "monthly"}'
The result is returned in outputs[0].data.
| Name | Type | Required | Description |
|---|---|---|---|
domain | string | Yes | domain |
end_date | string | Yes | end_date |
metrics | string | Yes | metrics |
start_date | string | Yes | start_date |
country | string | No | Worldwide data only; values are case-insensitive. |
granularity | string | No | granularity |
main_domain_only | boolean | No | main_domain_only |
mtd | boolean | No | mtd |
web_source | string | No | web_source |
Real response for the request above, trimmed: lists keep their first item and long strings are cut.
{
"data": [
{
"average_visit_duration": null,
"bounce_rate": null,
"date": "2026-09-01",
"new_users": null,
"page_views": null,
"pages_per_visit": null,
"returning_users": null,
"unique_visitors": null,
"visits": 188658557.46746868
}
],
"meta": {
"last_updated": "2026-09-30",
"request": {
"country": "ww",
"domain": "cnn.com",
"end_date": "2026-09-30",
"format": "json",
"granularity": "monthly",
"main_domain_only": true,
"metrics": [
"visits"
],
"mtd": false,
"start_date": "2026-09-01",
"state": null,
"web_source": "total",
"week_start_day": "default"
},
"status": "success"
}
}
| Field | Meaning |
|---|---|
data[].date | First day of the month the row covers, for example 2026-09-01. |
data[].visits | Estimated number of visits to the domain in that month. This is a decimal number, not a rounded count. |
data[].page_views / data[].unique_visitors | Page view and unique visitor counts for the month. They are null unless you request those metrics. |
data[].average_visit_duration / data[].bounce_rate / data[].pages_per_visit | Engagement metrics for the month. They are null unless you request them in metrics. |
data[].new_users / data[].returning_users | Split of new and returning users for the month. They are null when not requested. |
meta.last_updated | Date of the most recent data update, shown as YYYY-MM-DD. |
meta.request.web_source | Traffic source the data covers. The response shows total when you do not set web_source. |
meta.request.metrics | List of the metrics the call applied. |
meta.status | Shows success when the call worked. |
null in each data[] row, so set metrics to the ones you need.start_date and end_date as YYYY-MM. The response echoes them as full dates, such as 2026-09-01 and 2026-09-30.web_source to desktop, mobile_web or total to pick the traffic source. country accepts only ww (worldwide) and granularity accepts only monthly.Billed at the actual cost of each call, about $0.075 for the request above. Failed calls are not charged.
Use Traffic & Engagement for a domain's month-by-month estimates. Start with a bare domain such as cnn.com, metrics set to visits, and explicit start_date and end_date in YYYY-MM format. Both dates and metrics are required. country accepts ww only and granularity accepts monthly only. main_domain_only defaults to true; choose its value explicitly when comparing domains. Check the current schema before adding other metrics or options. A past month is not a guarantee of available data.
Pricing checked on 2026-11-08: the list-price formula is $0.075 × metric count × month count, including both the start and end month. One visits metric for 2026-09 through 2026-09 estimates $0.075; 2026-04 through 2026-09 estimates $0.45. Two supported metrics over those six months estimate $0.90. These are formula estimates before any applicable discount, not billed test results. Inspect current pricing before execution; the base price alone is not the cost of every date range.
For a single-month overview instead, inspect Website Traffic Snapshot.
Already have a SandBase API key? Keep it in your local SANDBASE_API_KEY environment variable, then open this page's API tab for the POST route and request body. Send the key as a Bearer token; never put it in a shared prompt or committed file. The Quickstart explains setup.
Already connected your agent to SandBase? Ask it to inspect this exact endpoint and show the domain, month range and estimated cost before running one request. Starting a new project? Give your agent the setup Skill, this page URL and your research question. The Markdown quickstart is also ready to hand to an agent.
Read the completed response from outputs[0].data. The reference response illustrates one result; inspect your own returned payload before writing a parser. Missing estimates are unknown, not zero. Follow the Similarweb Python and traffic-comparison guide for a bounded request.
开始构建
具备统一身份验证和使用情况跟踪的平台 API 端点。
curl -X POST "https://api.sandbase.ai/v1/api/similarweb/traffic-engagement" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"domain": "cnn.com",
"country": "ww",
"metrics": "visits",
"end_date": "2026-09",
"start_date": "2026-09",
"granularity": "monthly",
"main_domain_only": true
}'将您的 SandBase API 密钥设置到服务器环境中。请求使用 Bearer 身份验证。
export SANDBASE_API_KEY="YOUR_API_KEY"请将密钥保存在服务器端。不要在浏览器代码中暴露它。
domainstring必填domain
end_datestring必填end_date
metricsstring必填metrics
start_datestring必填start_date
countrystringWorldwide data only; values are case-insensitive.
默认值:"ww"
可选值:ww
granularitystringgranularity
默认值:"monthly"
可选值:monthly
main_domain_onlybooleanmain_domain_only
默认值:true
mtdbooleanmtd
web_sourcestringweb_source
可选值:desktop, mobile_web, total
这是该 API 保存的示例响应;查看时不会发起实时请求。
尚未发布已保存的响应。请在 Playground 中运行 API 以查看其响应。
探索更多
| API | 价格 | 响应 |
|---|---|---|
Similarweb | 每次调用从 $0.075 起 | JSON |
Similarweb | 每次调用从 $0.225 起 | JSON |
Similarweb | 每次调用从 $0.375 起 | JSON |
Similarweb | 每次调用从 $0.15 起 | JSON |
Similarweb | 每次调用从 $0.525 起 | JSON |
Similarweb | $0.60 每次调用 | JSON |
指南:Similarweb API: request examples and billingSimilarweb API pricing: data credits vs per-call prices
问题
向 https://api.sandbase.ai/v1/api/similarweb/traffic-engagement 发送 POST 请求,在 Authorization 请求头中使用您的 SandBase API key(Bearer),并将参数作为 JSON 请求体传入。您也可以直接在本页的 Playground 中试用,无需编写代码。
起价每次调用 $0.075,从您的 SandBase 余额中扣费。您只需为实际调用付费;无需订阅。
必填:domain (string), end_date (string), metrics (string) 和 start_date (string)。 可选:country(ww 之一), granularity(monthly 之一), main_domain_only (boolean), mtd (boolean) 和 web_source(desktop, mobile_web, total 之一)。 Parameters 表和本页的 Playground 列出了每个字段。
在同一个 HTTP 请求中返回的 JSON 响应(同步)。 本页的 README 包含一个示例响应。
不需要。Similarweb Traffic & Engagement 通过 SandBase 运行,因此一个 SandBase API key 即可覆盖此端点以及目录中的其他所有 API 和模型。您无需单独申请 Similarweb API 访问权限。
不会。按 2026-11-08 的检查结果,标价公式会将 $0.075 乘以指标数量和包含的月份数量。一个指标、六个月的估算在任何适用折扣前为 $0.45。这只是公式估算,不是计费测试结果;运行前请重新确认当前价格。
发送 domain、start_date、end_date 和 metrics。使用不带协议的域名,例如 cnn.com,YYYY-MM 日期格式,以及 visits 指标。此变体仅接受 country ww 和 granularity monthly。main_domain_only 默认值为 true。请在 API 选项卡中查看准确的 POST 请求;不要假设过去某个月一定有可用估算值。
先让它使用 SandBase 的 setup Skill 和这个端点 URL,然后说明你的域名、月份和指标。如果已经连接好了,就让它先检查该端点。把你的密钥保存在本地环境变量中,并在执行前查看完整请求成本。只从已完成的响应中读取 outputs[0].data;没有 data 不代表访问量为零。