zyte dashboard

Getting Started with Zyte API

Quick Start Guide

Welcome to the Zyte API documentation. This guide will help you get started with our powerful web scraping API.

Prerequisites

  • A Zyte API account
  • API key from your dashboard
  • Basic understanding of HTTP requests

Installation

npm install zyte-api

API Reference

Authentication

All API requests require authentication using your API key.

Authorization: Bearer YOUR_API_KEY

Endpoints

GET /api/v1/spiders

List all spiders in your account

curl -H "Authorization: Bearer YOUR_API_KEY" https://api.zyte.com/v1/spiders

POST /api/v1/spiders

Create a new spider

curl -X POST -H "Authorization: Bearer YOUR_API_KEY" -H "Content-Type: application/json" -d '{"name": "my-spider"}' https://api.zyte.com/v1/spiders

Examples

Basic Usage

const ZyteAPI = require('zyte-api');

const api = new ZyteAPI({
  apiKey: 'YOUR_API_KEY'
});

// List all spiders
api.spiders.list()
  .then(spiders => console.log(spiders))
  .catch(error => console.error(error));

Advanced Usage

// Create a new spider with custom settings
api.spiders.create({
  name: 'my-spider',
  startUrls: ['https://example.com'],
  settings: {
    maxRequests: 1000,
    concurrentRequests: 10
  }
})
  .then(spider => console.log(spider))
  .catch(error => console.error(error));