{
  "openapi": "3.0.1",
  "info": {
    "title": "Video & Audio Trimmer – Cut MP4 & MP3 Clips by Timestamp",
    "description": "Cut clips from your video and audio files by start and end time: many clips per file, lossless fast cut (no re-encode) or frame-accurate cut, MP4, MOV, WebM, MP3, M4A and WAV. Optional fades and format change. Bulk from URLs, CSV or a dataset, with a download link per clip. $2 per 1,000 clips.",
    "version": "0.1",
    "x-build-id": "hHroGvYQ3bAP7VEL4"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/gazidev~video-trimmer/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-gazidev-video-trimmer",
        "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/gazidev~video-trimmer/runs": {
      "post": {
        "operationId": "runs-sync-gazidev-video-trimmer",
        "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/gazidev~video-trimmer/run-sync": {
      "post": {
        "operationId": "run-sync-gazidev-video-trimmer",
        "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": {
          "clips": {
            "title": "Clips (file URL + start + end)",
            "type": "array",
            "description": "One object per clip: `url` (direct link to a video or audio FILE), `start`, `end` and an optional `name` (used as the file name). Times: seconds (`90`), `01:30`, `00:01:30.5` or `1m30s`; leave `end` out to cut to the end of the file, or give `duration` instead. Several clips may share one URL: the file is downloaded once. YouTube/TikTok/Instagram pages are refused - this is a trimmer, not a downloader.",
            "default": [
              {
                "url": "https://download.samplelib.com/mp4/sample-10s.mp4",
                "start": "00:00:02",
                "end": "00:00:06",
                "name": "intro"
              },
              {
                "url": "https://download.samplelib.com/mp3/sample-9s.mp3",
                "start": "1",
                "end": "5"
              }
            ]
          },
          "mediaUrls": {
            "title": "Or: file URLs (same cuts for every file)",
            "type": "array",
            "description": "Direct links to video or audio files (MP4, MOV, WebM, MKV, MP3, M4A, WAV, FLAC, OGG...). Every file is cut with the `segments` below.",
            "items": {
              "type": "string"
            }
          },
          "segments": {
            "title": "Segments",
            "type": "array",
            "description": "Applied to every file in `mediaUrls`, `bulkText` and `datasetId` that has no own times. Formats: `00:01:00-00:01:30`, `90-120`, `90+30` (start + length), `90-` or `90-end` (to the end), `-30` (first 30 s). Several per line with commas also work.",
            "items": {
              "type": "string"
            }
          },
          "bulkText": {
            "title": "Bulk list (URLs or CSV)",
            "type": "string",
            "description": "One URL per line (cut with `segments`), or a CSV with the header `url,start,end,name` (also `segment` instead of start/end) - one row per clip."
          },
          "datasetId": {
            "title": "Read from an Apify dataset",
            "type": "string",
            "description": "Items with `start`/`end` (or `segment`) fields become clips; items with only a URL are cut with `segments`."
          },
          "datasetField": {
            "title": "Dataset field with the file URL",
            "type": "string",
            "description": "Field name in that dataset.",
            "default": "url"
          },
          "uploadedFiles": {
            "title": "Upload files from your computer",
            "type": "array",
            "description": "Upload video or audio files in the Console; they are cut with `segments`. This Actor runs with limited permissions, so ALSO select the store you uploaded into in 'Key-value store with your uploads'. When you upload files, the pre-filled demo clips are ignored."
          },
          "uploadStore": {
            "title": "Key-value store with your uploads",
            "type": "string",
            "description": "Grants this run read access to that store only. If `uploadedFiles` points into it, only those files are cut; otherwise every media file in the store is (up to 1,000)."
          },
          "mode": {
            "title": "Cut mode",
            "enum": [
              "fast",
              "accurate"
            ],
            "type": "string",
            "description": "`fast` copies the streams without re-encoding: no quality loss and very quick, but a video clip starts on the nearest keyframe at or BEFORE your start time (the row shows `actualStart`). Audio files (MP3, M4A, WAV) cut practically exactly. `accurate` re-encodes for a frame-exact start. A format change, fades or a max resolution switch to `accurate` automatically.",
            "default": "fast"
          },
          "outputFormat": {
            "title": "Output format",
            "enum": [
              "same",
              "mp4",
              "webm",
              "mov",
              "mp3",
              "m4a",
              "wav",
              "flac"
            ],
            "type": "string",
            "description": "Anything other than `same` re-encodes (mode `accurate`). Audio formats from a video file give the audio of the clip.",
            "default": "same"
          },
          "fadeInSec": {
            "title": "Fade in (seconds)",
            "minimum": 0,
            "maximum": 30,
            "type": "number",
            "description": "Video and audio fade-in at the start of every clip (re-encodes).",
            "default": 0
          },
          "fadeOutSec": {
            "title": "Fade out (seconds)",
            "minimum": 0,
            "maximum": 30,
            "type": "number",
            "description": "Fade-out at the end of every clip (re-encodes).",
            "default": 0
          },
          "maxResolution": {
            "title": "Max resolution (accurate mode)",
            "enum": [
              "source",
              "1080",
              "720",
              "480"
            ],
            "type": "string",
            "description": "Downscale the short side; never upscales. Re-encodes.",
            "default": "source"
          },
          "maxClipsPerFile": {
            "title": "Max clips per file",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Extra clips get a free error row.",
            "default": 50
          },
          "maxFileSizeMb": {
            "title": "Max input file size (MB)",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Larger files are skipped (free). Files are downloaded once; above ~2,000 MB give the run more memory (disk).",
            "default": 2000
          },
          "maxConcurrency": {
            "title": "Files in parallel",
            "minimum": 1,
            "maximum": 4,
            "type": "integer",
            "description": "Clips of one file are cut one after another.",
            "default": 2
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Only for hosts that block datacenter IPs (HTTP 403).",
            "default": {
              "useApifyProxy": 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
                  },
                  "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}