{
  "openapi": "3.0.1",
  "info": {
    "title": "Compress Video to Size: Under 10 MB, 25 MB or Any",
    "description": "Compress a video file to fit under a size limit: Discord 10 MB, WhatsApp 16 MB, email 25 MB or your own number. Two-pass H.264 MP4, checked and redone smaller if needed, with a shareable link. Targets too small for watchable video are refused, free.",
    "version": "0.1",
    "x-build-id": "2V9fifQlbDk3cvW8f"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/quarrywise~video-compress-to-size/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-quarrywise-video-compress-to-size",
        "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/quarrywise~video-compress-to-size/runs": {
      "post": {
        "operationId": "runs-sync-quarrywise-video-compress-to-size",
        "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/quarrywise~video-compress-to-size/run-sync": {
      "post": {
        "operationId": "run-sync-quarrywise-video-compress-to-size",
        "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": {
          "videoUrls": {
            "title": "Video file links",
            "maxItems": 100,
            "type": "array",
            "description": "Direct links to video files (MP4, MOV, MKV, WebM, AVI and similar), one per line. Public links and signed links (for example from cloud storage) work. Pages on YouTube, TikTok, Instagram, X, Facebook, Vimeo and other platforms are not video files and are refused, as are streaming playlists (.m3u8, .mpd) and links behind a login. Only process videos you have the right to process.",
            "items": {
              "type": "string"
            }
          },
          "uploadedVideos": {
            "title": "Upload videos",
            "type": "array",
            "description": "Upload videos from your computer instead of giving links. Uploaded files are read from your Apify storage and processed only for this run."
          },
          "target": {
            "title": "Size limit",
            "enum": [
              "discord-10",
              "whatsapp-16",
              "email-25",
              "slack",
              "custom"
            ],
            "type": "string",
            "description": "The size each output file must stay under. Presets use the upload limits of common services in decimal megabytes (1 MB = 1,000,000 bytes), so the file fits however the service counts. Choose Custom to set your own size below. From the API: leave it out and set targetSizeMb for a custom size; with neither, the Discord 10 MB limit is used."
          },
          "targetSizeMb": {
            "title": "Custom size limit (MB)",
            "minimum": 0.5,
            "maximum": 1000,
            "type": "number",
            "description": "Used when Size limit is Custom, or when Size limit is left out (API input). From 0.5 to 1,000 MB, decimals allowed."
          },
          "maxResolution": {
            "title": "Maximum resolution",
            "enum": [
              "1080",
              "720",
              "540",
              "480",
              "360"
            ],
            "type": "string",
            "description": "The largest picture size to keep, by the short side (portrait videos are handled the same way). Within this limit the Actor picks the sharpest size the size limit can carry; it never enlarges a video.",
            "default": "1080"
          },
          "maxFrameRate": {
            "title": "Maximum frame rate",
            "enum": [
              "30",
              "60",
              "24"
            ],
            "type": "string",
            "description": "Videos above this frame rate are reduced to it. With 60, smooth 60 fps video keeps its frame rate when the size limit allows; under about 2.5 Mb/s it still drops to 30 fps, which looks better at small sizes.",
            "default": "30"
          },
          "audioBitrateKbps": {
            "title": "Audio bitrate (kb/s)",
            "minimum": 0,
            "maximum": 192,
            "type": "integer",
            "description": "Leave empty to let the Actor choose from the budget (64 to 128 kb/s AAC, never above the original). 0 removes the audio track, which leaves more room for the picture. Surround sound is mixed to stereo."
          },
          "videoCodec": {
            "title": "Video format",
            "enum": [
              "h264",
              "av1"
            ],
            "type": "string",
            "description": "H.264 plays everywhere and is the right choice for Discord, WhatsApp, email and Slack. AV1 gives a sharper picture at the same size, but many apps, older phones and TVs, and Apple devices without an AV1 hardware decoder cannot play it: check that your destination plays AV1 first. If the AV1 encoder is not available, the video is encoded as H.264 and the row says so.",
            "default": "h264"
          },
          "keyValueStoreId": {
            "title": "Key-value store with your videos",
            "type": "string",
            "description": "Optional. A key-value store that holds videos as records. With record keys below, only those records are compressed; without keys, every record is (up to the maximum number of videos). The Actor only reads this store."
          },
          "fileKeys": {
            "title": "Record keys",
            "type": "array",
            "description": "Keys of records that hold videos: in the store chosen above, or in this run's own default key-value store when no store is chosen.",
            "items": {
              "type": "string"
            }
          },
          "maxInputSizeMb": {
            "title": "Maximum input file size (MB)",
            "minimum": 1,
            "maximum": 2048,
            "type": "integer",
            "description": "Larger files are skipped with a free error row. The hard limit is 2,048 MB, and the run's free disk space (more memory gives more disk) can lower it.",
            "default": 2048
          },
          "maxDurationMinutes": {
            "title": "Maximum video length (minutes)",
            "minimum": 1,
            "maximum": 120,
            "type": "integer",
            "description": "Longer videos are skipped with a free error row. Protects your budget, since the price is per second of output video. At most 120 minutes.",
            "default": 30
          },
          "maxVideos": {
            "title": "Maximum videos per run",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Only the first videos up to this number are processed.",
            "default": 10
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}