{
  "openapi": "3.0.1",
  "info": {
    "title": "AI Image Upscaler: Enlarge Photos 2x, 4x or to Any Size",
    "description": "Upscale images 2x, 4x or to an exact size with Real-ESRGAN AI: 2000 x 2000 white squares for marketplaces, 300 DPI for print. From URLs or a scraper's dataset, to PNG, JPEG or WebP. No API key, no faces made up. Images already large enough and failures are free.",
    "version": "0.1",
    "x-build-id": "fe7JSwWPPCExZ1BS3"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/pikoulas~image-upscaler/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-pikoulas-image-upscaler",
        "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/pikoulas~image-upscaler/runs": {
      "post": {
        "operationId": "runs-sync-pikoulas-image-upscaler",
        "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/pikoulas~image-upscaler/run-sync": {
      "post": {
        "operationId": "run-sync-pikoulas-image-upscaler",
        "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": {
          "urls": {
            "title": "Image URLs",
            "type": "array",
            "description": "The addresses of the images, or leave it empty and give a dataset below: JPEG, PNG, WebP, AVIF, HEIC, GIF (first frame), TIFF or BMP, up to 50 MB. The upscaled image can be up to 64 megapixels: 4 MP in at 4x, 16 MP at 2x. Each half megapixel of an input counts as an image: a 1,000 x 1,000 photo is two.",
            "items": {
              "type": "string"
            }
          },
          "datasetId": {
            "title": "Images from a dataset",
            "type": "string",
            "description": "The ID of a dataset, such as a product or listing scraper's run's: the image addresses of its items are upscaled, from the field below or, without one, from each field named like an image (image, images, photo, thumbnail, logo, icon...)."
          },
          "imageField": {
            "title": "Image field",
            "type": "string",
            "description": "The dataset field the image addresses are in, a dotted path for one inside another: imageUrl, images, seller.logo. It can hold one address, a list, or objects with a url."
          },
          "maxImages": {
            "title": "Max images",
            "minimum": 1,
            "type": "integer",
            "description": "Upscale at most this many images, from the list and the dataset together. Empty for all."
          },
          "scale": {
            "title": "Scale",
            "enum": [
              "4",
              "2"
            ],
            "type": "string",
            "description": "How many times wider and taller the image gets, when no size is given below. Both cost the same; 2x is 4x scaled down.",
            "default": "4"
          },
          "width": {
            "title": "Width",
            "minimum": 16,
            "maximum": 16384,
            "type": "integer",
            "description": "Upscale to this width instead of a scale: 2000 for a marketplace's zoom, 2400 for 8 inches at 300 DPI. With a height too, Fit says how the image takes the box; alone, the height follows the proportions. An image already this large is left as it is, free."
          },
          "height": {
            "title": "Height",
            "minimum": 16,
            "maximum": 16384,
            "type": "integer",
            "description": "Upscale to this height instead of a scale, with or without a width."
          },
          "fit": {
            "title": "Fit",
            "enum": [
              "contain",
              "pad",
              "cover"
            ],
            "type": "string",
            "description": "With both a width and a height: fit the image inside them, keeping its proportions; or make it exactly that size, padded with the Background colour (a white square for a marketplace) or cropped from the middle.",
            "default": "contain"
          },
          "format": {
            "title": "Format",
            "enum": [
              "png",
              "jpeg",
              "webp"
            ],
            "type": "string",
            "description": "PNG is lossless and keeps transparency, and its files are the largest; JPEG and WebP are much smaller, WebP keeps transparency too.",
            "default": "png"
          },
          "quality": {
            "title": "Quality",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "For JPEG and WebP: lower makes smaller files.",
            "default": 90
          },
          "background": {
            "title": "Background",
            "type": "string",
            "description": "The colour transparent parts get in a JPEG, which can't keep them, and the padding with Fit on Pad: a hex code or a name such as white.",
            "default": "#ffffff"
          },
          "dpi": {
            "title": "DPI",
            "minimum": 1,
            "maximum": 2400,
            "type": "integer",
            "description": "Writes this resolution into PNG and JPEG files, for print: 300 makes a 2400 x 3000 image 8 x 10 inches. It changes no pixel."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}