{
  "openapi": "3.0.1",
  "info": {
    "title": "Google Search Results (SERP) Scraper - SERP API",
    "description": "Scrape Google Search results with 95%+ health rate. Extract organic results, featured snippets, People Also Ask, Knowledge Graph, related searches & ads. 28% cheaper than alternatives. Export data, run via API, schedule and monitor runs, or integrate with other tools.",
    "version": "1.0",
    "x-build-id": "OrnUCgS1BU7k3JzZF"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/khadinakbar~scrape-google-serp/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-khadinakbar-scrape-google-serp",
        "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/khadinakbar~scrape-google-serp/runs": {
      "post": {
        "operationId": "runs-sync-khadinakbar-scrape-google-serp",
        "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/khadinakbar~scrape-google-serp/run-sync": {
      "post": {
        "operationId": "run-sync-khadinakbar-scrape-google-serp",
        "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": "Use this field when the user provides keywords or search terms. Enter one or more queries — each is scraped separately, one result record per page. Do NOT use this when the user provides a direct Google search URL — use startUrls for that.",
            "default": [
              "apify web scraping"
            ],
            "items": {
              "type": "string"
            }
          },
          "startUrls": {
            "title": "Direct Google Search URLs",
            "type": "array",
            "description": "Use this field when the user provides a specific Google search URL (e.g. https://www.google.com/search?q=...). Country/language settings are embedded in the URL itself. Do NOT use this for plain keyword queries — use queries instead.",
            "default": [],
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "maxResultsPages": {
            "title": "Max Result Pages Per Query",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "How many pages of Google results to scrape per query. Each page = 10 organic results (default). 1 = positions 1–10, 3 = positions 1–30, 10 = positions 1–100. Each page = 1 billing event.",
            "default": 1
          },
          "resultsPerPage": {
            "title": "Results Per Page",
            "minimum": 10,
            "maximum": 100,
            "type": "integer",
            "description": "Number of organic results per page. Google default is 10. Increase for more results per billing event (up to 100). Recommended values: 10, 20, 30, 50, 100.",
            "default": 10
          },
          "countryCode": {
            "title": "Country Code (gl)",
            "maxLength": 5,
            "type": "string",
            "description": "Google country targeting. Controls which regional Google index is queried. Examples: US, GB, DE, FR, AU, CA, IN, BR, JP, MX. Leave empty for global results.",
            "default": "US"
          },
          "languageCode": {
            "title": "Language Code (hl)",
            "maxLength": 10,
            "type": "string",
            "description": "Google interface and results language. Examples: en, es, de, fr, pt, ja, zh-CN, ar, ru. Controls Google UI language and biases results toward that language.",
            "default": "en"
          },
          "includeAds": {
            "title": "Extract Ad Results",
            "type": "boolean",
            "description": "Extract paid Google Ads appearing at the top and bottom of results pages. Results stored in the ad_results array field.",
            "default": true
          },
          "includeFeaturedSnippet": {
            "title": "Extract Featured Snippet",
            "type": "boolean",
            "description": "Extract the featured snippet (answer box / Position 0) when present on the SERP. Stored in the featured_snippet field.",
            "default": true
          },
          "includePeopleAlsoAsk": {
            "title": "Extract People Also Ask",
            "type": "boolean",
            "description": "Extract the 'People Also Ask' questions section. Useful for content research, FAQ generation, and topic clustering. Stored in the people_also_ask array.",
            "default": true
          },
          "includeRelatedSearches": {
            "title": "Extract Related Searches",
            "type": "boolean",
            "description": "Extract related search suggestions from the bottom of the SERP. Excellent for keyword research and topic mapping. Stored in the related_searches array.",
            "default": true
          },
          "includeKnowledgeGraph": {
            "title": "Extract Knowledge Graph",
            "type": "boolean",
            "description": "Extract the Knowledge Graph panel (entity info box) when present. Contains entity title, type, description, and official website. Stored in the knowledge_graph field.",
            "default": true
          },
          "maxConcurrency": {
            "title": "Max Concurrent Requests",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Number of parallel requests sent to Google. Higher = faster but more likely to trigger rate limits. Recommended: 5 for standard use, 2–3 if experiencing blocks.",
            "default": 5
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}