{
  "openapi": "3.0.1",
  "info": {
    "title": "Google Search Results Scraper (SERP) Pro",
    "description": "Scrape Google Search results at scale: organic results, ads, People Also Ask, related queries, featured snippets, knowledge panel, top stories and AI overview. Export JSON, CSV or Excel.",
    "version": "0.1",
    "x-build-id": "ZgEmN6NnAR5kz8aWf"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrapers_lat~google-search-scraper-pro/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrapers_lat-google-search-scraper-pro",
        "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/scrapers_lat~google-search-scraper-pro/runs": {
      "post": {
        "operationId": "runs-sync-scrapers_lat-google-search-scraper-pro",
        "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/scrapers_lat~google-search-scraper-pro/run-sync": {
      "post": {
        "operationId": "run-sync-scrapers_lat-google-search-scraper-pro",
        "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 or URLs",
            "type": "array",
            "description": "One or more Google search terms, or full Google search URLs. Each item is searched separately. Advanced operators (site:, intitle:, OR, quotes, filetype:) are passed through.",
            "items": {
              "type": "string"
            }
          },
          "resultsPerPage": {
            "title": "Results per page",
            "minimum": 10,
            "maximum": 100,
            "type": "integer",
            "description": "How many results Google returns per page (the num parameter, 10 to 100). One dataset item is produced per page.",
            "default": 10
          },
          "maxPagesPerQuery": {
            "title": "Max pages per query",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "How many result pages (pagination depth) to fetch for each query. Each page is one billable result item.",
            "default": 1
          },
          "countryCode": {
            "title": "Country code (gl)",
            "type": "string",
            "description": "Two-letter country to search from, e.g. us, gb, es, de, br. Sets Google's gl parameter and matches the residential proxy country.",
            "default": "us"
          },
          "languageCode": {
            "title": "Language code (hl)",
            "type": "string",
            "description": "Two-letter interface language, e.g. en, es, de, fr, pt. Sets Google's hl parameter.",
            "default": "en"
          },
          "searchLanguage": {
            "title": "Restrict results to language (lr)",
            "type": "string",
            "description": "Optional. Restrict results to a language, e.g. en, es. Sets Google's lr=lang_XX parameter."
          },
          "location": {
            "title": "Location (plain text)",
            "type": "string",
            "description": "Optional local-search location, e.g. \"New York,New York,United States\". Encoded to a UULE parameter automatically. Ignored if locationUule is set."
          },
          "locationUule": {
            "title": "Location UULE",
            "type": "string",
            "description": "Optional pre-encoded Google UULE string for exact local search. Overrides the plain location field."
          },
          "searchType": {
            "title": "Search type",
            "enum": [
              "web",
              "news",
              "shopping",
              "images"
            ],
            "type": "string",
            "description": "Which Google vertical to scrape: web, news, shopping or images.",
            "default": "web"
          },
          "mobileResults": {
            "title": "Mobile results",
            "type": "boolean",
            "description": "Fetch the mobile version of the SERP (mobile user agent and layout) instead of desktop.",
            "default": false
          },
          "site": {
            "title": "Limit to site / domain",
            "type": "string",
            "description": "Optional. Restrict every query to one domain (adds site:<domain> to the query), e.g. wikipedia.org."
          },
          "relatedToSite": {
            "title": "Related to site",
            "type": "string",
            "description": "Optional. Find pages related to a domain (adds related:<domain>), e.g. nytimes.com. Useful for link prospecting and competitor discovery."
          },
          "fileType": {
            "title": "File type",
            "type": "string",
            "description": "Optional. Restrict to a file format (adds filetype:<ext>), e.g. pdf, doc, xls."
          },
          "wordsInTitle": {
            "title": "Words in title",
            "type": "string",
            "description": "Optional. Require these words in the page title (adds allintitle:<words>)."
          },
          "countryRestrict": {
            "title": "Restrict results to country (cr)",
            "type": "string",
            "description": "Optional two-letter country to restrict results by country of origin (Google cr=countryXX), e.g. us, gb. Different from countryCode, which sets where you search from."
          },
          "beforeDate": {
            "title": "Before date",
            "type": "string",
            "description": "Optional. Only results published on or before this date (YYYY-MM-DD). Uses Google's custom date range."
          },
          "afterDate": {
            "title": "After date",
            "type": "string",
            "description": "Optional. Only results published on or after this date (YYYY-MM-DD). Uses Google's custom date range."
          },
          "tbs": {
            "title": "Raw tbs parameter (advanced)",
            "type": "string",
            "description": "Optional advanced Google tbs value passed through as-is (e.g. qdr:w, li:1). Overrides timeRange, beforeDate and afterDate when set."
          },
          "saveHtml": {
            "title": "Save HTML snapshot",
            "type": "boolean",
            "description": "Store the raw HTML of each results page to the run's key-value store and return its URL in htmlSnapshotUrl. Useful for debugging or custom parsing.",
            "default": false
          },
          "timeRange": {
            "title": "Time range",
            "enum": [
              "any time",
              "past hour",
              "past day",
              "past week",
              "past month",
              "past year"
            ],
            "type": "string",
            "description": "Restrict results by recency (Google tbs=qdr).",
            "default": "any time"
          },
          "forceExactMatch": {
            "title": "Force exact match",
            "type": "boolean",
            "description": "Wrap each query in quotes so Google matches the exact phrase.",
            "default": false
          },
          "safeSearch": {
            "title": "Safe search",
            "type": "boolean",
            "description": "Enable Google SafeSearch filtering (safe=active).",
            "default": false
          },
          "includeUnfilteredResults": {
            "title": "Include unfiltered results",
            "type": "boolean",
            "description": "Include lower-quality results Google normally omits (filter=0).",
            "default": false
          },
          "aiSerpIntelligence": {
            "title": "Add-on: AI SERP intelligence",
            "type": "boolean",
            "description": "Optional paid add-on (off by default, paying accounts only). For each page, an AI model reads the organic results, PAA and snippet and returns search intent, a synthesized answer, top entities, content gaps and suggested article titles. Charged only when the AI returns usable output.",
            "default": false
          },
          "expandPaa": {
            "title": "Add-on: Expand People Also Ask",
            "type": "boolean",
            "description": "Optional paid add-on (off by default, paying accounts only). Runs extra searches to fetch full answers for the top People Also Ask questions. Charged only when real expanded answers are returned.",
            "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}