webscraperapi.ai

Authentication

How to authenticate with the webscraperapi.ai API.

Authentication

All API requests require an API key passed as a query parameter.

API key authentication

Pass your API key as the api_key query parameter on every request:

curl -G "https://api.webscraperapi.ai/v2/scrape" \
  -d "api_key=YOUR_API_KEY" \
  -d "url=https://example.com" \
  -d "output=markdown"
import requests

response = requests.get(
    "https://api.webscraperapi.ai/v2/scrape",
    params={
        "api_key": "YOUR_API_KEY",
        "url": "https://example.com",
        "output": "markdown",
    },
)
const params = new URLSearchParams({
  api_key: 'YOUR_API_KEY',
  url: 'https://example.com',
  output: 'markdown',
});

const response = await fetch(
  `https://api.webscraperapi.ai/v2/scrape?${params}`
);

Getting your API key

  1. Sign up at webscraperapi.ai.
  2. Go to Settings.
  3. Copy your API key.

Keep your API key secret. Do not commit it to version control or expose it in client-side code.

Test your key

Verify your API key works with a quick ping:

curl "https://api.webscraperapi.ai/v2/scrape?api_key=YOUR_API_KEY&url=https://example.com&output=metadata"

A successful response returns a 200 status with JSON data. If your key is invalid, you'll get a 401 error.

Header authentication

Authorization: Bearer header authentication is being implemented and will be available soon. For now, use the api_key query parameter.

Rate limits

API requests are rate-limited per API key. If you exceed the limit, you'll receive a 429 Too Many Requests response. Back off and retry with exponential backoff.

Rate limits vary by plan. Contact us if you need higher throughput.

MCP OAuth

webscraperapi.ai supports OAuth for MCP (Model Context Protocol) integrations. Documentation for MCP OAuth will be available soon.

On this page