{
  "openapi": "3.0.1",
  "info": {
    "title": "Image Upscaler API — Upscale Images 2x/4x, Pay per Image",
    "description": "Upscale images 2x or 4x with AI super-resolution: send one or many image URLs, get for each a dataset item with the upscaled image URL, width and height. Increase image resolution or enhance low-res photos in batch, no API key, pay per image.",
    "version": "0.2",
    "x-build-id": "L5UrzluyxgZ4ZRzZ7"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/sherwood~image-upscaler-batch/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-sherwood-image-upscaler-batch",
        "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/sherwood~image-upscaler-batch/runs": {
      "post": {
        "operationId": "runs-sync-sherwood-image-upscaler-batch",
        "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/sherwood~image-upscaler-batch/run-sync": {
      "post": {
        "operationId": "run-sync-sherwood-image-upscaler-batch",
        "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": "Public URLs of the images to upscale (JPG, PNG, WebP), as a list. One dataset item is returned per URL, with an index matching the input order. For a single URL, or several URLs in one comma- or newline-separated string, use imageUrl instead. Aliases merged into this list: imageUrl, urls, images, startUrls.",
            "default": [
              "https://storage.googleapis.com/falserverless/example_inputs/seedvr2/image_in.png",
              "https://storage.googleapis.com/falserverless/example_inputs/dog.png"
            ],
            "items": {
              "type": "string"
            }
          },
          "datasetId": {
            "title": "Dataset with the images (instead of URLs)",
            "type": "string",
            "description": "Read the image URLs from an Apify dataset: the output of a scraper, of sherwood/background-remover-batch or of sherwood/image-generator-batch. When this Actor runs as an integration after another Actor, leave it empty: the dataset of the run that triggered it is used. The sample imageUrls are ignored when a dataset is given."
          },
          "urlField": {
            "title": "Image URL field",
            "type": "string",
            "description": "Field of each dataset item that holds the image URL. Dots for nested fields, [] for every element of a list, [0] for the first one: outputUrl, highResolutionImages, images[].url, photo.thumbnails[0].url. Several fields separated by commas are tried in order. Empty: detected automatically (outputUrl, highResolutionImages, imageUrls, images, imageUrl, image, photos, displayUrl, mainImage, thumbnailImage...)."
          },
          "maxImagesPerItem": {
            "title": "Images per dataset item",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "How many image URLs to take from each dataset item, in order. Default 1: the first one, usually the main image.",
            "default": 1
          },
          "keepFields": {
            "title": "Fields to keep from each item",
            "type": "array",
            "description": "Fields copied from each dataset item into its result, under source: asin, sku, url, title... Same path syntax as urlField.",
            "items": {
              "type": "string"
            }
          },
          "imageUrl": {
            "title": "Single image URL (alias)",
            "type": "string",
            "description": "A single image URL, or several URLs in one comma- or newline-separated string (they are split). Merged with imageUrls."
          },
          "urls": {
            "title": "urls (alias)",
            "type": "array",
            "description": "Alias of imageUrls.",
            "items": {
              "type": "string"
            }
          },
          "images": {
            "title": "images (alias)",
            "type": "array",
            "description": "Alias of imageUrls.",
            "items": {
              "type": "string"
            }
          },
          "startUrls": {
            "title": "startUrls (alias)",
            "type": "array",
            "description": "Alias of imageUrls. Accepts plain strings or {\"url\": \"...\"} objects.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "scale": {
            "title": "Upscale factor",
            "enum": [
              "2",
              "4"
            ],
            "type": "string",
            "description": "2 doubles width and height (4x the pixels). 4 quadruples them (16x the pixels). Output is capped by maxOutputMegapixels. Ignored when targetLongEdge is set.",
            "default": "2"
          },
          "targetLongEdge": {
            "title": "Target size: longest side in pixels (instead of 2x/4x)",
            "minimum": 64,
            "maximum": 16384,
            "type": "integer",
            "description": "Upscale each image until its longest side reaches this many pixels, for example 2048 for a Shopify product image or 3508 for an A4 print at 300 DPI. At most 4x per image, within maxOutputMegapixels. Images already this large are returned unchanged (status skipped) and not charged."
          },
          "skipIfLongEdgeAtLeast": {
            "title": "Skip images already this large (pixels)",
            "minimum": 1,
            "maximum": 16384,
            "type": "integer",
            "description": "Images whose longest side is already at least this many pixels are returned unchanged (status skipped, outputUrl = the original URL) and not charged. Useful when a dataset mixes thumbnails and full-size photos."
          },
          "outputFormat": {
            "title": "Output format",
            "enum": [
              "jpg",
              "png",
              "webp"
            ],
            "type": "string",
            "description": "File format of the upscaled image. Transparent inputs (cutouts from a background remover) keep their transparency in PNG and WebP; in JPG, transparent areas become white.",
            "default": "jpg"
          },
          "maxOutputMegapixels": {
            "title": "Max output megapixels",
            "minimum": 1,
            "maximum": 64,
            "type": "integer",
            "description": "Safety cap on the output size, in megapixels (width × height / 1,000,000). Images whose upscaled size would exceed it are upscaled to this size instead. 4 MP ≈ 2000×2000. Default 16.",
            "default": 16
          },
          "maxImages": {
            "title": "Max images per run",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Stop after this many images. Protects against oversized lists. Default 100.",
            "default": 100
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}