{
  "openapi": "3.0.1",
  "info": {
    "title": "SRT & WebVTT to JSON Subtitle Chunker for RAG",
    "description": "Extract video transcripts and captions from SRT, WebVTT, or YouTube transcript datasets, then transform and process them into timestamped JSON chunks to prepare data for LLM and RAG. Whole cues stay intact with start/end times, cue numbers, stable IDs and SHA-256 hashes.",
    "version": "0.4",
    "x-build-id": "gzSnbdwVfkrDUocgA"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/skilled_glee~subtitle-rag-chunker/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-skilled_glee-subtitle-rag-chunker",
        "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/skilled_glee~subtitle-rag-chunker/runs": {
      "post": {
        "operationId": "runs-sync-skilled_glee-subtitle-rag-chunker",
        "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/skilled_glee~subtitle-rag-chunker/run-sync": {
      "post": {
        "operationId": "run-sync-skilled_glee-subtitle-rag-chunker",
        "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": {
          "items": {
            "title": "Subtitle inputs",
            "minItems": 1,
            "maxItems": 500,
            "type": "array",
            "description": "Independently processed subtitle inputs. Optional when urls, rawText, or datasetId is provided. Maximum 500 sources per run, including urls and dataset items.",
            "items": {
              "type": "object",
              "properties": {
                "sourceUrl": {
                  "title": "Public subtitle URL",
                  "type": "string",
                  "description": "Public HTTP(S) SRT or WebVTT URL."
                },
                "fileUrl": {
                  "title": "Public subtitle file URL",
                  "type": "string",
                  "description": "Public HTTP(S) UTF-8 subtitle-file URL."
                },
                "rawText": {
                  "title": "Raw subtitle text",
                  "type": "string",
                  "description": "SRT or WebVTT text; takes precedence over URLs."
                },
                "sourceName": {
                  "title": "Source name",
                  "type": "string",
                  "description": "Optional stable label for the subtitle source."
                },
                "chunkSize": {
                  "title": "Chunk size",
                  "type": "integer",
                  "description": "Optional per-item override of the top-level chunkSize.",
                  "minimum": 20,
                  "maximum": 20000
                },
                "overlap": {
                  "title": "Overlap",
                  "type": "integer",
                  "description": "Optional per-item override of the top-level overlap; must be smaller than chunk size.",
                  "minimum": 0,
                  "maximum": 19999
                },
                "chunkMode": {
                  "title": "Chunk mode",
                  "type": "string",
                  "description": "Optional per-item override: chars or time.",
                  "enum": [
                    "chars",
                    "time"
                  ]
                },
                "windowSeconds": {
                  "title": "Time window seconds",
                  "type": "integer",
                  "description": "Optional per-item override of windowSeconds when chunkMode is time.",
                  "minimum": 1,
                  "maximum": 86400
                }
              }
            }
          },
          "urls": {
            "title": "Subtitle URLs",
            "maxItems": 500,
            "type": "array",
            "description": "Public HTTP(S) SRT or WebVTT URLs, processed as additional sources. Combined with items and datasetId, at most 500 sources per run.",
            "items": {
              "type": "string"
            }
          },
          "datasetId": {
            "title": "Transcript dataset ID",
            "type": "string",
            "description": "Apify dataset of transcript records, typically from youtube-transcript-extractor (skilled_glee/youtube-transcript-extractor). Each successful item is mapped from videoId/url plus timed segments (start, duration, text) or fullText. Failed upstream items are recorded and not charged."
          },
          "datasetIds": {
            "title": "Transcript dataset IDs",
            "type": "array",
            "description": "Optional batch of dataset IDs with the same item mapping as datasetId."
          },
          "chunkSize": {
            "title": "Chunk size",
            "minimum": 20,
            "maximum": 20000,
            "type": "integer",
            "description": "Default maximum approximate characters per cue-preserving chunk when chunkMode is chars. Used when an item does not set its own chunkSize. Default 1500.",
            "default": 1500
          },
          "overlap": {
            "title": "Overlap",
            "minimum": 0,
            "maximum": 19999,
            "type": "integer",
            "description": "Default cue text carried into the next character-mode chunk. Must be smaller than chunkSize. Default 150. Per-item overlap still wins when set.",
            "default": 150
          },
          "chunkMode": {
            "title": "Chunk mode",
            "enum": [
              "chars",
              "time"
            ],
            "type": "string",
            "description": "chars (default) groups whole cues up to chunkSize. time groups whole cues into windows of windowSeconds, keeping cue timestamps.",
            "default": "chars"
          },
          "windowSeconds": {
            "title": "Time window seconds",
            "minimum": 1,
            "maximum": 86400,
            "type": "integer",
            "description": "Window length in seconds when chunkMode is time. Default 60. Cues are never split; a cue is kept in the window where it starts.",
            "default": 60
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}