{
  "openapi": "3.0.1",
  "info": {
    "title": "Google AI Mode Scraper",
    "description": "Real Google AI Mode answers (udm=50 tab) rendered in Android Chrome, for any country and language: full answer, structured blocks, resolved source URLs and per-paragraph citations. From $0.0018 per answer ($0.003 on Free/Starter). Uncited answers are flagged; failed and empty queries are free.",
    "version": "0.2",
    "x-build-id": "gIU1utU3Zq4Xg3mJn"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/subimpact~google-ai-mode-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-subimpact-google-ai-mode-scraper",
        "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/subimpact~google-ai-mode-scraper/runs": {
      "post": {
        "operationId": "runs-sync-subimpact-google-ai-mode-scraper",
        "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/subimpact~google-ai-mode-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-subimpact-google-ai-mode-scraper",
        "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",
            "type": "array",
            "description": "Queries to get Google AI Mode answers for. Each query is run on the real AI Mode tab (udm=50) in a real Android Chrome browser.",
            "items": {
              "type": "string"
            }
          },
          "gl": {
            "title": "Country",
            "pattern": "^[A-Za-z]{2}$",
            "type": "string",
            "description": "Two-letter country code for the market whose AI Mode answers you want, e.g. ae (UAE), my (Malaysia), sg (Singapore), id (Indonesia), au (Australia), us. Works on both backends.",
            "default": "us"
          },
          "hl": {
            "title": "Language",
            "pattern": "^[A-Za-z]{2,3}(-[A-Za-z]{2,4})?$",
            "type": "string",
            "description": "Language code for Google's interface and answer, e.g. en, ar, ms, id, zh-CN. Write your queries in the same language. In markets where English is not the main search language (e.g. id, th) use the local language: English queries there often get generic/US answers.",
            "default": "en"
          },
          "location": {
            "title": "City / location (optional)",
            "type": "string",
            "description": "Google canonical location name, e.g. 'Dubai,Dubai,United Arab Emirates' or 'Kuala Lumpur,Federal Territory of Kuala Lumpur,Malaysia'. Leave empty to use the main city of the chosen country (Dubai, Kuala Lumpur, Singapore, Jakarta, Sydney, ...). Type none to send no location."
          },
          "skipCache": {
            "title": "Skip cache (always fetch fresh)",
            "type": "boolean",
            "description": "By default, a question that was answered for the same country, language and location in the last hour may be served from our cache (marked cached: true, with cached_at). Turn this on to always fetch a fresh answer from Google, for example when tracking how answers change. Fresh answers take longer under heavy load.",
            "default": false
          },
          "backend": {
            "title": "Backend",
            "enum": [
              "android",
              "http"
            ],
            "type": "string",
            "description": "android (default) = real AI Mode tab (udm=50) rendered in Android Chrome: full answer, structured blocks, resolved source URLs. http = legacy browserless SERP fetch (only returns AI answers Google embeds in the classic results page; uses gl/hl/location/udm50/retry options below).",
            "default": "android"
          },
          "concurrency": {
            "title": "Concurrency",
            "minimum": 1,
            "maximum": 30,
            "type": "integer",
            "description": "Parallel queries (1-30). On the android backend this is capped automatically to the size of the browser pool.",
            "default": 10
          },
          "udm50": {
            "title": "Force AI Mode tab (udm=50)",
            "type": "boolean",
            "description": "[legacy http backend only] Appends udm=50. NOTE: the forced shell currently returns no answer browserlessly (Google requires a real browser for the folwr stream) — defaults OFF.",
            "default": false
          },
          "retryDeferred": {
            "title": "Recover deferred AI Mode via folsrch",
            "type": "boolean",
            "description": "[legacy http backend only] When the answer is deferred, re-fetch through the folsrch async endpoint. ON by default (recovery rate ~90%).",
            "default": true
          },
          "retryDeferredMaxFetches": {
            "title": "Max folsrch recovery fetches",
            "minimum": 1,
            "maximum": 5,
            "type": "integer",
            "description": "[legacy http backend only] Upper bound on recovery fetches per query (1-5).",
            "default": 2
          },
          "captureRawHtml": {
            "title": "Save raw HTML",
            "type": "boolean",
            "description": "[legacy http backend only] Save raw SERP HTML to the key-value store for every query (for corpus/debugging). Adds storage cost.",
            "default": false
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}