Language Integration

Web Scraping API for PHP

Call AlterLab's web scraping API from PHP using cURL or Guzzle. Works in Laravel, Symfony, and plain PHP scripts. Extract structured data from any website and receive clean JSON responses.

View API Docs

Quick Start

PHP (cURL)
<?php

$apiKey = "YOUR_API_KEY";
$payload = json_encode(["url" => "https://example.com"]);

$ch = curl_init("https://alterlab.io/api/v1/scrape");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    "X-API-Key: $apiKey",
    "Content-Type: application/json",
]);

$response = curl_exec($ch);
curl_close($ch);

$data = json_decode($response, true);
echo $data["content"];

Need an API key? — no credit card required.

How It Works

1

Send a URL

POST any public URL to the AlterLab API with your API key. The API handles JavaScript rendering and access automatically.

2

Receive structured data

The API returns clean JSON with page content, metadata, and any structured fields you requested via an extraction schema.

3

Use in your project

Integrate the response into your PHP application, database, or workflow. No scraper maintenance required.

Common Use Cases

Frequently Asked Questions

Explore All Integrations

View all SDK and tool integrations on the Integrations overview.

Responsible Use

AlterLab is designed for extracting publicly available data. Always review the terms of service for any website you access, respect robots.txt directives, and ensure your use case complies with applicable laws in your jurisdiction.

Your first scrape.
Sixty seconds.

$1 free credit — up to 5,000 scrapes. No credit card.Just a POST request.

terminal
curl -X POST https://api.alterlab.io/v1/scrape \
-H "X-API-Key: YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com", "formats": ["markdown"]}'

No credit card required · $1 free credit, up to 5,000 scrapes · Balance never expires