{
  "openapi": "3.0.1",
  "info": {
    "title": "Video to GIF & WebP Preview - Auto Best Clip, Size Target",
    "description": "Turn video files into short looping GIF and animated WebP previews (+ optional MP4 loop and thumbnail). Auto-picks the most active, sharp, non-black seconds, or your own clip, or one preview per scene. Fits a file-size target (e.g. under 2 MB). $0.014 per preview.",
    "version": "1.0",
    "x-build-id": "sbtDTH2S1FS8BeFqc"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/kantolabs~video-to-gif/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-kantolabs-video-to-gif",
        "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/kantolabs~video-to-gif/runs": {
      "post": {
        "operationId": "runs-sync-kantolabs-video-to-gif",
        "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/kantolabs~video-to-gif/run-sync": {
      "post": {
        "operationId": "run-sync-kantolabs-video-to-gif",
        "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": "Video file URLs",
            "type": "array",
            "description": "Direct links to video FILES (MP4, MOV, WEBM, MKV, M4V, AVI...), one per line: your storage, S3/R2/GCS (public or pre-signed URLs), a CDN, an Apify key-value store, Dropbox or Google Drive share links ('anyone with the link'). YouTube, TikTok, Instagram and other platform pages are refused.",
            "default": [
              "https://api.apify.com/v2/key-value-stores/aXcXwfChlioPWAUJv/records/sample-creative-ad.mp4?signature=1yQpP7ggbJGjS4rGodq21"
            ],
            "items": {
              "type": "string"
            }
          },
          "mode": {
            "title": "Which part of the video",
            "enum": [
              "auto",
              "clip",
              "scenes"
            ],
            "type": "string",
            "description": "auto = the best seconds (most motion, sharp, no black frames, no hard cut inside). clip = the span you set with 'Start time' + 'Clip length'. scenes = one preview per scene (cut detection), up to 'Max scenes'.",
            "default": "auto"
          },
          "clipSeconds": {
            "title": "Clip length (seconds)",
            "minimum": 0.2,
            "maximum": 30,
            "type": "number",
            "description": "Length of each preview. 2-4 s makes small, smooth loops; GIF size grows with every second. Max 30.",
            "default": 3
          },
          "startSeconds": {
            "title": "Start time (clip mode)",
            "type": "string",
            "description": "Where the clip starts in 'clip' mode: seconds (12.5) or MM:SS (1:05) or HH:MM:SS. Ignored by auto and scenes.",
            "default": "0"
          },
          "previewCount": {
            "title": "Previews per video (auto mode)",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Auto mode: the N best non-overlapping spans (best first). Each preview is one charged event.",
            "default": 1
          },
          "maxScenes": {
            "title": "Max scenes (scenes mode)",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Scenes mode: at most this many previews per video (the longest scenes, in time order). Scenes shorter than 0.8 s and black scenes are skipped.",
            "default": 10
          },
          "formats": {
            "title": "Output formats",
            "type": "array",
            "description": "Files made for every preview (all included in the one preview price): gif (works everywhere, email, Slack, GitHub), webp (animated WebP, ~10x smaller than GIF, all modern browsers), mp4 (muted H.264 loop for web/social). A JPEG thumbnail is always added.",
            "items": {
              "type": "string",
              "enum": [
                "gif",
                "webp",
                "mp4"
              ],
              "enumTitles": [
                "GIF",
                "Animated WebP",
                "MP4 loop (muted)"
              ]
            },
            "default": [
              "gif",
              "webp"
            ]
          },
          "width": {
            "title": "Width (px)",
            "minimum": 64,
            "maximum": 1920,
            "type": "integer",
            "description": "Output width; height follows the video's aspect ratio. Never upscaled beyond the source. 480 is the usual GIF size; 320 for small email/chat previews.",
            "default": 480
          },
          "fps": {
            "title": "Frames per second",
            "minimum": 2,
            "maximum": 30,
            "type": "number",
            "description": "10-15 looks smooth for GIFs; lower = smaller files. Never above the source frame rate.",
            "default": 12
          },
          "loop": {
            "title": "Loop forever",
            "type": "boolean",
            "description": "On: GIF/WebP loop endlessly. Off: they play once and stop on the last frame.",
            "default": true
          },
          "quality": {
            "title": "Quality",
            "enum": [
              "high",
              "balanced",
              "small"
            ],
            "type": "string",
            "description": "high = smoothest colours (error-diffusion dither, largest GIF). balanced = ordered dither + light denoise (smaller, clean). small = 128 colours, lower WebP/MP4 quality.",
            "default": "balanced"
          },
          "maxFileSizeMb": {
            "title": "Max file size per preview file (MB)",
            "minimum": 0,
            "maximum": 100,
            "type": "number",
            "description": "Optional size target, e.g. 2 for email/Slack or 8 for Discord. Each file that is too big is re-encoded with fewer colours / lower quality, then lower fps and width, until it fits (down to 160 px / 5 fps). 0 = no target.",
            "default": 0
          },
          "maxDurationMinutes": {
            "title": "Max video length (minutes)",
            "minimum": 1,
            "maximum": 600,
            "type": "integer",
            "description": "Longer videos are skipped (free). Up to 600.",
            "default": 180
          },
          "maxVideoSizeMb": {
            "title": "Max video size (MB)",
            "minimum": 1,
            "maximum": 4000,
            "type": "integer",
            "description": "Larger files are skipped (free).",
            "default": 2000
          },
          "downloadTimeoutSecs": {
            "title": "Download timeout (seconds)",
            "minimum": 10,
            "maximum": 3600,
            "type": "integer",
            "description": "Give up on a video that does not download within this time (free).",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}