{
  "openapi": "3.0.1",
  "info": {
    "title": "Search & Read - Web Search Results with Page Content",
    "description": "Search the web for a batch of queries, pinned to a country and language, and read the top result pages as clean text and markdown. Shared URLs are fetched once. Failed or unread pages keep their search snippet with an explicit status.",
    "version": "0.0",
    "x-build-id": "pRHwkfVLuStF7vOsF"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/leadproof~search-and-read/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-leadproof-search-and-read",
        "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/leadproof~search-and-read/runs": {
      "post": {
        "operationId": "runs-sync-leadproof-search-and-read",
        "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/leadproof~search-and-read/run-sync": {
      "post": {
        "operationId": "run-sync-leadproof-search-and-read",
        "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": {
          "mode": {
            "title": "Mode",
            "enum": [
              "search",
              "urls"
            ],
            "type": "string",
            "description": "Search mode needs queries. URL mode needs urls and never runs a search.",
            "default": "search"
          },
          "queries": {
            "title": "Queries",
            "type": "array",
            "description": "Strings or objects {id, query, country, language}. Up to 200. Rows without an id get q1, q2, ... Identical queries keep their own ids; the search runs once and is shared."
          },
          "urls": {
            "title": "URLs (URL mode)",
            "type": "array",
            "description": "Strings or objects {id, url}. Up to 500 public http(s) URLs. Duplicate URLs are fetched once and returned once per row."
          },
          "country": {
            "title": "Country",
            "type": "string",
            "description": "Required in search mode (here or per query row). ISO 3166-1 alpha-2 code (KE, US, GB) or an English country name. Pins the search to that country."
          },
          "language": {
            "title": "Language",
            "type": "string",
            "description": "Required in search mode (here or per query row). Language tag such as en, sw or en-KE. Sets the search interface language and the Accept-Language of page reads."
          },
          "maxResultsPerQuery": {
            "title": "Search results per query",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Search results kept per query. Rank is one-based within the returned results.",
            "default": 5
          },
          "maxPagesPerQuery": {
            "title": "Pages to read per query",
            "minimum": 0,
            "maximum": 20,
            "type": "integer",
            "description": "Top results whose pages are read. Other results keep search metadata only, with page status skipped. 0 = search only.",
            "default": 5
          },
          "renderMode": {
            "title": "Render mode",
            "enum": [
              "http",
              "auto",
              "browser"
            ],
            "type": "string",
            "description": "http reads the served HTML only. browser renders every page in Chromium (slower, more memory). auto reads over HTTP and switches to the browser only when the page is a JavaScript shell, too thin or a bot challenge. Each page record says which mode was used (diagnostics.renderModeUsed).",
            "default": "http"
          },
          "contentScope": {
            "title": "Content scope",
            "enum": [
              "auto",
              "main",
              "page"
            ],
            "type": "string",
            "description": "Which part of the page becomes text and markdown. Use page when you need contact details that sit in headers and footers.",
            "default": "auto"
          },
          "browserConcurrency": {
            "title": "Browser pages in parallel",
            "minimum": 1,
            "maximum": 4,
            "type": "integer",
            "description": "Pages rendered in the browser at once (browser and auto modes). Give the run 2 GB or more for browser work.",
            "default": 2
          },
          "saveFailedSearchPages": {
            "title": "Save result pages of failed searches (diagnostics)",
            "type": "boolean",
            "description": "When the search engine page cannot be parsed (markup_changed, unrecognized_page), keep the raw page in this run's key-value store (DIAG-SERP-<query id>-<n>) so the parser can be fixed. Off by default.",
            "default": false
          },
          "includeHtml": {
            "title": "Include HTML",
            "type": "boolean",
            "description": "Add the page HTML (size bounded) to each page record. Off by default.",
            "default": false
          },
          "searchTimeoutSecs": {
            "title": "Search timeout (seconds)",
            "minimum": 5,
            "maximum": 120,
            "type": "integer",
            "description": "Per search attempt.",
            "default": 30
          },
          "pageTimeoutSecs": {
            "title": "Page timeout (seconds)",
            "minimum": 5,
            "maximum": 120,
            "type": "integer",
            "description": "Per page read attempt.",
            "default": 30
          },
          "searchConcurrency": {
            "title": "Searches in parallel",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Maximum searches running at once.",
            "default": 3
          },
          "pageConcurrency": {
            "title": "Page reads in parallel",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Maximum page reads running at once across all queries.",
            "default": 5
          },
          "maxRetries": {
            "title": "Retries",
            "minimum": 0,
            "maximum": 3,
            "type": "integer",
            "description": "Extra attempts for failures the search provider or reader marks retryable (timeouts, 429, 5xx). Never for 4xx, unsupported content or login walls.",
            "default": 1
          },
          "maxPagesTotal": {
            "title": "Maximum pages per run",
            "minimum": 1,
            "maximum": 2000,
            "type": "integer",
            "description": "Unique page reads per run. Results past the limit keep search metadata only.",
            "default": 200
          },
          "maxTotalMegabytes": {
            "title": "Maximum content per run (MB)",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "No new page read starts once this much text, markdown and HTML has been returned. Reads already running finish.",
            "default": 50
          },
          "maxPageKilobytes": {
            "title": "Maximum page size (KB)",
            "minimum": 50,
            "maximum": 10000,
            "type": "integer",
            "description": "Download limit per page, passed to the page reader.",
            "default": 2000
          },
          "maxRunSeconds": {
            "title": "Time limit (seconds)",
            "minimum": 30,
            "maximum": 3600,
            "type": "integer",
            "description": "At this limit no new work starts; finished results are returned and unfinished steps are marked skipped with deadline_exceeded. The run's own timeout is respected too.",
            "default": 900
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}