{
  "openapi": "3.0.1",
  "info": {
    "title": "Google Lens OCR API: Image to Text and PDF OCR with Word Boxes",
    "description": "Turn images and multi-page PDFs into text with Google Lens OCR. Use image URLs, uploaded screenshots, Base64, or Apify storage, or call the Standby REST endpoint. Get word and line boxes, writing direction, translation, and a status per image. From $0.003 per image. Not affiliated with Google.",
    "version": "1.6",
    "x-build-id": "oq8JACccdxBOYi89M"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/getascraper~google-lens-ocr/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-getascraper-google-lens-ocr",
        "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/getascraper~google-lens-ocr/runs": {
      "post": {
        "operationId": "runs-sync-getascraper-google-lens-ocr",
        "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/getascraper~google-lens-ocr/run-sync": {
      "post": {
        "operationId": "run-sync-getascraper-google-lens-ocr",
        "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": {
          "imageUrl": {
            "title": "🔗 Image URL",
            "type": "string",
            "description": "Public HTTP or HTTPS URL of the image to run OCR on. This is all most runs need. Use imageUrlInputId to attach your own correlation ID."
          },
          "imageUrlInputId": {
            "title": "🏷️ Correlation ID",
            "type": "string",
            "description": "Optional correlation ID for imageUrl. If omitted, the Actor assigns the deterministic ID single-1.",
            "default": ""
          },
          "imageFile": {
            "title": "📤 Upload an image",
            "type": "string",
            "description": "Upload a screenshot, photo, or scan from your computer instead of hosting it online. Clear the Image URL field above if you only want the uploaded file processed. Its result row uses the ID upload-1.",
            "default": ""
          },
          "imageUrls": {
            "title": "📚 Bulk image URLs",
            "type": "array",
            "description": "Public image URLs. API callers can include userData.inputId on each URL object for correlation. Leave empty if you only need the single Image URL above.",
            "default": [],
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "imagesBase64": {
            "title": "🧬 Base64 images",
            "type": "array",
            "description": "JSON array of objects with data and an optional inputId. data can be raw Base64 or an image data URI.",
            "items": {
              "type": "object",
              "properties": {
                "inputId": {
                  "title": "Input ID",
                  "type": "string",
                  "description": "Optional correlation ID for this image.",
                  "editor": "textfield"
                },
                "data": {
                  "title": "Base64 image data",
                  "type": "string",
                  "description": "Raw Base64 or an image data URI.",
                  "editor": "textarea"
                }
              },
              "required": [
                "data"
              ]
            },
            "default": []
          },
          "imageKvsRecords": {
            "title": "🗄️ Apify storage images",
            "type": "array",
            "description": "JSON array of Apify key-value store records. Omit storeId to read from the run's default store. Records can contain binary image data, a Base64 string, or an object with a Base64 data field.",
            "items": {
              "type": "object",
              "properties": {
                "inputId": {
                  "title": "Input ID",
                  "type": "string",
                  "description": "Optional correlation ID for this image.",
                  "editor": "textfield"
                },
                "storeId": {
                  "title": "Store ID or name",
                  "type": "string",
                  "description": "Apify key-value store ID or name. Omit it for the run's default store.",
                  "editor": "textfield"
                },
                "key": {
                  "title": "Record key",
                  "type": "string",
                  "description": "Key of the stored image record.",
                  "editor": "textfield"
                }
              },
              "required": [
                "key"
              ]
            },
            "default": []
          },
          "pdfUrl": {
            "title": "📄 PDF URL",
            "type": "string",
            "description": "Public HTTP or HTTPS URL of a PDF. Every page is rasterized and run through OCR, producing one result row per page with its page number. Use maxPdfPages to cap how many pages are processed.",
            "default": ""
          },
          "pdfUrlInputId": {
            "title": "🏷️ PDF correlation ID",
            "type": "string",
            "description": "Optional correlation ID for pdfUrl. If omitted, the Actor assigns the deterministic ID pdf-single-1. Each page row appends -pN (for example pdf-single-1-p1).",
            "default": ""
          },
          "pdfUrls": {
            "title": "📚 Bulk PDF URLs",
            "type": "array",
            "description": "Public PDF URLs. API callers can include userData.inputId on each URL object for correlation. Leave empty if you only need the single PDF URL above.",
            "default": [],
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "maxPdfPages": {
            "title": "📑 Maximum PDF pages",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Most pages to process per PDF. Pages beyond this are skipped; each row still reports the PDF's true total page count. Keeps runs bounded in time and cost, since each page is one OCR call.",
            "default": 20
          },
          "outputDetail": {
            "title": "📐 Output detail",
            "enum": [
              "text_only",
              "lines",
              "full",
              "paragraphs",
              "words"
            ],
            "type": "string",
            "description": "Full (default) returns joined text and line boxes. Paragraphs also groups lines and reports writing direction (left-to-right, right-to-left, or top-to-bottom). Words adds every word's own real bounding box and rotation angle, roughly 9x more geometry data. Text only omits all geometry. Every box comes directly from Google; the Actor never estimates or interpolates one.",
            "default": "full"
          },
          "translateTo": {
            "title": "🌐 Translate extracted text",
            "type": "string",
            "description": "Optional language code such as es, de, ja, or pt-BR. Translation failures keep the OCR data and mark the row PARTIAL.",
            "default": ""
          },
          "maxConcurrency": {
            "title": "⚡ Maximum concurrency",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Number of images processed at once. Lower this for very large images or constrained memory.",
            "default": 3
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}