{
  "openapi": "3.0.1",
  "info": {
    "title": "Web Search Scraper - SERP Results, News & Page Markdown",
    "description": "Search the web or news for any query in 44 countries and get titles, URLs, snippets and dates, plus the top pages as clean Markdown for AI agents and RAG. Pay per result.",
    "version": "1.0",
    "x-build-id": "WrwF3M1vRjJA6l3ra"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/extraordinary_grasshopper~web-search-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-extraordinary_grasshopper-web-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/extraordinary_grasshopper~web-search-scraper/runs": {
      "post": {
        "operationId": "runs-sync-extraordinary_grasshopper-web-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/extraordinary_grasshopper~web-search-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-extraordinary_grasshopper-web-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",
        "required": [
          "queries"
        ],
        "properties": {
          "queries": {
            "title": "Search queries",
            "type": "array",
            "description": "What to search for, one query per line (max 400 characters each). Operators such as site:, \"exact phrase\" and -exclude work.",
            "items": {
              "type": "string"
            }
          },
          "mode": {
            "title": "Search type",
            "enum": [
              "web",
              "news"
            ],
            "type": "string",
            "description": "Web results (organic links with snippets) or news articles (title, source, date, image).",
            "default": "web"
          },
          "country": {
            "title": "Country / language",
            "enum": [
              "all",
              "us",
              "gb",
              "ca",
              "au",
              "nz",
              "ie",
              "in",
              "sg",
              "ph",
              "my",
              "za",
              "de",
              "at",
              "ch",
              "fr",
              "be",
              "es",
              "mx",
              "ar",
              "cl",
              "co",
              "it",
              "nl",
              "pt",
              "br",
              "pl",
              "se",
              "no",
              "dk",
              "fi",
              "ru",
              "ua",
              "tr",
              "jp",
              "kr",
              "tw",
              "hk",
              "cn",
              "vn",
              "th",
              "id",
              "il",
              "sa",
              "ae"
            ],
            "type": "string",
            "description": "Local results and language for this country. Worldwide gives global web results; news uses the US edition.",
            "default": "all"
          },
          "timeRange": {
            "title": "Time range",
            "enum": [
              "any",
              "hour",
              "day",
              "week",
              "month",
              "year"
            ],
            "type": "string",
            "description": "Only results from this recent period. Past hour works for news (web uses past 24 hours), past year works for web (news uses any time).",
            "default": "any"
          },
          "maxPagesPerQuery": {
            "title": "Max result pages per query",
            "minimum": 1,
            "maximum": 5,
            "type": "integer",
            "description": "Web results only. About 10 results per page, up to 5 pages per query. Stops early when there are no more results.",
            "default": 1
          },
          "maxNewsPerQuery": {
            "title": "Max news articles per query",
            "minimum": 1,
            "maximum": 30,
            "type": "integer",
            "description": "News only. Up to 30 articles per query.",
            "default": 20
          },
          "readTopResults": {
            "title": "Read top results as Markdown",
            "minimum": 0,
            "maximum": 5,
            "type": "integer",
            "description": "Web results only. Also open the top 1-5 results of each query and add their main content as clean Markdown or text (charged as page read instead of search result). 0 = off.",
            "default": 0
          },
          "contentFormat": {
            "title": "Content format",
            "enum": [
              "markdown",
              "text"
            ],
            "type": "string",
            "description": "Format of the page content when reading top results.",
            "default": "markdown"
          },
          "maxContentChars": {
            "title": "Max characters per page",
            "minimum": 500,
            "maximum": 50000,
            "type": "integer",
            "description": "Cut each page's content at this many characters (500-50,000).",
            "default": 8000
          },
          "safeSearch": {
            "title": "Safe search",
            "enum": [
              "moderate",
              "strict",
              "off"
            ],
            "type": "string",
            "description": "Adult content filter for web results.",
            "default": "moderate"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}