{
  "openapi": "3.0.1",
  "info": {
    "title": "Google Search SERP Scraper",
    "description": "Fast lightweight Google Search SERP scraper for organic rankings, AI Overviews, People Also Ask, Local 3-Pack, Knowledge Graph with UULE geo-targeting.",
    "version": "1.0",
    "x-build-id": "sewTujvJgaDOF3vPM"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/rexreus~google-serp-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-rexreus-google-serp-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/rexreus~google-serp-scraper/runs": {
      "post": {
        "operationId": "runs-sync-rexreus-google-serp-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/rexreus~google-serp-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-rexreus-google-serp-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",
        "required": [
          "queries"
        ],
        "properties": {
          "queries": {
            "title": "Search Queries",
            "uniqueItems": true,
            "type": "array",
            "description": "List of keywords or search queries to scrape from Google. Enter one keyword per line.",
            "items": {
              "type": "string"
            }
          },
          "maxPagesPerQuery": {
            "title": "Max Pages per Query",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Maximum number of pagination pages to crawl per search query (e.g., 1 page = results 1-10).",
            "default": 1
          },
          "resultsPerPage": {
            "title": "Results per Page",
            "minimum": 10,
            "maximum": 100,
            "type": "integer",
            "description": "Number of results requested per page from Google (&num parameter).",
            "default": 10
          },
          "countryCode": {
            "title": "Country Code (gl)",
            "type": "string",
            "description": "Two-letter country code for regional search ranking (e.g., 'us', 'uk', 'de', 'id').",
            "default": "us"
          },
          "languageCode": {
            "title": "Language Code (hl)",
            "type": "string",
            "description": "Language code for the search interface and results (e.g., 'en', 'es', 'de', 'id').",
            "default": "en"
          },
          "location": {
            "title": "Location Name (Auto UULE)",
            "type": "string",
            "description": "Enter any canonical city, state, or country name (e.g., 'New York, NY, USA' or 'Berlin, Germany'). The Actor automatically encodes it into Google's canonical Protobuf UULE token."
          },
          "locationUule": {
            "title": "Custom UULE Parameter",
            "type": "string",
            "description": "Optional pre-encoded Google UULE parameter. If left empty and Location Name is provided, this is computed automatically."
          },
          "outputMode": {
            "title": "Output Dataset Mode",
            "enum": [
              "ORGANIC_ITEMS",
              "SERP_QUERY_SUMMARY"
            ],
            "type": "string",
            "description": "Choose between flat 1-row-per-ranking for CSV/Sheets export or comprehensive 1-record-per-query JSON.",
            "default": "ORGANIC_ITEMS"
          },
          "device": {
            "title": "Device Emulation",
            "enum": [
              "desktop",
              "mobile"
            ],
            "type": "string",
            "description": "Emulate desktop or mobile browser headers and user-agent.",
            "default": "desktop"
          },
          "timeFilter": {
            "title": "Time Filter (tbs)",
            "enum": [
              "",
              "qdr:h",
              "qdr:d",
              "qdr:w",
              "qdr:m",
              "qdr:y"
            ],
            "type": "string",
            "description": "Filter results by publication date range.",
            "default": ""
          },
          "safeSearch": {
            "title": "SafeSearch",
            "type": "boolean",
            "description": "Enable Google SafeSearch filter.",
            "default": true
          },
          "extractAiOverview": {
            "title": "Extract AI Overview (SGE)",
            "type": "boolean",
            "description": "Capture AI Overview summary prose and cited source links when present on the SERP.",
            "default": true
          },
          "extractPeopleAlsoAsk": {
            "title": "Extract People Also Ask",
            "type": "boolean",
            "description": "Capture People Also Ask (PAA) questions, answers, and source URLs.",
            "default": true
          },
          "extractLocalPack": {
            "title": "Extract Local 3-Pack",
            "type": "boolean",
            "description": "Capture Google Maps Places local business results (name, rating, reviews, address, phone).",
            "default": true
          },
          "extractKnowledgeGraph": {
            "title": "Extract Knowledge Graph",
            "type": "boolean",
            "description": "Capture Knowledge Graph entity cards (title, subtitle, description, attributes).",
            "default": true
          },
          "extractRelatedSearches": {
            "title": "Extract Related Searches",
            "type": "boolean",
            "description": "Capture related keyword queries suggested at the bottom of the SERP.",
            "default": true
          },
          "proxyConfiguration": {
            "title": "Proxy Configuration",
            "type": "object",
            "description": "Proxy configuration. Default uses Apify Residential Proxies to reliably bypass Google rate-limiting."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}