Skip to content

xyteThe Zyte API, on any proxy

Same request JSON, same response JSON, same error codes as Zyte's POST /v1/extract. Traffic exits through Oxylabs, Bright Data, ZenRows, any proxy URL, no proxy at all, or Zyte itself.

xyte

Install ​

sh
npm i @xtandard/xyte
ts
import { Xyte, oxylabs, decodeBody } from '@xtandard/xyte';

const xyte = new Xyte({
  proxy: oxylabs({ username: process.env.OXYLABS_USERNAME!, password: process.env.OXYLABS_PASSWORD! }),
});
const page = await xyte.extract({ url: 'https://example.com', httpResponseBody: true, geolocation: 'US' });
console.log(decodeBody(page.httpResponseBody!));

Or as a server that existing Zyte code calls:

sh
XYTE_PROVIDER=oxylabs OXYLABS_USERNAME=… OXYLABS_PASSWORD=… npx @xtandard/xyte serve --port 8011

Why it exists ​

xyte is a personal project: a library that makes one scraping flow easier to write. One request format for every exit, fallbacks from a cheap exit to a better one when a site bans, and the same code whether the request goes to Zyte, to a proxy, or nowhere special. It speaks Zyte's API because that API is well designed and well documented, so code moves between xyte and Zyte in either direction. It doesn't try to compete with or replace Zyte, which is one of its providers, and it isn't affiliated with Zyte (disclaimer).

MIT licensed. A personal project, not affiliated with Zyte Group Ltd (disclaimer).