{
  "openapi": "3.0.1",
  "info": {
    "title": "Google Lens API: Reverse Image Search & OCR",
    "description": "Google Lens API for reverse image search. Send image URLs, uploads or base64 and get one row per image: similar images with their pages and prices, exact matches, web results, and OCR text with word boxes and translation. Pay per search type you pick; images that fail are free.",
    "version": "0.1",
    "x-build-id": "Hycz7uS4jnXdsxXr8"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/mu0i~google-lens-api/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-mu0i-google-lens-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/mu0i~google-lens-api/runs": {
      "post": {
        "operationId": "runs-sync-mu0i-google-lens-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/mu0i~google-lens-api/run-sync": {
      "post": {
        "operationId": "run-sync-mu0i-google-lens-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",
        "properties": {
          "imageUrls": {
            "title": "Image URLs",
            "type": "array",
            "description": "Links to the images: JPEG, PNG, WebP, GIF, AVIF, TIFF or SVG, up to 20 MB each. The actor downloads each image itself, so a link only has to open without a login. Duplicate links are searched once.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "imagesBase64": {
            "title": "Images as base64",
            "type": "array",
            "description": "For API callers with local files: each entry is one image, raw base64 or a data URI (data:image/png;base64,…). No public link needed.",
            "items": {
              "type": "string"
            }
          },
          "imageKvsStores": {
            "title": "Your key-value stores",
            "type": "array",
            "description": "Stores on your Apify account with your images. Every image record in a chosen store is searched (found by file extension: .jpg, .png, .webp…), unless \"Key-value store records\" below names keys in it; then only those. Choose a store here before naming it below: Apify lets this actor read only the stores you choose here."
          },
          "imageKvsRecords": {
            "title": "Key-value store records",
            "type": "array",
            "description": "Single records to read. Each item is an object: { \"key\": \"photo.jpg\", \"storeId\": \"<store id or name>\" }; { \"storeId\": \"…\" } with no key reads every image record in that store. A store on your account must also be chosen in \"Your key-value stores\" above, or Apify won't let the actor read it. Leave storeId out to use this run's default store."
          },
          "searchTypes": {
            "title": "What to return",
            "type": "array",
            "description": "Each image is charged once, whatever you select. Visual matches, exact matches and web results are separate Google result tabs, so each one you add makes a run slower.",
            "items": {
              "type": "string",
              "enum": [
                "visual-match",
                "exact-match",
                "all",
                "products",
                "ocr",
                "translate-ocr",
                "ai-mode",
                "homework"
              ],
              "enumTitles": [
                "Visually similar images (with the pages they are on)",
                "Exact matches (pages with the same image)",
                "Web results about the image",
                "Products: the matches that show a price",
                "Text in the image, with word boxes (OCR)",
                "Text in the image, translated",
                "AI answers (not available: skipped, never charged)",
                "Homework help (not available: skipped, never charged)"
              ]
            },
            "default": [
              "visual-match"
            ]
          },
          "maxResultsPerImage": {
            "title": "Results per list",
            "minimum": 0,
            "type": "integer",
            "description": "Keep at most this many entries in each list, best first. Lens returns about 60 visual matches. Empty or 0 = all. It doesn't change the price."
          },
          "translateLanguage": {
            "title": "Translate to",
            "type": "string",
            "description": "Language code the text is translated into when \"translated\" is selected, e.g. en, de, pt-BR.",
            "default": "en"
          },
          "language": {
            "title": "Result language",
            "type": "string",
            "description": "Language code for Google's results, e.g. en, de, pt-BR. Leave empty for English."
          },
          "country": {
            "title": "Result country",
            "type": "string",
            "description": "Two-letter country code that results are localized for, e.g. US, GB, DE."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}