Skip to main content
Docs API Ref
POST /scrape

Scrape API reference

The Scrape API fetches one or more URLs you name and returns their content. Unlike Crawl, it does not follow links. Use it to pull structured data from known pages, watch a page for changes, or get article text to process.

For what the endpoint returns and what it costs, read the web scraping API overview. To configure outside scraping providers, see the provider router setup for modes, credentials, and provider documentation. To see one response before you write code, paste a URL into the keyless web scraper.

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/scrape' \
    -H "Authorization: Bearer $SPIDER_API_KEY" \
    -H 'Content-Type: application/json' \
    -d'{"return_format":"markdown","url":""}'
Python
import requests, os

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

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

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

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

const options = {
  hostname: 'api.spider.cloud',
  port: 443,
  path: '/scrape',
  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({"return_format":"markdown","url":""}));
req.end();