{
  "openapi": "3.0.1",
  "info": {
    "title": "Custom Search API Replacement - Web Search JSON API",
    "description": "Custom Search API replacement: the same parameters (q, cx, num, start, gl, hl, lr, safe, dateRestrict, siteSearch) and the same JSON (items[], searchInformation, queries.nextPage) as the Google Custom Search JSON API. Batch runs or a live HTTP endpoint: change the base URL, keep your code.",
    "version": "0.1",
    "x-build-id": "jyLfIfBx0NWDjABYw"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrapewise~custom-search-api-replacement/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrapewise-custom-search-api-replacement",
        "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/scrapewise~custom-search-api-replacement/runs": {
      "post": {
        "operationId": "runs-sync-scrapewise-custom-search-api-replacement",
        "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/scrapewise~custom-search-api-replacement/run-sync": {
      "post": {
        "operationId": "run-sync-scrapewise-custom-search-api-replacement",
        "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": {
          "queries": {
            "title": "Search queries",
            "type": "array",
            "description": "One search per line. Plain terms (vector database comparison), search operators (site:, filetype:, quotes, -word) or a full old API request URL / query string (q=...&gl=de&num=5): its parameters are used and key and cx are ignored.",
            "items": {
              "type": "string"
            }
          },
          "pagesPerQuery": {
            "title": "Pages per query",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "How many results pages to fetch for each query (each page = num results, up to 10). Pages follow the start parameter: 1, 11, 21... Each page with results is one charge.",
            "default": 1
          },
          "outputFormat": {
            "title": "Output format",
            "enum": [
              "api",
              "results"
            ],
            "type": "string",
            "description": "api: each dataset item is the same JSON the old API returned (kind, queries, searchInformation, items). results: one row per result with query, position, title, link, displayLink, snippet and date.",
            "default": "api"
          },
          "num": {
            "title": "num",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Results per page, 1 to 10 (same limit as the old API).",
            "default": 10
          },
          "start": {
            "title": "start",
            "minimum": 1,
            "maximum": 91,
            "type": "integer",
            "description": "Index of the first result, 1 to 91 (start + num cannot pass 101).",
            "default": 1
          },
          "gl": {
            "title": "gl",
            "type": "string",
            "description": "Two-letter country code for the results, for example us, gb, de. Default us."
          },
          "hl": {
            "title": "hl",
            "type": "string",
            "description": "Interface language, for example en, de, fr. Default en."
          },
          "lr": {
            "title": "lr",
            "type": "string",
            "description": "Language restrict, as in the old API: lang_en, lang_de, lang_fr... Used when hl is empty."
          },
          "cr": {
            "title": "cr",
            "type": "string",
            "description": "Country restrict, as in the old API: countryUS, countryDE... Used when gl is empty."
          },
          "safe": {
            "title": "safe",
            "enum": [
              "off",
              "active"
            ],
            "type": "string",
            "description": "active filters explicit results.",
            "default": "off"
          },
          "dateRestrict": {
            "title": "dateRestrict",
            "type": "string",
            "description": "Only results from the last N days, weeks, months or years: d7, w2, m6, y1."
          },
          "siteSearch": {
            "title": "siteSearch",
            "type": "string",
            "description": "Restrict to (or exclude) a site, for example github.com. Several sites: separate with spaces."
          },
          "siteSearchFilter": {
            "title": "siteSearchFilter",
            "enum": [
              "i",
              "e"
            ],
            "type": "string",
            "description": "i = only siteSearch, e = everything except siteSearch. Default i."
          },
          "exactTerms": {
            "title": "exactTerms",
            "type": "string",
            "description": "A phrase every result must contain."
          },
          "excludeTerms": {
            "title": "excludeTerms",
            "type": "string",
            "description": "Words that must not appear, separated by spaces."
          },
          "orTerms": {
            "title": "orTerms",
            "type": "string",
            "description": "Extra words where at least one must appear, separated by spaces."
          },
          "fileType": {
            "title": "fileType",
            "type": "string",
            "description": "Only this file type, for example pdf."
          },
          "hq": {
            "title": "hq",
            "type": "string",
            "description": "Extra query terms appended to every search (the old hq parameter)."
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Apify Proxy by default. Change it only if you know you need to.",
            "default": {
              "useApifyProxy": true
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}