{
  "openapi": "3.0.1",
  "info": {
    "title": "Video & Audio Converter: Compress MP4, MP3, WebM, GIF (FFmpeg)",
    "description": "Convert and compress your video and audio files with FFmpeg: MP4 or WebM at 240p to 1080p, target file size, MP4 to MP3, M4A, WAV, FLAC, OGG or Opus, trim, mute, GIF. Direct file links only, no YouTube or social media pages. Failed and blocked files are free.",
    "version": "0.1",
    "x-build-id": "cjQLvEDILOxItecqz"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/greenrun~video-converter/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-greenrun-video-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/greenrun~video-converter/runs": {
      "post": {
        "operationId": "runs-sync-greenrun-video-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/greenrun~video-converter/run-sync": {
      "post": {
        "operationId": "run-sync-greenrun-video-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": {
          "mediaUrls": {
            "title": "Video or audio file URLs",
            "type": "array",
            "description": "Direct http or https links to video or audio files (MP4, MOV, WebM, MKV, AVI, MPEG-TS, 3GP, MP3, M4A, WAV, FLAC, OGG and other formats ffmpeg reads), one per line. Pages of YouTube, TikTok, Instagram and other platforms are not files: they are returned free with the reason. Each file becomes one row with a link to the converted file.",
            "items": {
              "type": "string"
            }
          },
          "outputFormat": {
            "title": "Output format",
            "enum": [
              "mp4",
              "webm",
              "mov",
              "mp3",
              "m4a",
              "wav",
              "flac",
              "ogg",
              "opus",
              "gif"
            ],
            "type": "string",
            "description": "Video formats keep the picture (and the sound unless muted); audio formats take only the sound; GIF makes an animated image of up to gifMaxSeconds.",
            "default": "mp4"
          },
          "resolution": {
            "title": "Resolution (video)",
            "enum": [
              "original",
              "1080",
              "720",
              "480",
              "360",
              "240"
            ],
            "type": "string",
            "description": "Short side of the output in pixels (a portrait 1080x1920 phone video is 1080p). Never upscaled: a smaller video keeps its size. The price per minute follows the output: up to 480p, 720p, 1080p.",
            "default": "720"
          },
          "quality": {
            "title": "Quality",
            "enum": [
              "high",
              "balanced",
              "small"
            ],
            "type": "string",
            "description": "Compression level for video (H.264 CRF 20, 23, 28; VP9 CRF 30, 34, 40) and the default audio bitrate. Ignored for WAV and FLAC.",
            "default": "balanced"
          },
          "targetSizeMb": {
            "title": "Target file size (MB, optional)",
            "minimum": 0.1,
            "maximum": 100000,
            "type": "number",
            "description": "Make the result at most this size, for example 25 for e-mail or Discord. The bitrate follows from the length; when it is too low for the chosen resolution, the resolution steps down (and the price with it). Lossy audio formats too; ignored for WAV, FLAC and GIF."
          },
          "startTime": {
            "title": "Start time (trim)",
            "type": "string",
            "description": "Convert from this point: seconds (75.5) or HH:MM:SS.mmm (00:01:15.500). Empty: from the start."
          },
          "endTime": {
            "title": "End time (trim)",
            "type": "string",
            "description": "Convert up to this point (same formats). Empty: to the end. Only the converted part is charged."
          },
          "mute": {
            "title": "Remove audio (mute)",
            "type": "boolean",
            "description": "Video without the sound track.",
            "default": false
          },
          "maxFps": {
            "title": "Max frame rate (fps)",
            "minimum": 0,
            "maximum": 240,
            "type": "integer",
            "description": "0 keeps the frame rate of the file, up to 60 fps. A video minute is 60 s at up to 30 fps: a 60 fps output counts two minutes per minute, so 30 here halves the price of 60 fps videos.",
            "default": 0
          },
          "audioBitrateKbps": {
            "title": "Audio bitrate (kbps)",
            "minimum": 0,
            "maximum": 512,
            "type": "integer",
            "description": "0: by quality (MP3 256, 192 or 128 kbps; AAC 160, 128 or 96; Opus 128, 96 or 64).",
            "default": 0
          },
          "gifFps": {
            "title": "GIF frame rate",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Frames per second of the GIF.",
            "default": 12
          },
          "gifWidth": {
            "title": "GIF width (px)",
            "minimum": 16,
            "maximum": 1920,
            "type": "integer",
            "description": "Width of the GIF (never wider than the video). Up to 480 px on the long side one GIF event per 15 s; larger GIFs count by area (960 px: 4).",
            "default": 480
          },
          "gifMaxSeconds": {
            "title": "GIF max length (s)",
            "minimum": 1,
            "maximum": 600,
            "type": "integer",
            "description": "Longest GIF; pick the part with startTime. Each started 15 s counts one GIF event.",
            "default": 15
          },
          "datasetId": {
            "title": "File URLs from a dataset (optional)",
            "type": "string",
            "description": "Also take the file links found in this dataset, for example the output of another Actor. Pick the field below. Up to 5,000 items are read, and only as many as the run has paid for at that point; split larger datasets."
          },
          "datasetField": {
            "title": "Dataset field with the links",
            "type": "string",
            "description": "Field of each dataset item that holds the file link. Dot paths and lists work: url, videoUrl, media.video, files.url.",
            "default": "url"
          },
          "keyValueStoreId": {
            "title": "Files from a key-value store (optional)",
            "type": "string",
            "description": "Convert files stored as records of this key-value store (for example files you uploaded through the Apify API). Choosing the store here gives the Actor read access."
          },
          "keyValueStoreKeys": {
            "title": "Record keys in that store",
            "type": "array",
            "description": "Keys of the records to convert. Leave empty to take every record whose key ends with a video or audio extension (.mp4, .mov, .webm, .mp3 ...).",
            "items": {
              "type": "string"
            }
          },
          "maxFileSizeMb": {
            "title": "Max input file size (MB)",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Larger files are skipped for free. The run keeps the input and the result on its disk (twice its memory), so very large files need more memory.",
            "default": 4000
          },
          "maxConcurrency": {
            "title": "Parallel files",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Files downloaded at the same time. Conversion uses one ffmpeg per CPU core the run gets (about one per 8 GB of memory), so a download overlaps with the conversion of another file.",
            "default": 2
          },
          "timeoutSecs": {
            "title": "Timeout per file (seconds)",
            "minimum": 60,
            "maximum": 86400,
            "type": "integer",
            "description": "Longest time for one file (download and conversion); the part converted until then is kept. Long files convert faster with more memory (more CPU).",
            "default": 3600
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}