curl --request GET \
--url https://api.brightdata.com/webarchive/search/{search_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.brightdata.com/webarchive/search/{search_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.brightdata.com/webarchive/search/{search_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.brightdata.com/webarchive/search/{search_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.brightdata.com/webarchive/search/{search_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.brightdata.com/webarchive/search/{search_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.brightdata.com/webarchive/search/{search_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"search_id": "ucd_abc123xyz",
"status": "in_progress"
}获取搜索状态
使用 Bright Data Archive API 获取搜索状态。GET /webarchive/search/ 返回 200 OK,包含匹配文件数、快照大小和预估费用。
curl --request GET \
--url https://api.brightdata.com/webarchive/search/{search_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.brightdata.com/webarchive/search/{search_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.brightdata.com/webarchive/search/{search_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.brightdata.com/webarchive/search/{search_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.brightdata.com/webarchive/search/{search_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.brightdata.com/webarchive/search/{search_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.brightdata.com/webarchive/search/{search_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"search_id": "ucd_abc123xyz",
"status": "in_progress"
}- 您查询的条目数量
- 完整数据快照的估计大小和成本
estimate_batch_size 以字节为单位。dump_cost_usd 是基于 files_count 和您当前缓存/存档定价层的估计总成本。cost_breakdown 对象显示缓存和存档页面的单独成本。授权
Use your Bright Data API Key as a Bearer token in the Authorization header.
How to authenticate:
- Obtain your API Key from the Bright Data account settings at https://brightdata.com/cp/setting/users
- Include the API Key in the Authorization header of your requests
- Format:
Authorization: Bearer YOUR_API_KEY
Example:
Authorization: Bearer b5648e1096c6442f60a6c4bbbe73f8d2234d3d8324554bd6a7ec8f3f251f07df
Learn how to get your Bright Data API key: https://docs.brightdata.com/api-reference/authentication
路径参数
Unique identifier for the search
"ucd_abc123xyz"
响应
Search status response
- Success
- Pending
- Failed
Unique identifier for the search
Current status: in_progress, done, or failed
done The filters used for this search (echoed back)
Total number of matching files found
Estimated number of batches for the dump
Estimated total size in bytes
Estimated total cost to create a dump
Breakdown of costs between cache and archive pages
Show child attributes
Show child attributes
Estimated time to complete the dump in seconds
How long the search took to complete
Error message (only present when status is failed)
此页面对您有帮助吗?