AlterLabAlterLab
Quickstart

Your First Request

Learn how to make your first API call and scrape a web page in under 2 minutes.

1. Get Your API Key

First, you'll need an API key. Sign up at alterlab.io and navigate to your dashboard to generate one.

Your API key will look like this:

sk_live_xxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxx

Keep Your API Key Secret

Never share your API key or commit it to version control. Use environment variables to store it securely.

2. Make a Request

Now let's scrape a web page. Here's a simple example that fetches the content of example.com:

curl -X POST https://api.alterlab.io/api/v1/scrape \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.com"}'

Replace YOUR_API_KEY

Don't forget to replace YOUR_API_KEY with your actual API key from the dashboard.

3. Understand the Response

The API returns a JSON object with the scraped content and metadata:

Response
{
  "success": true,
  "content": "<!DOCTYPE html>\n<html>\n<head>...",
  "url": "https://example.com",
  "status_code": 200,
  "credits_used": 1,
  "tier_used": "curl",
  "timing": {
    "total_ms": 245
  }
}

Key Response Fields

contentThe raw HTML content of the scraped page
successWhether the scrape completed successfully
credits_usedCost of this request
tier_usedThe scraping tier used (curl, http, stealth, browser, or captcha)

You Did It!

Congratulations! You've successfully made your first API request. The HTML content is now available in the content field.