{
  "openapi": "3.0.1",
  "info": {
    "title": "OCR Image to Text API: Words, Boxes, Confidence",
    "description": "Extract text from images with OCR: paste image URLs, send base64 files, or read key-value store records. Each image returns its full text, words, lines and paragraphs with bounding boxes, confidence scores and the detected language. Images that fail to load are free; one with no text is billed.",
    "version": "0.1",
    "x-build-id": "bHCdY6c8QT6UfuheP"
  },
  "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": "The public http(s) image URLs this run reads. Each entry is fetched and read with OCR into one data row; an entry that cannot be read becomes an uncharged status row naming the miss. Leave it empty when you send images through base64Images or a key-value store instead.",
            "items": {
              "type": "string"
            }
          },
          "language": {
            "title": "Language",
            "type": "string",
            "description": "The language code the OCR reads in (eng when left empty; English and Chinese are read with PaddleOCR, other languages with Tesseract). Two-letter codes like en or de are mapped for you, and codes joined with + read mixed-language images. A code the engine cannot load fails the run's entries and says so."
          },
          "base64Images": {
            "title": "Images as base64",
            "type": "array",
            "description": "Images sent inside the input itself, for files that are not online. Each entry is an object with a name and the image's base64 data, bare or as a data: URI, for example {\"name\": \"receipt-01.png\", \"data\": \"<the file in base64>\"}. The name is echoed on the row as image_name. An entry that is not valid base64 image data becomes an uncharged bad_input row naming it. The whole input is size-limited by the platform, so send large files through a key-value store.",
            "default": []
          },
          "keyValueStoreId": {
            "title": "Key-value store",
            "type": "string",
            "description": "One of your key-value stores holding the images to read, by its ID or name. Pick it here so the run is given read access to it. Records are named in keyValueStoreRecords."
          },
          "keyValueStoreRecords": {
            "title": "Key-value store records",
            "type": "array",
            "description": "The record keys to read from the key-value store above, one per line. Each record should hold an image file (PNG, JPEG, GIF, BMP, WebP or TIFF) or its base64 text. A key the store does not hold becomes an uncharged not_found row naming it.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "outputDetail": {
            "title": "Output detail",
            "enum": [
              "full",
              "lines",
              "text"
            ],
            "type": "string",
            "description": "How much layout each row carries. full (the default) returns words, lines and paragraphs with their boxes; lines drops the per-word list, the largest part of a row; text returns the full text and the counts only, with words, lines and paragraphs set to null.",
            "default": "full"
          },
          "translateTo": {
            "title": "Translate to",
            "enum": [
              "en"
            ],
            "type": "string",
            "description": "Leave empty to skip translation. Set to en to add an English machine translation of each image's text in the translation field. The text's language is detected from what was read, and German, French, Spanish, Italian, Dutch, Polish, Russian and Chinese are translated. Text already in English, or in another language, is left untranslated and translation_note says why. Translation runs inside the Actor: no outside service sees your text, and there is no extra charge."
          },
          "maxItems": {
            "title": "Maximum items",
            "minimum": 1,
            "type": "integer",
            "description": "The most rows one run returns (default 100). Entries past the cap are dropped before pushing or charging, and the run's summary shows what was left out.",
            "default": 100
          },
          "maxMegabytesPerImage": {
            "title": "Maximum megabytes per image",
            "minimum": 1,
            "maximum": 40,
            "type": "integer",
            "description": "The most megabytes one image may declare before the run reads it (1 to 40, default 40). Each entry is capped on its own: an image over the cap becomes an uncharged bad_input row naming it, and the run moves to the next.",
            "default": 40
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}