curl -sS "https://api.adscrawl.net/spa-extract/templates" \
-H "x-api-key: YOUR_API_KEY"
const response = await fetch("https://api.adscrawl.net/spa-extract/templates", {
headers: { "x-api-key": "YOUR_API_KEY" },
});
const result = await response.json();
console.log(result.templates);
import httpx
response = httpx.get(
"https://api.adscrawl.net/spa-extract/templates",
headers={"x-api-key": "YOUR_API_KEY"},
)
response.raise_for_status()
print(response.json()["templates"])
{
"templates": [
{
"id": "similarweb-overview",
"name": "SimilarWeb Website Overview",
"description": "Get public website traffic, engagement, and ranking metrics from SimilarWeb.",
"urlPattern": "^https://www\\.similarweb\\.com/website/[^/?#]+/?(?:[?#].*)?$",
"exampleUrl": "https://www.similarweb.com/website/dolphin-anty.com/#overview",
"version": 5,
"updatedAt": "2026-07-18T14:07:33.000Z",
"outputFields": [
"avgVisitDuration",
"avgVisitDurationSeconds",
"bounceRate",
"categoryRank",
"countryRank",
"globalRank",
"pagesPerVisit",
"period",
"targetDomain",
"totalVisits",
"totalVisitsDisplay"
],
"waitUntil": "domcontentloaded",
"input": {
"type": "domain",
"example": "dolphin-anty.com",
"urlTemplate": "https://www.similarweb.com/website/{value}/#overview"
},
"catalog": {
"category": "analytics",
"featured": true,
"keywords": ["traffic", "rank", "website analytics"]
}
}
]
}
{
"error": "Unauthorized"
}
{
"error": "Failed to load template catalog"
}
浏览器任务
列出提取模板
获取所有可用的内置提取模板列表,包含每个模板的输入类型、示例 URL、输出字段、默认等待事件和目录元数据,便于在 POST /spa-extract 中直接引用模板 ID。
GET
/
spa-extract
/
templates
curl -sS "https://api.adscrawl.net/spa-extract/templates" \
-H "x-api-key: YOUR_API_KEY"
const response = await fetch("https://api.adscrawl.net/spa-extract/templates", {
headers: { "x-api-key": "YOUR_API_KEY" },
});
const result = await response.json();
console.log(result.templates);
import httpx
response = httpx.get(
"https://api.adscrawl.net/spa-extract/templates",
headers={"x-api-key": "YOUR_API_KEY"},
)
response.raise_for_status()
print(response.json()["templates"])
{
"templates": [
{
"id": "similarweb-overview",
"name": "SimilarWeb Website Overview",
"description": "Get public website traffic, engagement, and ranking metrics from SimilarWeb.",
"urlPattern": "^https://www\\.similarweb\\.com/website/[^/?#]+/?(?:[?#].*)?$",
"exampleUrl": "https://www.similarweb.com/website/dolphin-anty.com/#overview",
"version": 5,
"updatedAt": "2026-07-18T14:07:33.000Z",
"outputFields": [
"avgVisitDuration",
"avgVisitDurationSeconds",
"bounceRate",
"categoryRank",
"countryRank",
"globalRank",
"pagesPerVisit",
"period",
"targetDomain",
"totalVisits",
"totalVisitsDisplay"
],
"waitUntil": "domcontentloaded",
"input": {
"type": "domain",
"example": "dolphin-anty.com",
"urlTemplate": "https://www.similarweb.com/website/{value}/#overview"
},
"catalog": {
"category": "analytics",
"featured": true,
"keywords": ["traffic", "rank", "website analytics"]
}
}
]
}
{
"error": "Unauthorized"
}
{
"error": "Failed to load template catalog"
}
获取所有可用的内置提取模板。每个模板都包含所需的输入类型、示例 URL、预期输出字段以及元数据,可将模板
id 用于 POST /spa-extract 请求。
响应
array
可用提取模板列表。
显示 模板字段
显示 模板字段
string
在 POST /spa-extract 请求中使用的模板 ID。
string
模板的可读名称。
string
模板提取的内容说明。
string
匹配受支持 URL 的正则表达式。
string
该模板的示例页面 URL。
number
模板版本。
string
最后更新时间,ISO 8601 格式。
array
模板返回的字段名列表。
string
默认的导航等待事件。
| 状态码 | 含义 |
|---|---|
| 200 | 返回启用中的模板及其输入、默认值和输出字段。 |
| 401 | 缺少或无效的 x-api-key。 |
| 500 | 加载模板目录失败。 |
在
POST /spa-extract 请求体的 template 字段中传入模板 id(例如 "similarweb-overview")。curl -sS "https://api.adscrawl.net/spa-extract/templates" \
-H "x-api-key: YOUR_API_KEY"
const response = await fetch("https://api.adscrawl.net/spa-extract/templates", {
headers: { "x-api-key": "YOUR_API_KEY" },
});
const result = await response.json();
console.log(result.templates);
import httpx
response = httpx.get(
"https://api.adscrawl.net/spa-extract/templates",
headers={"x-api-key": "YOUR_API_KEY"},
)
response.raise_for_status()
print(response.json()["templates"])
{
"templates": [
{
"id": "similarweb-overview",
"name": "SimilarWeb Website Overview",
"description": "Get public website traffic, engagement, and ranking metrics from SimilarWeb.",
"urlPattern": "^https://www\\.similarweb\\.com/website/[^/?#]+/?(?:[?#].*)?$",
"exampleUrl": "https://www.similarweb.com/website/dolphin-anty.com/#overview",
"version": 5,
"updatedAt": "2026-07-18T14:07:33.000Z",
"outputFields": [
"avgVisitDuration",
"avgVisitDurationSeconds",
"bounceRate",
"categoryRank",
"countryRank",
"globalRank",
"pagesPerVisit",
"period",
"targetDomain",
"totalVisits",
"totalVisitsDisplay"
],
"waitUntil": "domcontentloaded",
"input": {
"type": "domain",
"example": "dolphin-anty.com",
"urlTemplate": "https://www.similarweb.com/website/{value}/#overview"
},
"catalog": {
"category": "analytics",
"featured": true,
"keywords": ["traffic", "rank", "website analytics"]
}
}
]
}
{
"error": "Unauthorized"
}
{
"error": "Failed to load template catalog"
}