{
  "openapi": "3.0.1",
  "info": {
    "title": "Google Custom Search API Alternative (Site Search)",
    "description": "Google is closing the Custom Search JSON API for existing customers on 1 Jan 2027. This is a drop-in replacement for searching your own sites: same /customsearch/v1 response format, so you only change the base URL. Pay per use (~$1.50 per 1,000 searches). Not affiliated with Google.",
    "version": "0.3",
    "x-build-id": "gYQc6HsaRfoCEBs54"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/cleandata-labs~site-search/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-cleandata-labs-site-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/cleandata-labs~site-search/runs": {
      "post": {
        "operationId": "runs-sync-cleandata-labs-site-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/cleandata-labs~site-search/run-sync": {
      "post": {
        "operationId": "run-sync-cleandata-labs-site-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",
        "properties": {
          "mode": {
            "title": "Mode",
            "enum": [
              "index",
              "search",
              "relevance"
            ],
            "type": "string",
            "description": "index = crawl your site and build or refresh the search index. search = run test queries against an existing index. relevance = run a list of test queries with the pages you expect, and get the rank of each expected page plus hit@1, hit@3, hit@10 and MRR (see relevanceTests). For live search from your app, use the Standby HTTP endpoint (see README); you don't need to start runs for that.",
            "default": "index"
          },
          "confirmOwnership": {
            "title": "I own these websites or am authorised to index them",
            "type": "boolean",
            "description": "Required for indexing. This Actor is for searching YOUR OWN sites (or sites you have written permission to index), like a site search box. It is not a web search engine and does not return Google results. Without this box ticked, the run is a free demo on built-in sample pages (nothing is crawled).",
            "default": false
          },
          "startUrls": {
            "title": "Your website URLs or sitemap URLs",
            "type": "array",
            "description": "Your site's home page or a section (e.g. https://docs.example.com/guide/), and/or a sitemap URL (https://example.com/sitemap.xml). Crawling stays on these domains, and a section URL keeps the crawl inside that section.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "indexName": {
            "title": "Index name (your cx)",
            "type": "string",
            "description": "Name of the index. Use it as cx in search requests. Letters, digits and dashes. Re-running index mode with the same name updates the index; searches keep working during the refresh. The index is stored in your account in a key-value store named site-search-<indexName>.",
            "default": "default"
          },
          "indexTitle": {
            "title": "Index title",
            "type": "string",
            "description": "Optional. Returned as context.title in search responses."
          },
          "maxPages": {
            "title": "Max pages to index",
            "minimum": 1,
            "maximum": 50000,
            "type": "integer",
            "description": "Stop after this many indexed pages. You pay per indexed page; skipped pages (noindex, robots.txt, errors, duplicates) are free.",
            "default": 200
          },
          "incremental": {
            "title": "Incremental re-index (only new or changed pages)",
            "type": "boolean",
            "description": "When an index with this name already exists, only new or changed pages are re-indexed (detected with the sitemap's lastmod, ETag / Last-Modified and a content hash). Unchanged pages are carried over at the lower 'unchanged page' price, and pages that now return 404/410 are removed. Turn off to force a full rebuild.",
            "default": true
          },
          "useSitemap": {
            "title": "Use the site's sitemap.xml",
            "type": "boolean",
            "description": "Also read the sitemaps listed in robots.txt (or /sitemap.xml) to find pages.",
            "default": true
          },
          "maxCrawlDepth": {
            "title": "Max link depth",
            "minimum": 0,
            "maximum": 50,
            "type": "integer",
            "description": "How many clicks away from the start URLs to follow links. 0 = only start URLs and sitemap pages.",
            "default": 5
          },
          "includeUrlGlobs": {
            "title": "Only index URLs matching",
            "type": "array",
            "description": "Optional glob patterns, e.g. https://example.com/docs/**. When set, they replace the default 'stay inside the start URL's section' rule.",
            "items": {
              "type": "string"
            }
          },
          "excludeUrlGlobs": {
            "title": "Never index URLs matching",
            "type": "array",
            "description": "Optional glob patterns, e.g. **/tag/** or **?page=*.",
            "items": {
              "type": "string"
            }
          },
          "additionalDomains": {
            "title": "Additional domains you own",
            "type": "array",
            "description": "Optional extra hostnames to follow links into (e.g. blog.example.com). Only add domains you own or may index.",
            "items": {
              "type": "string"
            }
          },
          "keepElementsCssSelector": {
            "title": "Index only this part of each page (CSS selector)",
            "type": "string",
            "description": "Optional, e.g. main, article or .docs-content. Default: automatic main-content detection."
          },
          "removeElementsCssSelector": {
            "title": "Remove these elements before indexing (CSS selector)",
            "type": "string",
            "description": "Optional, e.g. .cookie-banner, .sidebar"
          },
          "indexPdfs": {
            "title": "Index PDFs linked from the site",
            "type": "boolean",
            "description": "PDF text is indexed like a page (first 100 pages of each PDF).",
            "default": true
          },
          "respectRobotsTxt": {
            "title": "Respect robots.txt",
            "type": "boolean",
            "description": "Keep this on. Turn it off only for your own site when robots.txt blocks crawlers you want to allow. Pages with a noindex meta tag are always skipped.",
            "default": true
          },
          "maxConcurrency": {
            "title": "Parallel requests",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "How many pages to fetch at the same time. Lower it if your server is small.",
            "default": 6
          },
          "requestTimeoutSecs": {
            "title": "Request timeout (seconds)",
            "minimum": 5,
            "maximum": 120,
            "type": "integer",
            "description": "Per-page timeout.",
            "default": 30
          },
          "customHttpHeaders": {
            "title": "Custom HTTP headers",
            "type": "object",
            "description": "Optional headers sent with every request to your site, e.g. a header your firewall uses to allow this crawler."
          },
          "q": {
            "title": "Query (search mode)",
            "type": "string",
            "description": "Search mode only. Same syntax as before: words, \"exact phrase\", -exclude, OR, site:docs.example.com/api"
          },
          "queries": {
            "title": "More queries (search mode)",
            "type": "array",
            "description": "Search mode only. Each query is charged as one search.",
            "items": {
              "type": "string"
            }
          },
          "num": {
            "title": "Results per query (1-10)",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Search mode only. (Relevance mode always checks the top 10.)",
            "default": 10
          },
          "start": {
            "title": "First result (start)",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Search mode only. 1-based, like the original API.",
            "default": 1
          },
          "siteSearch": {
            "title": "Restrict to site/section (siteSearch)",
            "type": "string",
            "description": "Search and relevance mode, e.g. docs.example.com/api"
          },
          "lr": {
            "title": "Language (lr)",
            "type": "string",
            "description": "Search and relevance mode, e.g. lang_en (uses the page's lang attribute)."
          },
          "relevanceTests": {
            "title": "Relevance tests (relevance mode)",
            "type": "array",
            "description": "Relevance mode only. A list of test queries, each with one or more expected URLs or URL prefixes, e.g. [{\"query\": \"reset password\", \"expected\": [\"https://docs.example.com/account/reset-password/\"]}]. A result matches when its URL starts with an expected value (http/https, www. and #fragments are ignored; a value starting with / matches that path on any host). Each test query is searched once (top 10 results) and charged as one search. Results: one dataset row per query (rank or not found) and a summary with hit@1, hit@3, hit@10, MRR and the failed queries in the RELEVANCE_REPORT record of the run's key-value store. siteSearch and lr above are applied to every test query. Max 1,000 tests per run."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}