Zyte

Scraping and extraction via the Zyte API
View as Markdown

Fronts the API of Zyte: one endpoint that accepts a JSON body and answers with the result:

POST /zyte → https://api.zyte.com/v1/extract

Only POST is mounted. All controls — {url, httpResponseBody, browserHtml, screenshot, …} — go in the JSON body, which is relayed without modification.

Credential handling

Zyte expects HTTP Basic auth, with the API key serving as username and the password left empty, on the same Authorization header your gateway token rides in. The gateway therefore replaces that header with the credential it injects:

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

Example

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

Responses arrive as Zyte’s JSON, untouched. Field-level request and response detail lives in Zyte’s documentation; the gateway modifies neither.