{
  "openapi": "3.0.1",
  "info": {
    "title": "Media Downloader - All-in-One Video, Audio and Metadata",
    "description": "Download permitted public videos or audio from many supported media sites with yt-dlp, save files to Apify key-value storage, and return clean MCP-ready metadata rows with honest success, partial, empty, and upstream-failed summaries.",
    "version": "0.1",
    "x-build-id": "FedVnxAMDsLCKu0r2"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/khadinakbar~all-in-one-media-downloader/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-khadinakbar-all-in-one-media-downloader",
        "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/khadinakbar~all-in-one-media-downloader/runs": {
      "post": {
        "operationId": "runs-sync-khadinakbar-all-in-one-media-downloader",
        "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/khadinakbar~all-in-one-media-downloader/run-sync": {
      "post": {
        "operationId": "run-sync-khadinakbar-all-in-one-media-downloader",
        "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": [
          "startUrls",
          "authorizationConfirmed"
        ],
        "properties": {
          "startUrls": {
            "title": "Media page URLs",
            "type": "array",
            "description": "Full media page URLs to process, for example https://www.youtube.com/watch?v=dQw4w9WgXcQ or a public Vimeo, TikTok, Instagram, Reddit, SoundCloud, Dailymotion, Pinterest, or X/Twitter media URL. Accepts Apify request-list objects with a url field. Defaults to one sample public YouTube URL. NOT a keyword search box or a way to access private media without permission.",
            "items": {
              "type": "object"
            }
          },
          "authorizationConfirmed": {
            "title": "I have permission to download these media files",
            "type": "boolean",
            "description": "Confirms that you own the media, have permission from the rights holder, or are otherwise legally allowed to download it. The actor stops with INVALID_INPUT if this is false. Defaults to false so accidental runs do not download files. NOT a bypass for copyright, paywalls, DRM, private accounts, or access controls.",
            "default": false
          },
          "downloadMode": {
            "title": "Download mode",
            "enum": [
              "video",
              "audio",
              "metadataOnly"
            ],
            "type": "string",
            "description": "What to save for each URL. video saves a playable video file, audio saves audio only, and metadataOnly extracts metadata plus an expiring direct media URL when available. Defaults to video. NOT a transcript, comments, or profile scraper.",
            "default": "video"
          },
          "preferredQuality": {
            "title": "Maximum video quality",
            "enum": [
              "360p",
              "480p",
              "720p",
              "1080p",
              "best"
            ],
            "type": "string",
            "description": "Maximum video height when downloadMode is video. Choose 360p, 480p, 720p, 1080p or best. Defaults to 720p to keep files and platform usage manageable. NOT an upscaler; it cannot create higher quality than the source provides.",
            "default": "720p"
          },
          "preferredContainer": {
            "title": "Preferred video container",
            "enum": [
              "mp4",
              "webm",
              "any"
            ],
            "type": "string",
            "description": "Preferred container for video downloads. mp4 is the most compatible option, webm keeps many native web formats, and any lets yt-dlp choose. Defaults to mp4. NOT guaranteed if the source only provides another format.",
            "default": "mp4"
          },
          "audioFormat": {
            "title": "Audio format",
            "enum": [
              "m4a",
              "mp3",
              "best"
            ],
            "type": "string",
            "description": "Audio output when downloadMode is audio. m4a is fast and compatible, mp3 transcodes with ffmpeg, and best keeps the best source audio. Defaults to m4a. Ignored for video and metadata-only runs.",
            "default": "m4a"
          },
          "includePlaylists": {
            "title": "Expand playlists or multi-video pages",
            "type": "boolean",
            "description": "When true, playlist-like URLs are expanded into individual media URLs up to maxItems. Defaults to false so a single URL means one media item. Use this for YouTube playlists or supported albums only when you expect multiple files. NOT a site crawler.",
            "default": false
          },
          "maxItems": {
            "title": "Maximum media items",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Maximum number of URLs or playlist entries to process in one run. Defaults to 20 and accepts 1 to 500. This also caps the number of billable success events. NOT a guaranteed result count if some URLs are private, too large, removed, or unsupported.",
            "default": 20
          },
          "maxDurationMinutes": {
            "title": "Max duration in minutes",
            "minimum": 1,
            "maximum": 720,
            "type": "integer",
            "description": "Skip media longer than this many minutes before downloading. Defaults to 60 minutes and accepts 1 to 720. Use this to avoid podcasts, livestreams, or very long recordings. NOT a clipper; the actor downloads the full source item if it passes this cap.",
            "default": 60
          },
          "maxFileSizeMb": {
            "title": "Max file size in MB",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Delete and mark a download as skipped if the final file is larger than this limit. Defaults to 250 MB and accepts 1 to 1000. Lower this for agent workflows where small files matter. NOT a compression target.",
            "default": 250
          },
          "includeMetadataJson": {
            "title": "Save raw metadata JSON",
            "type": "boolean",
            "description": "Save raw yt-dlp metadata JSON for each successfully probed URL to the key-value store. Useful for audits, platform-specific fields, and downstream processing. Defaults to true. NOT required for the dataset row, which always includes concise normalized metadata.",
            "default": true
          },
          "cookiesTxt": {
            "title": "Cookies.txt (optional)",
            "type": "string",
            "description": "Optional Netscape cookies.txt content for media you are allowed to access with your own logged-in session. Paste only cookies you are authorized to use. Leave empty for public media. NOT a username, password, or bypass for DRM/paywalls/private content."
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Apify proxy used for media page requests. Residential proxies are enabled by default because social and video platforms often rate-limit datacenter IPs. Change only when your target media works from another network. NOT required for direct public files that allow datacenter traffic.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ]
            }
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}