{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Video Clipper (Trim, Crop and Download)",
    "description": "Trim, crop and download YouTube videos. Specify timestamps to extract single or multiple clips per URL, choose an aspect ratio for Shorts/TikTok, optionally export audio, GIF or a transcript of the clip.",
    "version": "0.0",
    "x-build-id": "xaWU67xlHAtBfCKDs"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/lurkapi~youtube-video-clipper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-lurkapi-youtube-video-clipper",
        "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/lurkapi~youtube-video-clipper/runs": {
      "post": {
        "operationId": "runs-sync-lurkapi-youtube-video-clipper",
        "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/lurkapi~youtube-video-clipper/run-sync": {
      "post": {
        "operationId": "run-sync-lurkapi-youtube-video-clipper",
        "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": [
          "videoUrls"
        ],
        "properties": {
          "videoUrls": {
            "title": "YouTube Video URLs",
            "maxItems": 1000,
            "type": "array",
            "description": "Paste your YouTube video links here. Supports video URLs, short links (youtu.be/...), Shorts, and playlist URLs.",
            "items": {
              "type": "string",
              "pattern": "^https?://(www\\.|music\\.|m\\.)?youtube\\.com/|^https?://youtu\\.be/"
            }
          },
          "startTime": {
            "title": "Start Time",
            "type": "string",
            "description": "Clip start, as HH:MM:SS or seconds (e.g. 90 or 00:01:30). Leave empty to download the full video. Ignored if 'Clips' is provided below."
          },
          "endTime": {
            "title": "End Time",
            "type": "string",
            "description": "Clip end, as HH:MM:SS or seconds. Must be greater than Start Time."
          },
          "clips": {
            "title": "Clips (multi-clip mode)",
            "type": "array",
            "description": "Define multiple clips per URL. Each entry is { \"name\": \"optional label\", \"startTime\": \"HH:MM:SS\", \"endTime\": \"HH:MM:SS\" }. When provided, Start Time / End Time above are ignored. Each URL is cut into every clip in this list — N URLs × M clips = N×M output rows."
          },
          "aspectRatio": {
            "title": "Aspect Ratio",
            "enum": [
              "original",
              "9:16",
              "2:3",
              "4:5",
              "1:1",
              "4:3",
              "16:9"
            ],
            "type": "string",
            "description": "Crop the output to a target aspect ratio (auto-centered). Pick the format your target platform prefers. 'original' keeps the source ratio.",
            "default": "original"
          },
          "manualCrop": {
            "title": "Manual Crop (advanced)",
            "type": "object",
            "description": "Override the aspect ratio with a precise crop rectangle in source pixels: { \"x\": 0, \"y\": 0, \"width\": 1080, \"height\": 1920 }. Leave empty to use Aspect Ratio above."
          },
          "quality": {
            "title": "Video Quality",
            "enum": [
              "best",
              "1080p",
              "720p",
              "480p",
              "360p"
            ],
            "type": "string",
            "description": "Source quality to download before trimming. 'best' uses the highest available (up to 4K).",
            "default": "720p"
          },
          "format": {
            "title": "Output Format",
            "enum": [
              "mp4",
              "webm"
            ],
            "type": "string",
            "description": "Container format for the video clip.",
            "default": "mp4"
          },
          "extractAudio": {
            "title": "Also export audio as a separate file ($)",
            "type": "boolean",
            "description": "Save the clip's audio as a separate file alongside the video. Charged per clip.",
            "default": false
          },
          "audioFormat": {
            "title": "Audio Format",
            "enum": [
              "mp3",
              "m4a",
              "wav"
            ],
            "type": "string",
            "description": "Container for the separately-exported audio.",
            "default": "mp3"
          },
          "renderGif": {
            "title": "Render a GIF of the clip ($)",
            "type": "boolean",
            "description": "Generate an animated GIF of each clip. Charged per clip.",
            "default": false
          },
          "gifResolution": {
            "title": "GIF Resolution",
            "enum": [
              "240p",
              "360p",
              "480p",
              "720p"
            ],
            "type": "string",
            "description": "Height of the GIF in pixels. Lower = smaller file. GIFs grow quickly: a 60-second 480p GIF is around 20 MB.",
            "default": "480p"
          },
          "gifFps": {
            "title": "GIF Frame Rate",
            "minimum": 5,
            "maximum": 30,
            "type": "integer",
            "description": "Frames per second. Lower = smaller file. 15 fps looks fine for most content; 24 fps is smoother but ~60% larger.",
            "default": 15
          },
          "transcript": {
            "title": "Include a transcript of the clip ($)",
            "type": "boolean",
            "description": "Extract a transcript and slice it to the clip's time range (or the full video if no clip is set). Charged per source video.",
            "default": false
          },
          "transcriptLang": {
            "title": "Transcript Language",
            "enum": [
              "en",
              "es",
              "fr",
              "de",
              "it",
              "pt",
              "ja",
              "ko",
              "zh",
              "zh-Hans",
              "zh-Hant",
              "ar",
              "hi",
              "ru",
              "id",
              "tr",
              "vi",
              "th",
              "nl",
              "pl",
              "sv",
              "no",
              "da",
              "fi",
              "he",
              "cs",
              "ro",
              "hu",
              "el",
              "uk",
              "bg",
              "hr",
              "sk",
              "sl"
            ],
            "type": "string",
            "description": "Preferred transcript language. Falls back to English auto-generated if not available.",
            "default": "en"
          },
          "transcriptFormat": {
            "title": "Transcript Format",
            "enum": [
              "plain",
              "timestamped",
              "srt",
              "vtt",
              "json",
              "csv",
              "xml",
              "all"
            ],
            "type": "string",
            "description": "Output format for the transcript.",
            "default": "plain"
          },
          "includeSubtitles": {
            "title": "Include raw YouTube subtitle tracks",
            "type": "boolean",
            "description": "Save YouTube's existing subtitle tracks for the source video as .srt files. Free.",
            "default": false
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}