Skip to main content
POST
Run a search
POST /webarchive/search 搜索 Bright Data Archive,返回完整的搜索结果对象或用于轮询状态的 search_id
每次搜索都必须指定时间范围。 filters 对象为必填项,其中必须包含 max_age,或者同时包含 min_datemax_date。缺少 filters 对象的请求会返回 HTTP 400 及 "filters" is required

如何设置搜索时间范围

使用 max_age 指定相对于当前时间的时间窗口。Bright Data 建议首次搜索时使用 max_age = 24h,因为最新数据的交付速度最快。
使用 min_datemax_date 指定固定的日历范围。两个日期均采用 YYYY-MM-DD 格式,且必须同时提供。请勿在同一请求中将它们与 max_age 一起使用。
对于早于 24 小时的日期范围,请使用 min_datemax_date,而不是 max_age。有关请求范围如何影响交付速度,请参阅数据范围与交付时间
如果搜索耗时超过 30 秒,响应将仅返回 search_id,您应该异步轮询状态。如果搜索在 30 秒内完成,响应将返回完整的搜索结果对象(与 GET /webarchive/search/<search_id> 相同)。
您每天可以运行最多 100 次搜索而不触发转储。 触发转储后,该搜索将不再计入您的限制。
  • 对于简单的模式匹配,使用 LIKE 过滤器(domain_like_*url_like_*),其中 % 表示任意序列,_ 表示单个字符。
  • LIKE 模式不区分大小写,对于简单的前缀/后缀匹配(如 %.comamazon%)通常比正则表达式更快。
  • 对于需要完整正则表达式语法的复杂模式,使用正则表达式过滤器(domain_regex_*url_regex_*)。LIKE 模式使用反斜杠转义:\% 表示字面上的 %\_ 表示字面上的 _

授权

Authorization
string
header
必填

Use your Bright Data API Key as a Bearer token in the Authorization header.

How to authenticate:

  1. Obtain your API Key from the Bright Data account settings at https://brightdata.com/cp/setting/users
  2. Include the API Key in the Authorization header of your requests
  3. Format: Authorization: Bearer YOUR_API_KEY

Example:

Learn how to get your Bright Data API key: https://docs.brightdata.com/api-reference/authentication

请求体

application/json
filters
object
必填

Filters that scope the search. The filters object is required, and it must carry a time range: either max_age, or both min_date and max_date.

响应

Search initiated successfully

search_id
string

Returned if search is async

示例:

"ucd_abc123xyz"