{
  "openapi": "3.0.1",
  "info": {
    "title": "PNG to JPG Converter - WebP, AVIF and More",
    "description": "Convert PNG to JPG online in seconds. Also converts WebP, AVIF, JFIF, BMP, TIFF and GIF in any direction. Transparency is flattened onto a background colour you choose rather than silently onto black. Up to 100 images per run, with resize and quality.",
    "version": "0.1",
    "x-build-id": "6OtI5uXK0ptKLbWgN"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/marcel-rbro~png-to-jpg/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-marcel-rbro-png-to-jpg",
        "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/marcel-rbro~png-to-jpg/runs": {
      "post": {
        "operationId": "runs-sync-marcel-rbro-png-to-jpg",
        "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/marcel-rbro~png-to-jpg/run-sync": {
      "post": {
        "operationId": "run-sync-marcel-rbro-png-to-jpg",
        "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": {
          "files": {
            "title": "Images",
            "maxItems": 100,
            "type": "array",
            "description": "The images to convert. Upload files or paste direct URLs - up to 100 per run. Each one is converted separately and the results come back as a single ZIP. Accepts .png, .jpg, .jpeg, .jfif, .webp, .avif, .bmp, .tiff and .gif."
          },
          "file": {
            "title": "Single image (alias)",
            "type": "string",
            "description": "Alias for a single-image run, kept so existing API callers and saved input configurations keep working. Pass one URL. Ignored when Images is filled in."
          },
          "outputFormat": {
            "title": "Convert to",
            "enum": [
              "jpeg",
              "png",
              "webp",
              "avif",
              "tiff",
              "bmp"
            ],
            "type": "string",
            "description": "JPEG opens everywhere and is the right answer for photos. Choose PNG or WebP if the image has a transparent background you need to keep.",
            "default": "jpeg"
          },
          "quality": {
            "title": "Quality",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Compression quality from 1 to 100, used by JPEG, WebP and AVIF. 90 is visually indistinguishable from the original for most images. Ignored for PNG, TIFF and BMP, which are lossless.",
            "default": 90
          },
          "backgroundColor": {
            "title": "Background colour",
            "type": "string",
            "description": "What transparent areas become when the output format cannot store them, which is the case for JPEG and BMP. Accepts a colour name, a hex value such as #ffffff, or an rgb(255,255,255) triplet. Ignored when converting to PNG, WebP, AVIF or TIFF, which keep transparency as it was.",
            "default": "white"
          },
          "maxDimension": {
            "title": "Maximum dimension",
            "minimum": 0,
            "type": "integer",
            "description": "Shrink the image so neither side exceeds this many pixels, keeping the aspect ratio. Leave empty to keep the original size. Images smaller than this are never enlarged."
          },
          "keepMetadata": {
            "title": "Keep metadata",
            "type": "boolean",
            "description": "Keeps the EXIF data, which includes the camera, the date the photo was taken and, on phone photos, the GPS location. Turn this off to strip it before sharing the file. The colour profile is kept either way.",
            "default": true
          },
          "stripToSRGB": {
            "title": "Convert to sRGB",
            "type": "boolean",
            "description": "Converts the image into the sRGB colour space and removes the embedded colour profile. Turn this on when a wide-gamut image (Display P3, Adobe RGB) looks oversaturated or washed out in a browser or an app that ignores colour profiles.",
            "default": false
          },
          "outputFilename": {
            "title": "Output filename",
            "type": "string",
            "description": "Name of the resulting file, without the extension. Defaults to the input filename. Applies to a single image only - in a batch it is ignored and each converted image keeps its own filename."
          },
          "fileBase64": {
            "title": "File as base64",
            "type": "string",
            "description": "Alternative to the file field for API callers: a single source image encoded as base64. Adds about 33% to the payload size."
          },
          "filename": {
            "title": "Filename for base64 input",
            "type": "string",
            "description": "Original filename to use when the file is passed as base64."
          },
          "verboseLog": {
            "title": "Verbose log",
            "type": "boolean",
            "description": "Includes the full ImageMagick output in the Actor log. Useful when a conversion produces odd output.",
            "default": false
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}