{
  "openapi": "3.0.1",
  "info": {
    "title": "Google Site Search API: Programmable Search Replacement",
    "description": "Queries and up to 50 sites in, Google CSE siterestrict JSON out. Change one base URL before the Jan 1, 2027 shutdown. $0.004 per results page.",
    "version": "1.0",
    "x-build-id": "CBKvnwxUdAyFzFRuy"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/apricot_blackberry~google-site-search-api/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-apricot_blackberry-google-site-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/apricot_blackberry~google-site-search-api/runs": {
      "post": {
        "operationId": "runs-sync-apricot_blackberry-google-site-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/apricot_blackberry~google-site-search-api/run-sync": {
      "post": {
        "operationId": "run-sync-apricot_blackberry-google-site-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",
        "required": [
          "queries"
        ],
        "properties": {
          "queries": {
            "title": "Queries",
            "minItems": 1,
            "maxItems": 500,
            "type": "array",
            "description": "Search terms to run against your site list, one per line (1 to 500, each up to 2048 characters). One dataset row per hit; each page of up to 10 results is one cse-query charge. Example: installation",
            "items": {
              "type": "string"
            }
          },
          "sites": {
            "title": "Sites",
            "maxItems": 50,
            "type": "array",
            "description": "Inline engine: up to 50 domains or domain/path* patterns to search; nothing is saved. Ignored when \"Save engine\" or \"Saved engine ID\" is set. Defaults to apify.com so a call with only queries works. Example: docs.apify.com or example.com/blog/*",
            "default": [
              "apify.com"
            ],
            "items": {
              "type": "string"
            }
          },
          "excludeSites": {
            "title": "Excluded sites",
            "maxItems": 20,
            "type": "array",
            "description": "Up to 20 domains or domain/path* patterns to drop from the results of an inline search. Example: example.com/shop/*",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "engine": {
            "title": "Save engine",
            "type": "object",
            "description": "Optional. Save a reusable engine (the replacement for a Google Programmable Search Engine cx id) as JSON {\"name\": string, \"sites\": string[] (1-50), \"excludeSites\": string[] (0-20)}. The run writes its engineId to the OUTPUT record; use it as cx on the Standby API or as engineId here. When set, sites is ignored. Example: {\"name\":\"Docs\",\"sites\":[\"docs.apify.com\",\"crawlee.dev/docs/*\"]}",
            "default": null
          },
          "engineId": {
            "title": "Saved engine ID",
            "type": "string",
            "description": "Optional. The 16-character engineId (cx) of an engine you saved earlier with \"Save engine\"; the cx_ prefix is optional. Engines are stored in your account in the key-value store cf-site-engines. Leave empty to use sites. Example: k3J9xQ2mL0aB7cDe",
            "default": ""
          },
          "maxResultsPerQuery": {
            "title": "Max results per query",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "How many results to return per query, an integer from 1 to 100. Results come 10 per page and every page is one cse-query charge ($0.004), plus fanout-subquery charges for engines with more than 10 sites. Example: 10",
            "default": 10
          },
          "gl": {
            "title": "Country",
            "type": "string",
            "description": "Two-letter country code (the CSE gl parameter) for the Google results. Example: us or de",
            "default": "us"
          },
          "hl": {
            "title": "Language",
            "type": "string",
            "description": "Interface language code (the CSE hl parameter) for the Google results. Example: en or pt-BR",
            "default": "en"
          },
          "safe": {
            "title": "SafeSearch",
            "enum": [
              "off",
              "active"
            ],
            "type": "string",
            "description": "Google SafeSearch level (the CSE safe parameter): off or active. Example: off",
            "default": "off"
          },
          "dateRestrict": {
            "title": "Date restrict",
            "type": "string",
            "description": "Only results from a recent period (the CSE dateRestrict parameter): d[number] days, w[number] weeks, m[number] months or y[number] years. Leave empty for any date. Example: m3 for the last 3 months",
            "default": ""
          },
          "fileType": {
            "title": "File type",
            "type": "string",
            "description": "Only results of one file type, as an extension without the dot (the CSE fileType parameter). Leave empty for all types. Example: pdf",
            "default": ""
          },
          "exactTerms": {
            "title": "Exact phrase",
            "type": "string",
            "description": "A phrase every result must contain, word for word (the CSE exactTerms parameter). Leave empty for none. Example: pay per event",
            "default": ""
          },
          "excludeTerms": {
            "title": "Exclude terms",
            "type": "string",
            "description": "Words that results must not contain, separated by spaces (the CSE excludeTerms parameter). Leave empty for none. Example: legacy deprecated",
            "default": ""
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}