{
  "openapi": "3.0.1",
  "info": {
    "title": "Media Converter: Video, Audio, GIF and Frames with FFmpeg",
    "description": "Convert audio and video files from direct links with FFmpeg: MP4, WebM, MP3, M4A, WAV, OGG, Opus, FLAC and GIF. Extract audio, trim, resize, compress, mute, grab frames and read media metadata. Several jobs per run, files in the key-value store. Pay per media minute.",
    "version": "0.1",
    "x-build-id": "iffB0D5NO82pbP74M"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/forgeloop~media-converter/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-forgeloop-media-converter",
        "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/forgeloop~media-converter/runs": {
      "post": {
        "operationId": "runs-sync-forgeloop-media-converter",
        "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/forgeloop~media-converter/run-sync": {
      "post": {
        "operationId": "run-sync-forgeloop-media-converter",
        "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": "URLs",
            "type": "array",
            "description": "Direct http(s) links to audio or video files you are allowed to use: MP4, MOV, MKV, WEBM, AVI, MP3, M4A, WAV, OGG, FLAC, GIF and more. Each link becomes one job with the operation and options below. Links to YouTube, TikTok, Instagram, Vimeo and other video or social platforms are refused. Format: a list of strings like [\"https://example.com/clip.mp4\"].",
            "items": {
              "type": "string"
            }
          },
          "operation": {
            "title": "Operation",
            "enum": [
              "convert",
              "extract_audio",
              "trim",
              "resize",
              "compress",
              "mute",
              "frames",
              "metadata"
            ],
            "type": "string",
            "description": "What to do with each file. convert: change the format (combine with trim, size and quality). extract_audio: audio track only. trim: cut a part (start, end or duration). resize: scale down to max width or height. compress: re-encode with a quality preset or bitrate. mute: remove the audio track. frames: still images at given times or every N seconds. metadata: media information only, no output file.",
            "default": "convert"
          },
          "format": {
            "title": "Output format",
            "enum": [
              "auto",
              "mp4",
              "webm",
              "gif",
              "mp3",
              "m4a",
              "aac",
              "wav",
              "ogg",
              "opus",
              "flac"
            ],
            "type": "string",
            "description": "auto keeps the family of the input: MP4 for most videos, WebM for WebM input, the matching audio format for audio files, MP3 for extract_audio. mp4 is H.264 with AAC, webm is VP9 with Opus, gif is an animated GIF from video, ogg is Vorbis, opus is Opus in Ogg, aac is raw ADTS AAC, m4a is AAC in MP4.",
            "default": "auto"
          },
          "quality": {
            "title": "Quality preset",
            "enum": [
              "high",
              "medium",
              "low",
              "small"
            ],
            "type": "string",
            "description": "Encoding quality. high: H.264 CRF 20, 192 kbps AAC, 256 kbps MP3. medium: CRF 23, 128 kbps AAC, 192 kbps MP3. low: CRF 28, 96 kbps AAC, 128 kbps MP3. small: CRF 32, 64 kbps AAC, 96 kbps MP3. VP9, Opus, Vorbis and JPEG frames follow the same steps. Bitrates below override the preset.",
            "default": "medium"
          },
          "start": {
            "title": "Trim start",
            "type": "string",
            "description": "Start of the part to keep, in seconds (12.5) or HH:MM:SS (00:01:30.5). Works with every operation that writes a file. For frames with frameEvery it is the first frame time."
          },
          "end": {
            "title": "Trim end",
            "type": "string",
            "description": "End of the part to keep, in seconds or HH:MM:SS. Use either end or duration."
          },
          "duration": {
            "title": "Trim duration",
            "type": "string",
            "description": "Length of the part to keep from the start, in seconds or HH:MM:SS. Use either end or duration."
          },
          "maxWidth": {
            "title": "Max width (px)",
            "minimum": 16,
            "maximum": 7680,
            "type": "integer",
            "description": "Scale video, GIF or frames down to at most this width. The aspect ratio stays, nothing is scaled up."
          },
          "maxHeight": {
            "title": "Max height (px)",
            "minimum": 16,
            "maximum": 4320,
            "type": "integer",
            "description": "Scale video, GIF or frames down to at most this height. The aspect ratio stays, nothing is scaled up."
          },
          "videoBitrateKbps": {
            "title": "Video bitrate (kbps)",
            "minimum": 50,
            "maximum": 50000,
            "type": "integer",
            "description": "Target video bitrate for MP4 and WebM instead of the quality preset, for example 1500."
          },
          "audioBitrateKbps": {
            "title": "Audio bitrate (kbps)",
            "minimum": 8,
            "maximum": 512,
            "type": "integer",
            "description": "Audio bitrate instead of the quality preset, for example 128. Ignored for WAV and FLAC."
          },
          "audioChannels": {
            "title": "Audio channels",
            "minimum": 1,
            "maximum": 2,
            "type": "integer",
            "description": "1 for mono, 2 for stereo. Empty keeps the input."
          },
          "audioSampleRate": {
            "title": "Audio sample rate (Hz)",
            "minimum": 8000,
            "maximum": 96000,
            "type": "integer",
            "description": "For example 44100 or 16000. Empty keeps the input. Opus always uses 48000."
          },
          "frameAt": {
            "title": "Frame times",
            "type": "array",
            "description": "For frames: one image per time, in seconds or HH:MM:SS, at most 100. Format: [\"5\", \"00:00:12.5\"]. Without frame times and frameEvery you get one frame from the middle of the video.",
            "items": {
              "type": "string"
            }
          },
          "frameEvery": {
            "title": "Frame every N seconds",
            "minimum": 1,
            "maximum": 3600,
            "type": "integer",
            "description": "For frames: one image every N seconds from the start (or from Trim start), up to Max frames. Use decimals like 0.5 in the Jobs JSON."
          },
          "frameFormat": {
            "title": "Frame format",
            "enum": [
              "jpg",
              "png"
            ],
            "type": "string",
            "description": "Image format of the frames.",
            "default": "jpg"
          },
          "maxFrames": {
            "title": "Max frames per job",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "At most this many frames per job, 1 to 100.",
            "default": 20
          },
          "gifFps": {
            "title": "GIF frames per second",
            "minimum": 1,
            "maximum": 30,
            "type": "integer",
            "description": "Frame rate of animated GIFs.",
            "default": 10
          },
          "gifWidth": {
            "title": "GIF max width (px)",
            "minimum": 32,
            "maximum": 1920,
            "type": "integer",
            "description": "GIFs are scaled down to this width. Nothing is scaled up.",
            "default": 480
          },
          "gifMaxSeconds": {
            "title": "GIF max length (seconds)",
            "minimum": 1,
            "maximum": 60,
            "type": "integer",
            "description": "A GIF covers at most this many seconds from Trim start. Longer parts are cut with a note in the row.",
            "default": 15
          },
          "jobs": {
            "title": "Jobs (different settings per file)",
            "type": "array",
            "description": "A JSON array of job objects. Each needs url and can set operation, format, quality, start, end, duration, maxWidth, maxHeight, videoBitrateKbps, audioBitrateKbps, audioChannels, audioSampleRate, frameAt, frameEvery, frameFormat, maxFrames, gifFps, gifWidth, gifMaxSeconds and label (copied to the rows). Fields you leave out come from the settings above. Example: [{\"url\": \"https://example.com/talk.mp4\", \"operation\": \"extract_audio\", \"format\": \"mp3\"}, {\"url\": \"https://example.com/talk.mp4\", \"operation\": \"frames\", \"frameEvery\": 10}]. Can be used together with URLs."
          },
          "maxConcurrency": {
            "title": "Jobs at the same time",
            "minimum": 1,
            "maximum": 2,
            "type": "integer",
            "description": "1 or 2. Two jobs at once help with many short files and need more memory.",
            "default": 1
          },
          "maxFileSizeMb": {
            "title": "Max input file size (MB)",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Larger input files are skipped with a free error row. Maximum 500.",
            "default": 500
          },
          "maxDurationMinutes": {
            "title": "Max input duration (minutes)",
            "minimum": 1,
            "maximum": 60,
            "type": "integer",
            "description": "Longer input files are skipped with a free error row. Maximum 60.",
            "default": 60
          },
          "downloadTimeoutSecs": {
            "title": "Download timeout (seconds)",
            "minimum": 30,
            "maximum": 1800,
            "type": "integer",
            "description": "Give up on a download that takes longer than this. A download also stops after 60 seconds without data.",
            "default": 600
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}