{
  "openapi": "3.0.1",
  "info": {
    "title": "Video & Audio Converter: MP3, Compress, GIF, Trim",
    "description": "Convert direct video and audio file URLs: extract audio to MP3 / M4A / WAV, compress or resize to H.264 MP4, trim a part, or make a GIF. Direct download link per file. From $0.004 per audio minute. Refused or failed files are free. No YouTube links.",
    "version": "1.0",
    "x-build-id": "2X0L7KTMuaVNa3N8h"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/dojito~video-audio-converter/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-dojito-video-audio-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/dojito~video-audio-converter/runs": {
      "post": {
        "operationId": "runs-sync-dojito-video-audio-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/dojito~video-audio-converter/run-sync": {
      "post": {
        "operationId": "run-sync-dojito-video-audio-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",
        "required": [
          "mediaUrls"
        ],
        "properties": {
          "mediaUrls": {
            "title": "Video or audio file URLs",
            "type": "array",
            "description": "Direct links to media files (up to 1,000 per run): your own server, a public S3 / R2 / CDN URL or an Apify key-value store record. Links to YouTube, TikTok, Instagram, Facebook, X, Vimeo, SoundCloud, Spotify and other platforms are refused (platform terms generally restrict downloading), as are web pages, HLS / DASH playlists (.m3u8, .mpd) and sites whose robots.txt disallows the file. Refused URLs are not charged. Paste the URLs (Bulk edit: one per line).",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "operation": {
            "title": "Operation",
            "enum": [
              "extract-audio",
              "compress",
              "resize",
              "trim",
              "gif"
            ],
            "type": "string",
            "description": "extract-audio = the sound track as MP3 / M4A / WAV. compress = smaller H.264 MP4 (CRF, max width). resize = H.264 MP4 at a given width. trim = only the part between Start and End (MP4 for video, the audio format for audio files). gif = animated GIF (up to 15 s).",
            "default": "extract-audio"
          },
          "startTime": {
            "title": "Start",
            "type": "string",
            "description": "Optional, every operation: where to start, in seconds (12.5) or m:ss / h:mm:ss (1:05). Empty = from the beginning. Trim needs Start and / or End."
          },
          "endTime": {
            "title": "End",
            "type": "string",
            "description": "Optional, every operation: where to stop (same format). Empty = to the end (GIF: at most 'GIF max length' from Start)."
          },
          "audioFormat": {
            "title": "Audio format",
            "enum": [
              "mp3",
              "m4a",
              "wav"
            ],
            "type": "string",
            "description": "extract-audio, and trim of audio files: mp3 (LAME), m4a (AAC) or wav (16-bit PCM, about 10 MB per minute).",
            "default": "mp3"
          },
          "audioBitrateKbps": {
            "title": "Audio bitrate (kb/s)",
            "minimum": 32,
            "maximum": 320,
            "type": "integer",
            "description": "MP3 / M4A bitrate, 32 to 320 (WAV ignores it). Video outputs always get AAC 128 kb/s stereo.",
            "default": 192
          },
          "crf": {
            "title": "Video quality (CRF)",
            "minimum": 18,
            "maximum": 40,
            "type": "integer",
            "description": "compress, resize, trim: H.264 constant rate factor, 18 (near-original, large) to 40 (small, blurry). 23 = good quality, 28 = clearly smaller files.",
            "default": 28
          },
          "maxWidth": {
            "title": "Max width when compressing (px)",
            "minimum": 0,
            "maximum": 1920,
            "type": "integer",
            "description": "compress: videos wider than this are scaled down, keeping the aspect ratio (never up). 0 = original size. Every output fits in 1920 x 1920 (no 4K output).",
            "default": 1280
          },
          "width": {
            "title": "Width when resizing (px)",
            "minimum": 16,
            "maximum": 1920,
            "type": "integer",
            "description": "resize: output width, 16 to 1920, height follows the aspect ratio (up or down; a portrait video is also kept within 1920 px high).",
            "default": 1280
          },
          "gifWidth": {
            "title": "GIF width (px)",
            "minimum": 64,
            "maximum": 800,
            "type": "integer",
            "description": "gif: 64 to 800 (never wider than the video). A GIF counts as one charged GIF up to 480x270 px at 10 fps and 15 s; bigger ones (also portrait videos at this width) count in proportion to pixels x frames.",
            "default": 480
          },
          "gifFps": {
            "title": "GIF frames per second",
            "minimum": 1,
            "maximum": 25,
            "type": "integer",
            "description": "gif: 1 to 25. 10 is smooth enough for most clips and keeps the file small.",
            "default": 10
          },
          "gifMaxSecs": {
            "title": "GIF max length (seconds)",
            "minimum": 0.5,
            "maximum": 15,
            "type": "number",
            "description": "gif: at most this many seconds from Start (0.5 to 15).",
            "default": 10
          },
          "maxInputMB": {
            "title": "Max input file size (MB)",
            "minimum": 1,
            "maximum": 2000,
            "type": "integer",
            "description": "Larger files are refused before or while downloading (free). Up to 2,000; big files also need more memory (more disk).",
            "default": 500
          },
          "maxDurationMin": {
            "title": "Max length to convert (minutes)",
            "minimum": 1,
            "maximum": 180,
            "type": "integer",
            "description": "Files whose part to convert is longer are refused after a quick look at the file (free). Up to 180.",
            "default": 30
          },
          "maxItems": {
            "title": "Max files",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Process at most this many URLs from the list (the run report counts the rest as skippedByMaxItems).",
            "default": 100
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}