Deep SERP
Extract structured search engine results (SERP) data from Google and other search engines. Get organic results, ads, local results, knowledge graphs, and more.
Basic Search
import { ScrayleClient } from '@scrayle/sdk';
const client = new ScrayleClient({ apiKey: process.env.SCRAYLE_API_KEY });
const results = await client.scraping.scrape({
actor: 'scraper.google.search',
input: {
q: 'web scraping tools',
gl: 'us',
num: 10,
},
});
console.log(results);Search Parameters
| Parameter | Type | Description |
|---|---|---|
q | string | Search query |
gl | string | Google country code (e.g., "us", "gb") |
hl | string | Language code (e.g., "en", "de") |
num | number | Number of results to return |
start | number | Result offset for pagination |
Result Types
The SERP response includes multiple result types:
Organic Results
interface SerpOrganicResult {
position: number;
title: string;
link: string;
displayedLink?: string;
snippet?: string;
date?: string;
}Ad Results
interface SerpAdResult {
position: number;
title: string;
link: string;
displayedLink?: string;
snippet?: string;
}Local Results
interface SerpLocalResult {
position: number;
title: string;
address?: string;
rating?: number;
reviews?: number;
type?: string;
}Full Response
interface SerpResult {
searchMetadata?: {
id: string;
status: string;
q: string;
totalResults?: string;
timeTaken?: number;
};
organicResults?: SerpOrganicResult[];
adResults?: SerpAdResult[];
localResults?: SerpLocalResult[];
productResults?: SerpProductResult[];
relatedSearches?: string[];
answerBox?: Record<string, unknown>;
knowledgeGraph?: Record<string, unknown>;
}Async Usage
// Create task without waiting
const task = await client.scraping.createTask({
actor: 'scraper.google.search',
input: { q: 'javascript frameworks', num: 20 },
});
// Get result later
const result = await client.scraping.getTaskResult(task.data.taskId);With Proxy
const results = await client.scraping.scrape({
actor: 'scraper.google.search',
input: { q: 'restaurants near me', gl: 'us' },
proxy: {
country: 'US',
type: 'residential',
},
});