Skip to main content
Docs API Ref
POST /crawl

Crawl API reference

The Crawl API starts at one URL and follows links to find every page on the domain. Results stream back as they are found, so you can process pages before the full crawl completes. Set depth limits, page caps and the output format to decide what comes back.

Parameters

Endpoint Parameters(1)
NameTypeDefaultDescription
urlrequiredstring

The URI resource to crawl. This can be a comma split list for multiple URLs.

Request samples

cURL
curl 'https://api.spider.cloud/crawl' \
    -H "Authorization: Bearer $SPIDER_API_KEY" \
    -H 'Content-Type: application/json' \
    -d'{"limit":5,"return_format":"markdown","url":""}'
Python
import requests, os

headers = {
    'Authorization': f'Bearer {os.getenv("SPIDER_API_KEY")}',
    'Content-Type': 'application/json',
}

json_data = {"limit":5,"return_format":"markdown","url":"https://spider.cloud"}

response = requests.post('https://api.spider.cloud/crawl', 
  headers=headers, json=json_data)

print(response.json())
Node.js
import https from 'https';

const options = {
  hostname: 'api.spider.cloud',
  port: 443,
  path: '/crawl',
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${process.env.SPIDER_API_KEY}`,
    'Content-Type': 'application/json'
  }
};

const req = https.request(options, function (res) {
  const chunks = [];

  res.on('data', function (chunk) {
    chunks.push(chunk);
  });

  res.on('end', function () {
    const body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.write(JSON.stringify({"limit":5,"return_format":"markdown","url":""}));
req.end();