Web Scraping
Google Search
Get raw Google search results for any query.
POST
$0.02/call/v1/search/googleUsage
const res = await fetch('https://api.yepapi.com/v1/search/google', {
method: 'POST',
headers: {
'x-api-key': 'YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({ query: 'best web scraping api', country: 'us' }),
});
const { data } = await res.json();
console.log(data.html); // Raw Google SERP HTMLcurl -X POST https://api.yepapi.com/v1/search/google \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"query": "best web scraping api", "numResults": 10}'Request Body
| Parameter | Type | Required | Description | Default |
|---|---|---|---|---|
query | string | Yes | Search query | — |
country | string | No | Country code for geo-targeted results | "us" |
numResults | number | No | Number of results to return | 10 |
Response
{
"ok": true,
"data": {
"query": "best web scraping api",
"html": "<!DOCTYPE html><html>...(full Google SERP HTML)...</html>"
}
}Response Fields
| Field | Type | Description |
|---|---|---|
ok | boolean | Whether the request succeeded |
data | object | Response payload |
data.query | string | The search query that was executed |
data.html | string | Raw Google SERP HTML. Parse this to extract organic results, featured snippets, People Also Ask, and other SERP features |
Info
Returns the raw Google search results page HTML. Parse it to extract organic results, featured snippets, People Also Ask, ads, and any other SERP features you need.