{
  "openapi": "3.0.1",
  "info": {
    "title": "Video & Audio Converter: MP4, WebM, MP3, M4A, WAV",
    "description": "Convert and compress video and audio files to MP4 (H.264), WebM (VP9), MP3, M4A or WAV with FFmpeg: quality or target size in MB, resize to 480p/720p/1080p, trim, mute. Input: file URLs or key-value store uploads. Pay per output minute from $0.003.",
    "version": "0.1",
    "x-build-id": "CqPON03KrlB1TSWRl"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/cprussin~media-converter/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-cprussin-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/cprussin~media-converter/runs": {
      "post": {
        "operationId": "runs-sync-cprussin-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/cprussin~media-converter/run-sync": {
      "post": {
        "operationId": "run-sync-cprussin-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": "File URLs",
            "type": "array",
            "description": "Direct links to video or audio files (MP4, MOV, MKV, WebM, AVI, MP3, M4A, WAV, FLAC and most others FFmpeg reads), one per line. Apify key-value store record URLs are read with your token. YouTube, TikTok, Instagram, X and other platform links, and private or internal addresses, are refused. Leave every source empty to convert a generated 3-second test clip. Failed files are free.",
            "items": {
              "type": "string"
            }
          },
          "startUrls": {
            "title": "Start URLs",
            "type": "array",
            "description": "Optional alternative to File URLs, in Apify's request-list format (e.g. a file with one URL per line). Combined with File URLs.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "keyValueStoreRecords": {
            "title": "Key-value store records",
            "type": "array",
            "description": "Files uploaded to an Apify key-value store, as <code>storeId/recordKey</code> or <code>username~store-name/recordKey</code>, one per line. Use this to convert your own files without hosting them anywhere.",
            "items": {
              "type": "string"
            }
          },
          "outputFormat": {
            "title": "Output format",
            "enum": [
              "mp4",
              "webm",
              "mp3",
              "m4a",
              "wav"
            ],
            "type": "string",
            "description": "MP4: H.264 video and AAC audio, plays everywhere. WebM: VP9 video and Opus audio, for the web. MP3, M4A (AAC) and WAV: the audio track only, billed as audio minutes.",
            "default": "mp4"
          },
          "maxHeight": {
            "title": "Max resolution (p)",
            "minimum": 144,
            "maximum": 1080,
            "type": "integer",
            "description": "480, 720 or 1080: the shorter side of the output in pixels (a portrait 1080x1920 video is 1080p), with the longer side at most 16:9 of it. Smaller videos are never enlarged. The price per minute depends on this: 480p $0.008, 720p $0.02, 1080p $0.04.",
            "default": 1080
          },
          "crf": {
            "title": "Quality (CRF)",
            "minimum": 10,
            "maximum": 45,
            "type": "integer",
            "description": "Video quality when no target size is set: lower is better and bigger. 18 is near-transparent, 23 the default, 28 small files, 32+ visibly soft. The same scale is used for WebM (mapped to VP9). Ignored for audio outputs and with a target size.",
            "default": 23
          },
          "targetMb": {
            "title": "Target file size (MB)",
            "minimum": 1,
            "maximum": 4000,
            "type": "integer",
            "description": "Optional: compress each file to about this size instead of a fixed quality (e.g. 25 for Discord, 16 for WhatsApp). The bitrate is set from the length; if the first pass misses by more than 5%, it is encoded once more. Very small targets for long files get a warning. For MP3 and M4A it sets the audio bitrate. Leave empty for the CRF quality."
          },
          "startSeconds": {
            "title": "Start at (seconds)",
            "minimum": 0,
            "maximum": 86400,
            "type": "integer",
            "description": "Optional: trim the start. The output begins this many seconds into the file.",
            "default": 0
          },
          "durationSeconds": {
            "title": "Duration (seconds)",
            "minimum": 1,
            "maximum": 10800,
            "type": "integer",
            "description": "Optional: keep only this many seconds from the start point. Leave empty for the rest of the file. You pay for the output length only."
          },
          "mute": {
            "title": "Remove audio",
            "type": "boolean",
            "description": "MP4 and WebM only: drop the audio track.",
            "default": false
          },
          "maxDurationMinutes": {
            "title": "Max output length (minutes)",
            "minimum": 1,
            "maximum": 180,
            "type": "integer",
            "description": "Files whose output would be longer are skipped with a free error item (trim them with Start at and Duration, or raise this, up to 180). Caps the cost per file.",
            "default": 30
          },
          "maxFileSizeMb": {
            "title": "Max input file size (MB)",
            "minimum": 1,
            "maximum": 4000,
            "type": "integer",
            "description": "Larger downloads are skipped with a free error item.",
            "default": 1000
          },
          "timeoutSecs": {
            "title": "Download timeout (seconds)",
            "minimum": 10,
            "maximum": 3600,
            "type": "integer",
            "description": "Max time to download one file.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}