Migrating from Bright Data Web Unlocker to Zyte API#
Learn how to migrate from Bright Data Web Unlocker to Zyte API.
Feature comparison#
The following table summarizes the feature differences between both products:
Proxy mode#
Zyte API offers a proxy mode. It is not as powerful as the HTTP API, but it makes it easier to migrate from Bright Data Web Unlocker.
To migrate:
In requests where you are setting a custom country through the proxy username, set it now through the Zyte-Geolocation proxy header.
For example, if your Bright Data Web Unlocker proxy username contains
country-us
to send requests from the USA, set theZyte-Geolocation
header toUS
to achieve the same with Zyte API.Update your proxy endpoint and authentication.
For more information, see Zyte API proxy mode.
HTTP API#
To get access to all Zyte API features, the HTTP API is the way to go.
The main challenge then becomes switching from a proxy API to an HTTP API. Because Zyte API has a wider range of features and can hence provide a richer output, you need JSON parsing, and in some cases base64-decoding, to get your data.
For example, to get the same output as the following Web Unlocker request:
curl \
--proxy zproxy.lum-superproxy.io:22225 \
--proxy-user lum-customer-YOUR_USER-zone-YOUR_ZONE:YOUR_PASSWORD \
https://toscrape.com/
Use Zyte API as follows:
curl \
--user YOUR_API_KEY: \
--header 'Content-Type: application/json' \
--compressed \
--data '{"url": "https://toscrape.com", "httpResponseBody": true}' \
https://api.zyte.com/v1/extract \
| jq --raw-output .httpResponseBody \
| base64 --decode
See Zyte API usage documentation for richer Zyte API examples, covering more scenarios and features.
If you notice your code has become slower with Zyte API, that’s normal, as Zyte API requests usually have a higher latency. If you want a similar or better speed, increase your concurrency, the number of requests you send in parallel, accordingly. See also Optimizing Zyte API usage.
HTTP API geolocation request field#
Web Unlocker only allows to customize 1 per-request parameter of importance
when migrating: country
.
To set a per-request country, use the geolocation request field, with the desired country code, with uppercase letters.
For example, replace:
curl … --proxy-user lum-customer-YOUR_USER-zone-YOUR_ZONE-country-us:YOUR_PASSWORD …
With:
curl … --data '{…, "geolocation": "US"}' …
For more details, see Geolocation.