Authentication

Authenticate with the ScrapeRouter API and manage API keys for production scraping.

API key authentication is the primary method for authenticating with the ScrapeRouter API. Pass your API key in the Authorization header as Api-Key {your_api_key}.

Header format

Authorization: Api-Key {your_api_key}

Example

#!/usr/bin/env bash
curl -X POST https://www.scraperouter.com/api/v1/scrape/ \
  -H "Authorization: Api-Key sr_live_abc123..." \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.com", "scraper": "auto"}'
import requests

response = requests.post(
    "https://www.scraperouter.com/api/v1/scrape/",
    headers={"Authorization": "Api-Key sr_live_abc123..."},
    json={"url": "https://example.com", "scraper": "auto"},
)
print(response.json())
const response = await fetch("https://www.scraperouter.com/api/v1/scrape/", {
  method: "POST",
  headers: {
    "Authorization": "Api-Key sr_live_abc123...",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    url: "https://example.com",
    scraper: "auto",
  }),
});

const data = await response.json();

Rate limiting

API requests are subject to concurrency limits per user. The default limit is 50 concurrent requests per user. If you exceed the limit, the API returns a 429 Too Many Requests response. See the Errors page for details.

Need higher concurrency limits? Contact us at contact@scraperouter.com to discuss your requirements.

Managing API keys

You can create and revoke API keys from the API Keys section of your dashboard. We recommend:

  • Use separate keys for development and production
  • Rotate keys periodically
  • Never commit keys to version control