{
  "openapi": "3.0.1",
  "info": {
    "title": "Web Search API for AI Agents & RAG | Markdown | $1 / 1K pages",
    "description": "Web search API for AI agents and RAG: send a query, get the top result pages as clean Markdown with title, URL and snippet. DuckDuckGo with Brave and Yahoo fallback, no API key, no browser. $1 per 1,000 pages, failed pages free.",
    "version": "0.0",
    "x-build-id": "XB2bUcfcLuDmklXTn"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/hridayrungta~rag-web-search/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-hridayrungta-rag-web-search",
        "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/hridayrungta~rag-web-search/runs": {
      "post": {
        "operationId": "runs-sync-hridayrungta-rag-web-search",
        "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/hridayrungta~rag-web-search/run-sync": {
      "post": {
        "operationId": "run-sync-hridayrungta-rag-web-search",
        "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 or URLs",
            "type": "array",
            "description": "What to search for, one query per line (for example \"best vector database for RAG\"). A line that is a full URL (https://...) is fetched directly instead of searched. Up to 100 per run.",
            "items": {
              "type": "string"
            }
          },
          "maxResults": {
            "title": "Pages per query",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "How many top search results to open and return as Markdown for each query (1-20). In search-results-only mode, how many results to list.",
            "default": 3
          },
          "outputFormats": {
            "title": "Output formats",
            "type": "array",
            "description": "Which content fields to return for each page: Markdown (best for LLMs), plain text, and/or the cleaned main-content HTML.",
            "items": {
              "type": "string",
              "enum": [
                "markdown",
                "text",
                "html"
              ],
              "enumTitles": [
                "Markdown",
                "Plain text",
                "HTML (main content)"
              ]
            },
            "default": [
              "markdown"
            ]
          },
          "searchResultsOnly": {
            "title": "Search results only (no page content)",
            "type": "boolean",
            "description": "Return only the search results (rank, title, URL, snippet) without opening the pages. Billed per query instead of per page. Faster and cheaper when you only need links.",
            "default": false
          },
          "site": {
            "title": "Only search this website",
            "type": "string",
            "description": "Optional domain to restrict results to, for example docs.python.org. Added to every query as the site: operator."
          },
          "country": {
            "title": "Country / language of results",
            "enum": [
              "",
              "us",
              "gb",
              "ca",
              "au",
              "nz",
              "ie",
              "in",
              "sg",
              "za",
              "ph",
              "de",
              "at",
              "ch",
              "fr",
              "be",
              "es",
              "mx",
              "ar",
              "cl",
              "co",
              "it",
              "nl",
              "pt",
              "br",
              "pl",
              "se",
              "no",
              "dk",
              "fi",
              "tr",
              "ru",
              "ua",
              "jp",
              "kr",
              "cn",
              "tw",
              "hk",
              "id",
              "my",
              "vn",
              "th",
              "il",
              "gr",
              "cz",
              "hu",
              "ro",
              "sa"
            ],
            "type": "string",
            "description": "Region of the search results (also picks the result language). Applied by DuckDuckGo and Brave; the Yahoo fallback always searches the US index. Leave empty for no region.",
            "default": ""
          },
          "searchEngine": {
            "title": "Search engine",
            "enum": [
              "auto",
              "duckduckgo",
              "brave",
              "yahoo"
            ],
            "type": "string",
            "description": "Auto uses DuckDuckGo first and switches to Brave Search, then Yahoo, when an engine is rate limiting. Pick one engine to use only that one.",
            "default": "auto"
          },
          "replaceFailedPages": {
            "title": "Replace pages that cannot be read",
            "type": "boolean",
            "description": "If a top result cannot be read (blocked, needs JavaScript, error), open the next search result instead so you still get the number of pages you asked for. Failed pages are returned as free status rows either way.",
            "default": true
          },
          "requestTimeoutSecs": {
            "title": "Page timeout (seconds)",
            "minimum": 5,
            "maximum": 30,
            "type": "integer",
            "description": "Maximum time to wait for one page to download (5-30). Slow pages are returned as free timeout rows and, if enabled, replaced by the next result.",
            "default": 15
          },
          "maxCharactersPerPage": {
            "title": "Max characters per page",
            "minimum": 0,
            "maximum": 1000000,
            "type": "integer",
            "description": "Cut the Markdown / text / HTML of each page to this many characters to save LLM tokens (0 = no limit). Rows that were cut have truncated = true.",
            "default": 0
          },
          "includeImages": {
            "title": "Keep images in Markdown",
            "type": "boolean",
            "description": "Keep image links in the Markdown. Off by default because most LLM pipelines do not need them.",
            "default": false
          },
          "maxConcurrency": {
            "title": "Parallel page downloads",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "How many result pages to download at the same time (1-10).",
            "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
                  },
                  "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}