Register for a DataForSEO account, obtain your API login and password, and encode them as a Base64 Basic Auth string for request headers
Send a POST request to the SERP API task creation endpoint (e.g., /v3/serp/google/organic/task_post) with a JSON body containing keyword, location_code or location_name, language_code, and se_type parameters
Poll the task status endpoint or use a pingback/postback URL to retrieve results when the task is complete; tasks are asynchronous and may take seconds to minutes
Alternatively, use the Live endpoints (/v3/serp/google/organic/live/advanced) for synchronous results that return immediately at a higher cost per request
Parse the response tasks[0].result array, which contains ranked items each with type, rank_group, rank_absolute, url, title, and snippet fields
Known gotchas
DataForSEO charges per task; using Live endpoints costs significantly more per request than asynchronous task endpoints — use async for bulk operations and Live only where latency matters
Location and language codes must match the DataForSEO reference lists exactly; passing a country name string instead of the numeric location_code can result in a fallback to a default location rather than an error
Result pages are scraped from live search engines and reflect the SERP at the moment of the request; results for the same keyword will differ across requests due to personalization, freshness, and A/B tests on the search engine side
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp