cURL
curl --request GET \
--url https://api.brightdata.com/pricing_plans \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.brightdata.com/pricing_plans"
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/pricing_plans', 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/pricing_plans",
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/pricing_plans"
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/pricing_plans")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.brightdata.com/pricing_plans")
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{
"plans": [
{
"id": "<string>",
"name": "<string>",
"precommit": 123,
"is_current": true,
"product_prices": {}
}
]
}账户与状态
获取定价方案
使用 Bright Data 账号管理 API 的 GET /pricing_plans 列出账户当前的定价方案和所有可用方案,以及每个方案按产品和价格组划分的价格。请求无需参数,成功时返回 200 OK 和 JSON 格式的 plans 数组,可按 is_current 字段筛选当前方案。
GET
/
pricing_plans
cURL
curl --request GET \
--url https://api.brightdata.com/pricing_plans \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.brightdata.com/pricing_plans"
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/pricing_plans', 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/pricing_plans",
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/pricing_plans"
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/pricing_plans")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.brightdata.com/pricing_plans")
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{
"plans": [
{
"id": "<string>",
"name": "<string>",
"precommit": 123,
"is_current": true,
"product_prices": {}
}
]
}GET /pricing_plans 端点返回账户当前的定价方案以及账户可用的其他方案,并包含每个方案的各产品价格。所有价格均以美元计。
将您的 API key 粘贴到授权字段中。要获取 API key,请创建账号,并查看如何生成新的 API key?
此端点需要哪种 API key 权限?
GET /pricing_plans 需要 billing.read 权限。具有管理员或财务权限级别的 API key 拥有该权限。运维、限制或用户权限级别的 API key 无法调用此端点。
如何获取我当前的定价方案?
使用管理员或财务权限的 API key 调用GET /pricing_plans。此端点不接受任何参数:
curl -H "Authorization: Bearer YOUR_API_KEY" \
"https://api.brightdata.com/pricing_plans"
plans 数组。is_current 为 true 的条目即为您的当前方案。如只需输出该方案,可使用 jq 过滤响应:
curl -s -H "Authorization: Bearer YOUR_API_KEY" \
"https://api.brightdata.com/pricing_plans" \
| jq '.plans[] | select(.is_current)'
响应结构是怎样的?
plans 数组中的每个条目描述一个方案:
| 字段 | 类型 | 说明 |
|---|---|---|
id | string | 方案标识符 |
name | string | 方案名称 |
precommit | number | 方案的每月预付承诺金额,单位为美元 |
is_current | boolean | 账户当前使用的方案为 true,其他可用方案为 false |
product_prices | object | 方案价格,以内部产品键为键 |
product_prices 的键与费用明细导出过滤条件中使用的内部产品键相同,例如 dc(数据中心代理)和 res_static(ISP 代理)。每个值包含产品 name 和 price_groups 数组。每个价格组包含 name、prices 对象,部分产品还包含 unlim_ip_tier_prices 对象。
如何理解 prices 对象?
prices 中的每个键是一个计费单位,每个值是该单位的美元价格。例如,"prices": {"gb": 8} 表示每 GB $8。
| 键 | 计费单位 |
|---|---|
gb | 1 GB 流量 |
req | 1,000 个请求(CPM),而非单个请求 |
compute_hour、record、total、files_archive、files_cache、req_content、block 和 page_load。具体出现哪些键取决于产品。
哪些产品会返回 unlim_ip_tier_prices?
只有数据中心代理(dc)和 ISP 代理(res_static)会返回 unlim_ip_tier_prices。该对象将每个 IP 档位规模映射为对应的美元价格。
此端点有速率限制或特定错误吗?
没有。GET /pricing_plans 没有针对此端点的速率限制,也没有针对此端点的错误代码。
相关端点
授权
在 Authorization 头中使用您的 Bright Data API Key 作为 Bearer token。
认证方法:
- 从 Bright Data 账户设置获取您的 API Key: https://brightdata.com/cp/setting/users
- 在请求的 Authorization 头中包含 API Key
- 格式:
Authorization: Bearer YOUR_API_KEY
示例:
Authorization: Bearer b5648e1096c6442f60a6c4bbbe73f8d2234d3d8324554bd6a7ec8f3f251f07df
了解如何获取 Bright Data API Key: https://docs.brightdata.com/cn/api-reference/authentication#如何生成新的-api-key?
响应
200 - application/json
成功
您的当前方案以及账户可用的方案。
Show child attributes
Show child attributes
此页面对您有帮助吗?