Read this before changing anything. Every line below was verified against the
live API or the installed SDK, @brightdata/sdk 1.2.0, on 2026-09-20.
Reviews bill one credit per review, and there is no working cap in this SDK.
- The API takes
max_reviews, and Bright Data's own documented sample sets it to 20.AmazonCollectReviewsFilterSchemadeclares onlyurlandreviews_to_not_include, and is strict, somax_reviewsis rejected. limitPerInput, the SDK's own cap, returns zero rows on the reviews dataset. Measured three times across two products,success: true,status: "ready", no error row. The same option behaves normally on products.- So the only reviews call that returns anything is the uncapped one.
B0CRMZHDG8reports 205,036 reviews. That is one call.
Tracked in sdk-js#37. Until it
is fixed, no README block may call collectReviews or reviews, and a test
enforces that. Use the REST endpoint directly if you need a bounded slice.
limitPerInput is the only bound on a discovery call, and it is silently
stripped unless async: true is passed alongside it. The options schema is a
union keyed on async, and the sync half drops unknown keys, so the cap
vanishes with no error. The typed DiscoverOptions tells you to omit async,
which means the correctly typed call is the uncapped one. Tracked in
sdk-js#36. Pass both, always.
Verified: discoverProductsByKeyword with limitPerInput: 3 returned exactly
3 rows.
- The SDK reads
apiKey, thenBRIGHTDATA_API_TOKENorBRIGHTDATA_API_KEY, then the credentialsbdata loginstored. - This SDK does not read a
.envfile. Node 20 loads one:node --env-file=.env. - Always
new bdclient({ autoCreateZones: false }). Zone creation needs a payment method and this repository never uses a zone.
- Amazon lives on
client.scrape.amazon. The products dataset isgd_l7q7dkf244hwjntr0, the id the control panel shows, and it holds about 300 million records. - Poll options are milliseconds.
pollTimeoutdefaults to 600000. - The API quotes about 7 seconds per input, and a single product usually
returns in 12 to 25 seconds. Keyword discovery is far less predictable: the
same call took 32 s once and 547 s another time.
live.ymlallows a block 15 minutes for that reason. - Every ASIN goes in one job. The API bills per record, not per job.
- A batch returns rows in no guaranteed order.
attribute()matches each row to its ASIN by the row's ownasin, falling back to the ASIN insideinput_url,urlorinput.url. Never match by position. - A dead ASIN comes back as a row whose error reads "The navigation resulted in a dead page (404 status code)". Match the message, not a code.
- One credit per record. 5,000 credits are free each month, and the products scraper is priced at $1.50 per 1,000 records.
The API accepts more than the SDK's filters allow. Checked against
GET /datasets/v3/scrapers?domain=amazon.com:
- Products
collect_by_urltakesurl,asin,origin_url,zipcode,language,all_variations. The SDK filter takesurl,zipcode,languageand rejects the other three. So an ASIN has to be written as a/dp/URL, which is whatproductUrl()does. - There is a fifth Amazon scraper, the products global dataset
(
gd_lwhideng15g8jg63s7), with discovery by seller and by brand and adomainparameter for other Amazon sites. Neither SDK exposes it. - The four datasets this SDK does reach: products
gd_l7q7dkf244hwjntr0(119 fields), reviewsgd_le8e811kzy4ggddlq(31), sellersgd_lhotzucw1etoe5iw1k(29), product searchgd_lwdb4vjm1ehb499uxs(30).
- Never hardcode a field list. A product carries the fields that apply to it: the two products in the README returned 99 and 100 fields out of 119.
- The API marks
seller_name,zipcodeandcouponaspii: true. The sellers dataset also marksemailandseller_phone_number, so treat that one with more care than products. - Read the schema with the raw metadata endpoint, as the field-table step in
live.ymldoes. - The full documentation index: https://docs.brightdata.com/llms.txt
On 2026-09-16, building the Instagram twin, the API went through stretches of
about an hour where most jobs sat until the poll deadline and returned
status: "timeout" with no rows. A red live check whose only symptom is
timeouts is probably a bad wave: rerun it before looking for a code change.
npm testruns offline and needs no token.npm run lintmust pass.- CI installs from the README's own commands on an empty machine. A weekly workflow executes every fenced block in the README against the real API.
- The field table and the "last verified" badge are rewritten by the daily run. Do not edit either by hand.
- Keep it small: 15 files and about 350 lines of JavaScript in
src/. Do not add retries, deduplication, scheduling, databases or concurrency.