cURL
curl --request GET \
--url https://api.brightdata.com/zone/cost \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.brightdata.com/zone/cost"
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/zone/cost', 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/zone/cost",
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/zone/cost"
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/zone/cost")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.brightdata.com/zone/cost")
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{
"ID": {
"back_m2": {
"bw": 0,
"cost": 0
},
"back_m1": {
"bw": 36557298,
"cost": 0
},
"back_m0": {
"bw": 1219004,
"cost": 0
},
"back_d2": {
"bw": 82190,
"cost": 0
},
"back_d1": {
"bw": 0,
"cost": 0
},
"back_d0": {
"bw": 0,
"cost": 0
}
}
}Stats & usage
Total cost & bandwidth for a zone
Returns 200 OK with billed cost, bandwidth and usage for a Zone over a date range. Matches the Control Panel Usage Overview and your invoice.
GET
/
zone
/
cost
cURL
curl --request GET \
--url https://api.brightdata.com/zone/cost \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.brightdata.com/zone/cost"
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/zone/cost', 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/zone/cost",
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/zone/cost"
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/zone/cost")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.brightdata.com/zone/cost")
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{
"ID": {
"back_m2": {
"bw": 0,
"cost": 0
},
"back_m1": {
"bw": 36557298,
"cost": 0
},
"back_m0": {
"bw": 1219004,
"cost": 0
},
"back_d2": {
"bw": 82190,
"cost": 0
},
"back_d1": {
"bw": 0,
"cost": 0
},
"back_d0": {
"bw": 0,
"cost": 0
}
}
}The
to parameter is exclusive. The day specified in to is not included in the result. To match a calendar month shown in the Control Panel or on your invoice, set to to the first day of the following month. For example, from=2026-04-01&to=2026-05-01 returns all of April 2026.This endpoint is scoped to a single zone and cannot return Web Scraper API or Scraper Studio cost data (those are keyed by
dataset_id / collector ID, not by zone name). For multi-product or WSA / Scraper Studio breakdowns, use Cost breakdown export.Paste your API key to the authorization field. To get an API key, Create an account and learn how to generate an API key.
Reproduce your monthly invoice
To retrieve the exact billed cost and usage for a calendar month as shown in the Control Panel and on your invoice, setfrom to the first day of the month and to to the first day of the following month:
# Returns billed usage for all of April 2026
curl -H "Authorization: Bearer YOUR_API_KEY" \
"https://api.brightdata.com/zone/cost?zone=YOUR_ZONE&from=2026-04-01&to=2026-05-01"
to=2026-04-30 would omit the last day of the month. Always set to to the day after the last day you want included.
Reconciling with raw request logs
The values returned by this endpoint are the source of truth for billing. They match the Control Panel’s Usage Overview and your invoice. If you compare these values against raw request logs you collect yourself (e.g., access logs forwarded to Logz, CloudWatch, or another sink), expect differences of a few percent. Raw logs may capture requests that were never committed to the billing database because of async aggregation timing or transient network issues. Your invoice always reflects the values returned by this endpoint.Related endpoints
- Bandwidth stats for a Zone. Bandwidth only, no cost.
- Bandwidth stats for all your Zones. Aggregate across zones.
Authorizations
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
Query Parameters
Zone name (e.g., se_midware).
Inclusive start date in YYYY-MM-DD format.
Exclusive end date in YYYY-MM-DD format. The day specified is NOT included in the result.
To match a calendar month shown in the Control Panel or on your invoice, set to to the first day of the following month (e.g., from=2026-04-01&to=2026-05-01 returns all of April 2026).
Response
200 - application/json
OK
The response is of type object.
Was this page helpful?