Scraping Google directly from PHP looks like a five-line cURL script — until the IP bans, CAPTCHAs and broken selectors start. Here’s the cheap, reliable way: one API call that returns Google results as structured JSON.
Why DIY scraping in PHP gets expensive
- IP blocks — Google blocks datacenter IPs fast, so you’d rent rotating residential proxies (often $3–5/GB).
- CAPTCHAs — triggered by volume; solving them costs money and time.
- Headless browsers — Google increasingly needs JS execution; now you’re running headless Chrome from PHP.
- Parser rot — Google’s HTML shifts and your DOMDocument selectors break silently.
Add it up and “free” scraping costs more in proxies, servers and maintenance than a cheap SERP API.
The cheap way: one HTTP call
Zero dependencies — native cURL, POST a JSON body, get JSON back:
<?php
$ch = curl_init("https://api.serp.cheap/v1/search");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
"X-API-Key: " . getenv("SERP_CHEAP_API_KEY"),
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode([
"q" => "best crm software",
"gl" => "us",
]),
]);
$data = json_decode(curl_exec($ch), true);
curl_close($ch);
foreach ($data["organic"] as $r) {
printf("%d. %s\n %s\n", $r["position"], $r["title"], $r["link"]);
}
That’s the whole scraper. No proxies, no headless browser, no parser to maintain.
Or use the official SDK
composer require serpcheap/serpcheap
$client = new SerpCheap\Client(getenv("SERP_CHEAP_API_KEY"));
$res = $client->search(q: "best crm software", gl: "us");
Laravel app? composer require serpcheap/laravel wires up a facade and config. Full walkthrough in the PHP tutorial.
What it costs
| Price per query | |
|---|---|
| Fresh result | $0.0006 |
| Cached result | $0.0003 |
| Free on signup | 100 searches |
Pay-as-you-go from $0.75/1k, and credits stay valid for 12 months — cheaper than the proxy bandwidth alone. Compare in the cheapest SERP API roundup.
Parameters you’ll use
gl— country of results (us,de,br, …). See local SEO.hl— interface language.page— 1-indexed; each page is a separate request. See pagination.tbs— time filter for recent results.
Next
- Google Search API in PHP: full tutorial
- How to scrape Google reliably
- Cheapest Google Search API 2026
Try serp.cheap
Copy the cURL snippet, add your key, and you’re scraping Google from PHP. 100 free searches on signup — no card required; pay-as-you-go from $0.75/1k after that, and credits stay valid for 12 months.
- Get your free API key →
- Prefer paying by card? serp.cheap is also on RapidAPI (
$0.90/1k) and Apify ($1.50/1k).