{
  "openapi": "3.0.1",
  "info": {
    "title": "AI Image Upscaler & Photo Restorer: Fix Blurry Photos in Bulk",
    "description": "Upscales images 2x to 4x with AI (Real-ESRGAN) and repairs faces (GFPGAN), from a list of links, dataset, CSV, Excel or Google Sheet; stores each with a public link, keeping your columns. Inputs: imageUrls, datasetId or fileUrl, scale, fixFaces. Charged per image delivered. Agent-ready: x402, MCP.",
    "version": "0.1",
    "x-build-id": "QcmsjV6KKNJOERWoA"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/nerolabs~bulk-image-upscaler/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-nerolabs-bulk-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/nerolabs~bulk-image-upscaler/runs": {
      "post": {
        "operationId": "runs-sync-nerolabs-bulk-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/nerolabs~bulk-image-upscaler/run-sync": {
      "post": {
        "operationId": "run-sync-nerolabs-bulk-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": {
          "fileUrl": {
            "title": "File or Google Sheet URL",
            "type": "string",
            "description": "Link to a CSV, TSV, Excel (.xlsx), JSON or JSON Lines file, or a Google Sheets link (share it as 'Anyone with the link can view'; a normal edit link is converted automatically). One row per image. Use this, 'datasetId', 'imageUrls' or 'data', only one."
          },
          "datasetId": {
            "title": "Dataset",
            "type": "string",
            "description": "An Apify dataset whose rows hold image links, for example the output of a scraper or of Bulk Image & File Downloader (use 'fileUrl' as the link column)."
          },
          "imageUrls": {
            "title": "Image URLs",
            "type": "array",
            "description": "A plain list of direct image links, if you have no file or dataset. Each becomes one output row.",
            "items": {
              "type": "string"
            }
          },
          "data": {
            "title": "Rows",
            "type": "array",
            "description": "Rows as JSON objects, for callers that send data directly (agents, API, n8n, Make). Each row needs a column holding an image link."
          },
          "urlField": {
            "title": "Link column",
            "type": "string",
            "description": "The column holding each row's image link. Leave empty to detect it (a column named like imageUrl, image, photo or url, else the column with the most links). A cell holding several links or a list uses the first one."
          },
          "scale": {
            "title": "Upscale factor",
            "enum": [
              "4",
              "3",
              "2"
            ],
            "type": "string",
            "description": "How much bigger each side gets. 4x turns 500 x 500 into 2000 x 2000. The model always works at 4x; 2x and 3x are resized down from that result, so they cost the same.",
            "default": "4"
          },
          "fixFaces": {
            "title": "Fix faces",
            "type": "boolean",
            "description": "Repairs every face in the photo (eyes, teeth, skin) with a face restoration model (GFPGAN), so people look like a real sharp photo instead of a smooth painting. Up to the 3 largest faces per image (the main people in the shot). No extra charge. Photos with no faces are unchanged. Turn off for pure product shots if you want the fastest run.",
            "default": true
          },
          "outputFormat": {
            "title": "Output format",
            "enum": [
              "auto",
              "jpg",
              "png",
              "webp"
            ],
            "type": "string",
            "description": "File type of the upscaled images. Auto keeps transparency by using PNG only for images that have it.",
            "default": "auto"
          },
          "quality": {
            "title": "JPEG / WebP quality",
            "minimum": 40,
            "maximum": 100,
            "type": "integer",
            "description": "Compression quality for JPEG and WebP output, 40 to 100.",
            "default": 92
          },
          "maxInputMegapixels": {
            "title": "Largest input (megapixels)",
            "minimum": 0.1,
            "maximum": 16,
            "type": "number",
            "description": "Inputs bigger than this are shrunk (keeping their shape) before upscaling, so a huge photo cannot produce a gigantic output or a large charge. 4 MP is about 2000 x 2000, which gives an 8000 x 8000 output at 4x. Rows where this happened show resizedToFitCap: true.",
            "default": 4
          },
          "skipIfLongEdgeAtLeast": {
            "title": "Skip images at least this big (px)",
            "minimum": 0,
            "type": "integer",
            "description": "Skip, and never charge for, images whose longest side is already at least this many pixels. Useful for mixed catalogues where only the small photos need upscaling. 0 upscales everything.",
            "default": 0
          },
          "fileNameField": {
            "title": "Name files by column",
            "type": "string",
            "description": "Optional column (for example sku or id) used to name each stored file, as upscaled-<value>.jpg. Default is the source file's own name."
          },
          "keepOriginalFields": {
            "title": "Keep my original columns",
            "type": "boolean",
            "description": "Copy each input row's columns into its output row, next to the upscaled image link.",
            "default": true
          },
          "storeName": {
            "title": "Keep images in a named store",
            "type": "string",
            "description": "Optional named key-value store to save the images in, so they outlive the run's normal data retention. Leave empty to use the run's own storage."
          },
          "maxImages": {
            "title": "Max images",
            "minimum": 0,
            "type": "integer",
            "description": "Stop after this many images have been upscaled (and charged). 0 means no limit.",
            "default": 0
          },
          "maxItems": {
            "title": "Max rows",
            "minimum": 1,
            "type": "integer",
            "description": "Read at most this many input rows."
          },
          "fileFormat": {
            "title": "File format",
            "enum": [
              "auto",
              "csv",
              "tsv",
              "xlsx",
              "json",
              "jsonl"
            ],
            "type": "string",
            "description": "Format of 'fileUrl'. Auto detects it from the link, the server's content type or the content.",
            "default": "auto"
          },
          "sheetName": {
            "title": "Excel sheet name",
            "type": "string",
            "description": "For Excel files, the sheet to read. Default is the first sheet."
          },
          "maxDownloadMb": {
            "title": "Largest download (MB)",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Image downloads larger than this are skipped (not charged).",
            "default": 50
          },
          "requestTimeoutSecs": {
            "title": "Download timeout (seconds)",
            "minimum": 5,
            "maximum": 600,
            "type": "integer",
            "description": "How long to wait for one image download before giving up on it (not charged).",
            "default": 60
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}