Google

Google SERP Scraper (Async)

This endpoint queues a Google Search scraping task and immediately returns a task ID. Fetch the result with the Get SERP Async Result endpoint, or let it be delivered to your callback URL once the task completes.

Note

  • Use the Async Scraper API Server (https://async.scraper.mrscraper.com) host when calling this endpoint.
  • Pass the returned data.taskId to the Get Google SERP Async Result endpoint to retrieve the scraped data.
  • When callbackUrl is set, the result is sent to that URL as soon as the task completes, so you do not have to poll for it.
POST
/api/serp
AuthorizationBearer <token>

In: header

Request Body

application/json

query*string

Search keyword or phrase to query on Google Search

region?string

Country code used to localize search results (e.g., us, gb, id)

language?string

Language code for the search results (e.g., en, id, es)

page?integer

Page number of the results to retrieve

format?string

Format of the returned results. Use json for parsed results or html for the raw results page.

Value in"html" | "json"
renderJs?boolean

Wait until JavaScript rendering finishes. Set to true to make sure the AI overview is loaded.

callbackUrl?string

URL that receives the scrape result once the task completes

Response Body

application/json

application/json

application/json

curl -X POST "https://api.app.mrscraper.com/api/serp" \  -H "Content-Type: application/json" \  -d '{    "query": "mrscraper"  }'
{
  "success": true,
  "message": "Task created successfully",
  "data": {
    "taskId": 508278642,
    "params": {
      "query": "mrscraper",
      "region": "us",
      "language": "en",
      "format": "json",
      "page": 1,
      "renderJs": true,
      "callbackUrl": "https://async.scraper.mrscraper.com/webhook",
      "mobile": true
    }
  }
}
{
  "message": "Unauthorized access",
  "error": "Unauthorized"
}
{
  "message": "You do not have permission to access this resource",
  "error": "Forbidden",
  "statusCode": 403
}