{
  "openapi": "3.0.1",
  "info": {
    "title": "SERP API — Google Search, AI Overviews & Bulk Scraper",
    "description": "Scrape Google SERPs at scale — organic results, AI Overviews, Knowledge Graph, Answer Box, videos & People Also Ask. Bulk up to 100 queries per call for rank tracking and keyword research. Clean JSON, pay per query.",
    "version": "1.0",
    "x-build-id": "crKWjWirMhmcLJjcu"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/sian.agency~google-serp-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-sian.agency-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/sian.agency~google-serp-scraper/runs": {
      "post": {
        "operationId": "runs-sync-sian.agency-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/sian.agency~google-serp-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-sian.agency-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": [
          "operation"
        ],
        "properties": {
          "operation": {
            "title": "🎯 Operation — what do you want to scrape?",
            "enum": [
              "search",
              "searchFull",
              "searchLight",
              "bulkSearch",
              "aiMode",
              "peopleAlsoAsk"
            ],
            "type": "string",
            "description": "🎯 **PICK ONE OPERATION PER RUN.** Each run produces one clean dataset matching the chosen mode.\n\n- **🔍 Google Search** — organic results + AI Overviews flag + total result count, for one query\n- **🧩 Full SERP** — the whole page: organic, ads, Knowledge Graph, answer box, top stories, videos, places, People-Also-Ask blocks & related searches\n- **⚡ Fast Light Search** — fast organic-only results, lowest latency\n- **📚 Bulk Search** — submit up to **100 queries in one run**, charged one credit per query — built for rank tracking & keyword sweeps\n- **🤖 AI Mode** — Google's generative AI Mode answer + the reference links it cites\n- **❓ People Also Ask** — the PAA questions with full answers and source attribution\n\n💡 **TIP:** Use Bulk Search to track ranks for a whole keyword list in a single run.",
            "default": "search"
          },
          "query": {
            "title": "🔍 Search Query",
            "type": "string",
            "description": "🔍 **Required for `Google Search`, `Full SERP`, `Fast Light Search`, and `People Also Ask`.**\n\nA free-form Google search query — exactly what you would type into the Google search box.\n- `best web scraping tools`\n- `apify`\n- `how to track keyword rankings`\n\n💡 **TIP:** Use the `Country` and `Language` fields below to localize results.\n\n⚠️ **Ignored** for Bulk Search (use `Queries`) and AI Mode (use `Prompt`)."
          },
          "queries": {
            "title": "📚 Queries (for Bulk Search)",
            "uniqueItems": true,
            "type": "array",
            "description": "📚 **Required for `Bulk Search`.**\n\nUp to **100 search queries** processed in a single run — each query consumes one credit.\n\n💡 **BULK EDIT:** Click \"Bulk edit\" to paste one query per line.\n\nIdeal for tracking ranks across a keyword list or running a research sweep.\n\n⚠️ **Ignored** for all other operations.",
            "items": {
              "type": "string"
            }
          },
          "prompt": {
            "title": "🤖 Prompt (for AI Mode)",
            "type": "string",
            "description": "🤖 **Required for `AI Mode`.**\n\nThe natural-language prompt for Google's AI Mode — a question or instruction.\n- `What are the best open-source web scraping libraries?`\n- `Compare Apify and Scrapy for large crawls`\n\nReturns the generative answer plus the reference links Google cites.\n\n⚠️ **Ignored** for all other operations."
          },
          "country": {
            "title": "🌍 Country (gl)",
            "type": "string",
            "description": "🌍 ISO 3166-1 alpha-2 country code that localizes the search (e.g. `us`, `gb`, `ca`, `de`, `in`, `br`). Default `us`."
          },
          "language": {
            "title": "🗣️ Language (hl)",
            "type": "string",
            "description": "Optional. ISO 639 UI language code for results (e.g. `en`, `es`, `de`, `pt`). Default `en`."
          },
          "num": {
            "title": "🔢 Number of results",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Optional. How many organic results to request (per query). Applies to Google Search, Full SERP, Fast Light, and Bulk Search. Typical Google page = 10. Leave blank for the default."
          },
          "start": {
            "title": "↪️ Start offset",
            "minimum": 0,
            "type": "integer",
            "description": "Optional. Result offset for pagination (e.g. `10` to start at the 2nd page). Applies to Google Search and Full SERP."
          },
          "fetchAiOverviews": {
            "title": "✨ Fetch AI Overviews",
            "type": "boolean",
            "description": "Optional. When enabled, requests Google's AI Overview block for the query (Google Search & Full SERP). Adds latency but captures generative answers for GEO monitoring.",
            "default": false
          },
          "location": {
            "title": "📍 Location",
            "type": "string",
            "description": "Optional. A specific geographic location to search from (e.g. `New York, NY`, `London, United Kingdom`). Applies to Google Search, Full SERP, and People Also Ask."
          },
          "device": {
            "title": "📱 Device (for Google Search)",
            "enum": [
              "desktop",
              "mobile",
              "tablet"
            ],
            "type": "string",
            "description": "Optional. Device profile for the search.\n\n- `desktop` (default)\n- `mobile`\n- `tablet`",
            "default": "desktop"
          },
          "tbs": {
            "title": "🕓 Time / advanced filter (tbs)",
            "type": "string",
            "description": "Optional. Google `tbs` advanced search parameter — e.g. `qdr:d` (past day), `qdr:w` (past week), `qdr:m` (past month). Applies to Google Search and Full SERP."
          },
          "fetchAnswers": {
            "title": "💬 Fetch PAA answers",
            "type": "boolean",
            "description": "For `People Also Ask` — when enabled (default), returns the full answer text for each question (consumes an extra credit). Disable to get questions only.",
            "default": true
          },
          "sessionToken": {
            "title": "🔑 Session token (for AI Mode)",
            "type": "string",
            "description": "Optional. For `AI Mode` — pass a `sessionToken` from a previous AI Mode response to continue the same conversation thread."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}