Skip to main content
Docs API Ref
POST /links

Links API reference

Discover every URL on a website without downloading full page content. The Links endpoint is faster and cheaper than a full crawl because it only collects URLs. Use it for sitemap generation, broken link detection, site structure analysis, or as a first pass before targeted scraping.

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/links' \
    -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/links', 
  headers=headers, json=json_data)

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

const options = {
  hostname: 'api.spider.cloud',
  port: 443,
  path: '/links',
  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();