{
  "openapi": "3.0.1",
  "info": {
    "title": "Image To Json Extractor",
    "description": "AI-Powered Image to JSON Data Extractor. \nUtilize cutting-edge AI to transform image content into structured JSON data effortlessly. \nPerfect for automating data extraction from visual content and streamlining workflows.",
    "version": "0.0",
    "x-build-id": "yBm2d59pya7OVht8S"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/apitale~image-to-json-extractor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-apitale-image-to-json-extractor",
        "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/apitale~image-to-json-extractor/runs": {
      "post": {
        "operationId": "runs-sync-apitale-image-to-json-extractor",
        "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/apitale~image-to-json-extractor/run-sync": {
      "post": {
        "operationId": "run-sync-apitale-image-to-json-extractor",
        "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": [
          "SourceType",
          "SourceLanguage",
          "DataStructures",
          "SourceFileUrl",
          "OpenaiApiKey",
          "VisionModel"
        ],
        "properties": {
          "SourceType": {
            "title": "Image Source Type",
            "pattern": "[0-9A-Za-z .,?!;:'\"()-]+",
            "minLength": 3,
            "maxLength": 60,
            "type": "string",
            "description": "The type of source provided in the image (e.g., invoice, receipt, website screenshot). This helps tailor the extraction process to the content."
          },
          "SourceLanguage": {
            "title": "Source Text Language",
            "minLength": 3,
            "maxLength": 3,
            "type": "string",
            "description": "The three-letter ISO 639-3 language code of the source (e.g., ENG for English). This ensures accurate text recognition and extraction.",
            "default": "ENG"
          },
          "DataStructures": {
            "title": "Extraction Data Schema",
            "type": "array",
            "description": "Defines the schema for data extraction. Include at least one data structure to specify the format of the extracted JSON. Use the provided web tool for schema creation: [Schema Generator](https://data-structures-json-generator.apitale.click)",
            "default": [
              {
                "Name": "customer",
                "Description": "Information about the customer",
                "Fields": [
                  {
                    "Name": "customer_name",
                    "Description": "Name of the customer"
                  },
                  {
                    "Name": "customer_address",
                    "Description": "Address of the customer"
                  }
                ]
              },
              {
                "Name": "invoice_item",
                "Description": "Details of each item in the invoice",
                "Fields": [
                  {
                    "Name": "item_name",
                    "Description": "Name of the item"
                  },
                  {
                    "Name": "item_description",
                    "Description": "Description of the item"
                  },
                  {
                    "Name": "item_quantity",
                    "Description": "Quantity of the item"
                  },
                  {
                    "Name": "item_price",
                    "Description": "Price of the item in decimal format"
                  }
                ]
              },
              {
                "Name": "invoice_summary",
                "Description": "Summary of the invoice",
                "Fields": [
                  {
                    "Name": "total_amount",
                    "Description": "Total pay amount of the invoice"
                  },
                  {
                    "Name": "due_date",
                    "Description": "Due date of the invoice in YYYY-MM-DD format"
                  },
                  {
                    "Name": "currency",
                    "Description": "Currency of the invoice in ISO (3 letter format)"
                  }
                ]
              }
            ]
          },
          "SourceFileUrl": {
            "title": "Image URL",
            "type": "string",
            "description": "The URL of the source image to be processed. Ensure the URL is publicly accessible for extraction.",
            "default": "https://getjobber.com/wp-content/uploads/2022/01/invoice-template-example.png"
          },
          "OpenaiApiKey": {
            "title": "OpenAI Service API Key",
            "type": "string",
            "description": "Your [API key](https://platform.openai.com/api-keys) for accessing OpenAI's services, which power the underlying extraction and conversion process."
          },
          "VisionModel": {
            "title": "OpenAI Vision Model",
            "enum": [
              "gpt-4o-mini",
              "gpt-4o",
              "chatgpt-4o-latest",
              "gpt-4-turbo"
            ],
            "type": "string",
            "description": "Select one of the available OpenAI vision models for the extraction process. Options are: gpt-4o, gpt-4o-mini, chatgpt-4o-latest, or gpt-4-turbo. For more information, visit the [OpenAI Models Guide](https://platform.openai.com/docs/models).",
            "default": "gpt-4o-mini"
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}