{
  "openapi": "3.0.1",
  "info": {
    "title": "OCR Image to Text API: Private, with Translation",
    "description": "Extract text from images with private OCR: your images and their English translation stay inside the run, never sent to an outside service. Get words, lines and paragraphs with confidence scores and boxes, image size and detected language. Send URLs, base64, a dataset or a key-value store.",
    "version": "0.1",
    "x-build-id": "a6ememwWbeiGzMLbh"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/pradio~image-text/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-pradio-image-text",
        "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/pradio~image-text/runs": {
      "post": {
        "operationId": "runs-sync-pradio-image-text",
        "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/pradio~image-text/run-sync": {
      "post": {
        "operationId": "run-sync-pradio-image-text",
        "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": {
          "image_urls": {
            "title": "Image URLs",
            "type": "array",
            "description": "Public http(s) image URLs to OCR, one data row each, no login or proxy. No page is read for the image and no link followed. An unreadable entry is an uncharged status row naming it. You need the right to read every image you list. Leave empty when sending through base64Images or a key-value store.",
            "items": {
              "type": "string"
            }
          },
          "base64Images": {
            "title": "Images as base64",
            "type": "array",
            "description": "Images as base64 for files that are not online: objects {\"name\": \"receipt-01.png\", \"data\": \"<base64 or data: URI>\"}; the name is echoed as image_name. Invalid data is an uncharged bad_input row. Large files go through a key-value store (the input itself is size-limited).",
            "default": []
          },
          "keyValueStoreId": {
            "title": "Key-value store",
            "type": "string",
            "description": "One of your key-value stores holding the images to read, by ID or name — pick it so the run gets read access. Records are named in keyValueStoreRecords."
          },
          "keyValueStoreRecords": {
            "title": "Key-value store records",
            "type": "array",
            "description": "The record keys to read, one per line. Each holds an image file (PNG, JPEG, GIF, BMP, WebP, TIFF) or base64 text; a missing key is an uncharged not_found row naming it.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "datasetId": {
            "title": "Dataset of image URLs",
            "type": "string",
            "description": "One of your datasets whose items hold image URLs (a scraper's product photos, say), by ID or name — pick it for read access. One image per item, or per URL in a list field; an item with no URL is an uncharged bad_input row."
          },
          "datasetUrlField": {
            "title": "Image URL field in the dataset",
            "type": "string",
            "description": "The item field holding the image URL or URL list; a dotted path like media.images reads a nested field. Empty: the first of image_url, imageUrl, image, url, src the items carry."
          },
          "ocr_language": {
            "title": "OCR language",
            "type": "string",
            "description": "Empty or auto: the language is detected per image (English and Chinese with PaddleOCR; another Latin-alphabet language gets a second Tesseract pass in it; a Cyrillic page is read again in Russian). Or force one: two-letter codes like en or de, joined with + for mixed-language images."
          },
          "preprocess": {
            "title": "Preprocessing",
            "enum": [
              "none",
              "enhance",
              "binarize"
            ],
            "type": "string",
            "description": "Optional image work before OCR — runs on the normalised PNG both engines read, so PaddleOCR and Tesseract benefit alike. enhance for faint or low-contrast scans; binarize for dirty or colored backgrounds.",
            "default": "none"
          },
          "pageSegmentation": {
            "title": "Page segmentation",
            "enum": [
              "auto",
              "single_column",
              "single_block",
              "single_line",
              "sparse"
            ],
            "type": "string",
            "description": "How Tesseract segments the page, when the read goes to Tesseract (any language outside English and Chinese). PaddleOCR does its own detection and ignores this setting.",
            "default": "auto"
          },
          "outputDetail": {
            "title": "Output detail",
            "enum": [
              "full",
              "lines",
              "text"
            ],
            "type": "string",
            "description": "How much layout each row carries: full (default) returns words, lines and paragraphs with boxes; lines drops the per-word list; text returns full text and counts only.",
            "default": "full"
          },
          "translateTo": {
            "title": "Translate to",
            "enum": [
              "en"
            ],
            "type": "string",
            "description": "Empty: no translation. Set to en to add a machine English translation of each image's text (German, French, Spanish, Italian, Dutch, Polish, Russian, Chinese detected). Runs inside the Actor — no outside service, no extra charge; translation_note says it is machine-made."
          },
          "minConfidence": {
            "title": "Minimum confidence",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Drop words, lines and paragraphs scoring under this confidence (0-100, default 0 keeps everything). The row's own confidence, detected language and verdict still cover everything read. A good first value is 70.",
            "default": 0
          },
          "maxItems": {
            "title": "Maximum items",
            "minimum": 1,
            "maximum": 250,
            "type": "integer",
            "description": "The most rows one run returns (default 100). Entries past the cap come back as named, free not_reached rows.",
            "default": 100
          },
          "maxMegabytesPerImage": {
            "title": "Maximum megabytes per image",
            "minimum": 1,
            "maximum": 40,
            "type": "integer",
            "description": "The most megabytes one image may declare before it is read (1-40, default 40); an image over the cap is an uncharged bad_input row naming it.",
            "default": 40
          },
          "dryRun": {
            "title": "Check only (free)",
            "type": "boolean",
            "description": "Probe every entry without reading it — a HEAD request per URL, the same decode per record. Nothing OCR'd, nothing billed; each entry gets a free row with the status a real read would emit. Off by default.",
            "default": false
          },
          "seenDatasetId": {
            "title": "Skip images a previous run read",
            "type": "string",
            "description": "A previous run's dataset, by ID or URL. An entry already read there returns on a free row saying it was skipped — not read again, not billed; entries it missed or never reached are read as usual."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}