SimilarWeb Website Analytics Connector
Via dataBridgePull() get website traffic, rankings, marketing channels, and other analytics data.
Get website traffic and engagement
var resp = dataBridgePull("similarweb", "traffic_engagement", {
domain: "google.com",
start_date: "2025-01",
end_date: "2025-12",
granularity: "monthly",
country: "world"
});
if (!resp || !resp.ok) return "获取数据失败: " + (resp ? resp.error : "网络错误");
// resp.data.data 是月度数组,每个元素包含:
// date, visits, bounce_rate, average_visit_duration, pages_per_visit, unique_visitors
var rows = resp.data.data; // Array: [{date:"2025-01-01", visits:723462947, ...}, ...]
for (var i = 0; i < rows.length; i++) {
var r = rows[i];
// r.date (日期), r.visits (访问量), r.bounce_rate (跳出率 0-1),
// r.average_visit_duration (秒), r.pages_per_visit, r.unique_visitors
}
Get website rankings
var resp = dataBridgePull("similarweb", "website_ranking", {
domain: "google.com"
});
if (!resp || !resp.ok) return "获取失败: " + (resp ? resp.error : "网络错误");
// resp.data.data 是数组: [{date, rank_global, rank_country, rank_category, ...}]
var rank = resp.data.data[0]; // rank.rank_global, rank.rank_country
Get traffic sources
var resp = dataBridgePull("similarweb", "traffic_sources", {
domain: "google.com",
start_date: "2025-01",
end_date: "2025-12",
country: "world"
});
// 各渠道(直接/搜索/社交/引荐/邮件/展示广告)的流量占比
Get traffic geographic distribution
var resp = dataBridgePull("similarweb", "traffic_geography", {
domain: "google.com",
start_date: "2025-01",
end_date: "2025-12"
});
// 按国家的流量占比
Get app details
var resp = dataBridgePull("similarweb", "app_details", {
app_id: "com.google.android.gm",
store: "google"
});
Available Actions
| Action |
Description |
Required Parameters |
traffic_engagement |
Traffic and Engagement |
domain, start_date, end_date |
website_ranking |
Website Rankings |
domain |
traffic_sources |
Traffic Sources |
domain, start_date, end_date |
traffic_geography |
Traffic Geographic Distribution |
domain, start_date, end_date |
app_details |
App Details |
app_id, store |
Parameter Description
| Parameter |
Description |
Example |
| domain |
Website domain (without www) |
"google.com", "baidu.com" |
| start_date |
Start month |
"2024-01" |
| end_date |
End month |
"2024-12" |
| granularity |
Time granularity |
"daily" / "weekly" / "monthly" |
| country |
Country/Region |
"world", "us", "cn", "gb" |
| store |
App store |
"google" / "apple" |
Important Rules
- Date format YYYY-MM: SimilarWeb uses month-granularity dates (not YYYY-MM-DD)
- Date range limit: Data usually only covers the most recent 24 months (approximately 2024-02 to 2026-02). It is recommended to use recent dates such as
start_date: "2025-01", end_date: "2025-12" or "2026-01" .Do not use dates outside the range。
- Lowercase country: Use lowercase country codes (
"us" instead of "US"), or "world" for global
- Domain without protocol: Pass in
"google.com" instead of "https://www.google.com"
- Check
resp.ok: You must check the returned status
- API rate limiting: At most 10 requests per second; the system has built-in caching (1-hour TTL)
- ⚠️ A single code block can query at most 3 domains: Each API call is synchronously blocking (5-15 seconds per call), and more than 3 domains will cause execution timeout. Multi-domain research should beexecuted in batches(first batch of 3 → write to the table → second batch of 3).
- Use only
traffic_engagement and website_ranking action:traffic_sources and traffic_geography are unavailable under the current API plan (return 404). Do not use them.