Bright Data

One direct endpoint covering Web Unlocker and the SERP API
View as Markdown

Fronts the direct API of Bright Data — a single endpoint serving two products, Web Unlocker and SERP API:

POST /brightdata → https://api.brightdata.com/request

Only POST is mounted. All controls — {zone, url, format, …} — go in the JSON body; which of the two products handles the call is decided by the zone field rather than the path.

Automatic zone injection

A zone names the Web Unlocker / SERP zone configured on the account — a value scoped to that account, which you can’t know in advance. The gateway therefore fills it in whenever your body leaves it out, so {url, format} alone is a valid call to /brightdata:

  • A body without zone gets the configured zone added.
  • A body carrying zone is left alone — your value wins.

Credential handling

Bright Data takes its key in Authorization: Bearer — the very header carrying your gateway token — so the gateway replaces that header with the Bright Data key:

  • Authorization is overwritten with Bright Data’s secret key. Your gateway token stops at the gateway and never travels upstream.
  • No query-param form of the key exists on Bright Data’s side, so nothing gets removed from the query string.

Responses

Whatever Bright Data returns streams through unmodified. Under format: "raw" that means the target site’s raw bytes — HTML, JSON, occasionally binary — forwarded exactly as received.

Example

$curl -X POST "$GATEWAY/brightdata" \
> -H "Authorization: Bearer $TOKEN" \
> -H "Content-Type: application/json" \
> -d '{"url": "https://example.com", "format": "raw"}'

The reply is Bright Data’s own, passed along untouched. Field-level request and response detail lives in Bright Data’s documentation; the gateway modifies neither.