{
  "openapi": "3.0.1",
  "info": {
    "title": "Web Search API for AI Agents — Multi-Engine SERP API",
    "description": "Web search API for AI agents and RAG — multi-engine search across 34 sources returning clean JSON: web, images, videos, news, maps, science and files, plus full page text. A pay-per-result SERP API and a simple alternative to Tavily, Exa and Serper. No API key; batch up to 1,000 queries per run.",
    "version": "0.5",
    "x-build-id": "Eci0Igty1QTatCkv6"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/agentxpro~web-search-api/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-agentxpro-web-search-api",
        "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/agentxpro~web-search-api/runs": {
      "post": {
        "operationId": "runs-sync-agentxpro-web-search-api",
        "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/agentxpro~web-search-api/run-sync": {
      "post": {
        "operationId": "run-sync-agentxpro-web-search-api",
        "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": {
          "category": {
            "title": "Category (alias for mode)",
            "enum": [
              "general",
              "images",
              "videos",
              "news",
              "map",
              "music",
              "science",
              "files",
              "it"
            ],
            "type": "string",
            "description": "Alias for mode. If both mode and category are set, mode wins.",
            "default": "general"
          },
          "chunkSize": {
            "title": "Chunk size (read_page)",
            "minimum": 0,
            "maximum": 20000,
            "type": "integer",
            "description": "read_page mode: also split the returned page text into chunks of this many characters (a chunks array plus chunkCount on the same item) — ready to embed for RAG pipelines. 0 = no chunking.",
            "default": 0
          },
          "debug": {
            "title": "Debug info",
            "type": "boolean",
            "description": "If true, each output item includes a debug object with upstream engines tried, timings and raw content status.",
            "default": false
          },
          "engines": {
            "title": "Engines",
            "type": "array",
            "description": "Optional source allow-list, e.g. wikipedia, github, arxiv, bing, duckduckgo. Empty = all available sources.",
            "items": {
              "type": "string"
            }
          },
          "exactPhrase": {
            "title": "Exact phrase",
            "type": "string",
            "description": "Only results containing this exact phrase (applied to every query in the run)."
          },
          "excludeDomains": {
            "title": "Exclude domains",
            "type": "array",
            "description": "Never return results from these domains.",
            "items": {
              "type": "string"
            }
          },
          "excludeWords": {
            "title": "Exclude words",
            "type": "string",
            "description": "Words to exclude from every query in the run, separated by spaces (each becomes a -word operator)."
          },
          "filetype": {
            "title": "File type",
            "type": "string",
            "description": "Only results of this file type for every query in the run, for example pdf, docx or csv (files mode)."
          },
          "groupByQuery": {
            "title": "Group results by query",
            "type": "boolean",
            "description": "Return ONE dataset item per query whose results field holds all of that query’s results, instead of one item per result. Charges stay per result — only the shape changes. Convenient for LLM and RAG pipelines that process one query at a time.",
            "default": false
          },
          "includeDomains": {
            "title": "Include domains",
            "type": "array",
            "description": "Only return results from these domains.",
            "items": {
              "type": "string"
            }
          },
          "includeRawContent": {
            "title": "Include raw page content",
            "type": "boolean",
            "description": "Fetch the full text of each result page. Slower and billed per successful page read (page-read event).",
            "default": false
          },
          "intitle": {
            "title": "Title contains (intitle)",
            "type": "string",
            "description": "Only results with this word or phrase in the page title (applied to every query in the run)."
          },
          "inurl": {
            "title": "URL contains (inurl)",
            "type": "string",
            "description": "Only results with this word or phrase in the URL (applied to every query in the run)."
          },
          "language": {
            "title": "Language",
            "type": "string",
            "description": "Result language, e.g. en, ja, ko, de, fr, es, zh-CN.",
            "default": "en"
          },
          "maxChars": {
            "title": "Max characters per page read",
            "minimum": 500,
            "maximum": 20000,
            "type": "integer",
            "description": "For read_page mode and raw content. 500–20000.",
            "default": 4000
          },
          "maxConcurrency": {
            "title": "Max parallel queries",
            "minimum": 1,
            "maximum": 16,
            "type": "integer",
            "description": "How many queries to process in parallel inside the run. Higher is faster on big batches; results are always pushed in input order. Default 8.",
            "default": 8
          },
          "maxResults": {
            "title": "Max results per query",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "1–100 results per query. Default 5 keeps runs cheap and fast; higher values walk more result pages automatically.",
            "default": 5
          },
          "mode": {
            "title": "Mode",
            "enum": [
              "search",
              "images",
              "videos",
              "news",
              "maps",
              "science",
              "files",
              "read_page"
            ],
            "type": "string",
            "description": "Search type: search (web results), images, videos, news, maps, science, files, or read_page (fetch full page text for the urls[] instead; ignores queries).",
            "default": "search"
          },
          "pageFormat": {
            "title": "Page format (read_page)",
            "enum": [
              "text",
              "markdown",
              "html"
            ],
            "type": "string",
            "description": "read_page mode: the format of the returned page content — text (plain extracted text, default), markdown (Markdown, best for AI/RAG), or html (the raw page HTML)."
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Apify proxy configuration. Default in v1 is no proxy (direct); enable Apify datacenter proxies only if upstreams block direct requests.",
            "default": {
              "useApifyProxy": false
            }
          },
          "queries": {
            "title": "Search queries",
            "type": "array",
            "description": "1–1000 search queries per run. Batch many queries in one run — it is far cheaper than one run per query. Each query 1–500 chars; duplicates are removed (case-insensitive).",
            "items": {
              "type": "string"
            }
          },
          "region": {
            "title": "Region",
            "type": "string",
            "description": "Region hint, e.g. us, gb, de, jp, in. Passed through when the upstream supports it.",
            "default": "us"
          },
          "safeSearch": {
            "title": "Safe search",
            "type": "integer",
            "description": "0 = off, 1 = moderate, 2 = strict.",
            "default": 1
          },
          "site": {
            "title": "Site filter",
            "type": "string",
            "description": "Only results from this site for every query in the run, for example docs.python.org (a site: filter)."
          },
          "strictEngines": {
            "title": "Strict engines",
            "type": "boolean",
            "description": "If true, an unknown engine name fails that query with an error instead of silently falling back to all engines.",
            "default": false
          },
          "timeRange": {
            "title": "Time range",
            "enum": [
              "",
              "day",
              "week",
              "month",
              "year"
            ],
            "type": "string",
            "description": "Limit results by age. Empty = any time.",
            "default": ""
          },
          "urls": {
            "title": "URLs (read_page mode only)",
            "type": "array",
            "description": "Up to 100 public http/https URLs to fetch page text from when mode=read_page.",
            "items": {
              "type": "string"
            }
          },
          "agentContext": {
            "title": "AI agent context (agentContext)",
            "type": "boolean",
            "description": "Add an agentContext object to every delivered result: the result's content as clean text ready to paste into an LLM prompt (the full page content when raw content is included, otherwise title + snippet), a source block (type, URL, title), a ready-to-paste citation, the result's rank, an estimated token count and the retrieval time. Modelled on the response style AI-agent APIs use. Off by default; never changes charges.",
            "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
                  },
                  "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}