{
  "openapi": "3.0.1",
  "info": {
    "title": "Google Search Results Scraper: SERP, Ads & AI Overview",
    "description": "Scrape Google search result pages: organic results, paid ads, People Also Ask with answers, related queries, featured snippet and AI Overview with sources. Pay per SERP page, no subscription.",
    "version": "1.4",
    "x-build-id": "SUjlBv0MPgfnuIgm5"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/santamaria-automations~google-search-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-santamaria-automations-google-search-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/santamaria-automations~google-search-scraper/runs": {
      "post": {
        "operationId": "runs-sync-santamaria-automations-google-search-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/santamaria-automations~google-search-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-santamaria-automations-google-search-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "queries": {
            "title": "Search Queries",
            "type": "array",
            "description": "Keywords or phrases to search on Google (one per line). Each runs as a separate search. Results across queries are returned in a single dataset.",
            "items": {
              "type": "string"
            }
          },
          "searchUrls": {
            "title": "Google Search URLs",
            "type": "array",
            "description": "Optional: paste Google search URLs directly (e.g. https://www.google.com/search?q=python+tutorial&gl=us). All filters in the URL are preserved.",
            "items": {
              "type": "string"
            }
          },
          "countryCode": {
            "title": "Country Code",
            "type": "string",
            "description": "ISO 3166-1 alpha-2 country code to localise the search (e.g. 'us', 'gb', 'de', 'au'). Determines which regional results Google returns.",
            "default": "us"
          },
          "languageCode": {
            "title": "Language Code",
            "type": "string",
            "description": "Language code for the SERP UI and results (e.g. 'en', 'de', 'fr', 'es'). Defaults to English.",
            "default": "en"
          },
          "serpLayout": {
            "title": "SERP Layout",
            "enum": [
              "basic",
              "full"
            ],
            "type": "string",
            "description": "basic (default): Google's lightweight HTML, real result URLs, organic results + related searches + AI Overview, one small fetch per page. full: Google's full layout, adds People Also Ask, featured snippet, total result count and ads, but result URLs are approximate (urlIsApproximate = true). Setting resultsPerPage above 10 also uses the full layout.",
            "default": "basic"
          },
          "resultsPerPage": {
            "title": "Results Per Page",
            "minimum": 10,
            "maximum": 100,
            "type": "integer",
            "description": "Number of results to request per page (10 to 100). Default 10 gives the richest output. The basic layout always returns 10 per page, so a value above 10 automatically uses the full layout (approximate URLs). Set to 100 if you want more results per request and don't mind a slimmer feature set.",
            "default": 10
          },
          "maxPagesPerQuery": {
            "title": "Max Pages Per Query",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "How many SERP pages to fetch per query. Increase to get more results (10 pages × 100 results = ~1,000 results per query).",
            "default": 1
          },
          "mobileResults": {
            "title": "Mobile Results",
            "type": "boolean",
            "description": "Use Google's mobile interface instead of desktop. Mobile SERPs sometimes show different result sets and ad placements.",
            "default": false
          },
          "forceExactMatch": {
            "title": "Force Exact Match",
            "type": "boolean",
            "description": "Wrap each query in quotes (\"...\") so Google only returns results containing the exact phrase. Equivalent to Google's verbatim mode.",
            "default": false
          },
          "includePeopleAlsoAsk": {
            "title": "Include People Also Ask",
            "type": "boolean",
            "description": "Extract the 'People Also Ask' questions shown on the first SERP page. Returned in the peopleAlsoAsk array of each page record.",
            "default": true
          },
          "includeRelatedSearches": {
            "title": "Include Related Searches",
            "type": "boolean",
            "description": "Extract related search suggestions from the bottom of the first SERP page. Returned in the relatedQueries array of each page record.",
            "default": true
          },
          "saveHtmlToKeyValueStore": {
            "title": "Save Raw HTML",
            "type": "boolean",
            "description": "Save the raw HTML of each SERP page to the default Key-Value Store. The output record will include a kvsHtmlUrl pointing at the saved file. Useful for debugging or extracting custom fields not parsed by the actor.",
            "default": false
          },
          "extractAds": {
            "title": "Extract Paid Results (Ads) Add-on",
            "type": "boolean",
            "description": "Enable paid-results extraction. Fetches the main page in Google's full layout (ads only render there), so organic URLs may be approximate; ads are parsed from that same response with no extra requests. Adds one billable ads-extraction-attempt event per SERP page ($1.50 per 1,000 pages). Recommended only on queries where ads matter (commerce, comparison, lead-gen).",
            "default": false
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}