{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube",
    "description": "Fast, affordable YouTube data scraper. Find videos by keyword, scrape channels and playlists, collect metadata, comments, replies and transcripts without a YouTube API key.",
    "version": "1.0",
    "x-build-id": "h51mCVt67yi3q92xs"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/lofomachines~youtube/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-lofomachines-youtube",
        "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/lofomachines~youtube/runs": {
      "post": {
        "operationId": "runs-sync-lofomachines-youtube",
        "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/lofomachines~youtube/run-sync": {
      "post": {
        "operationId": "run-sync-lofomachines-youtube",
        "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": {
          "startUrls": {
            "title": "YouTube URLs",
            "type": "array",
            "description": "Add one or more YouTube URLs. The Actor recognizes the content type automatically.",
            "default": [],
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "searchQueries": {
            "title": "Search keywords",
            "maxItems": 1000,
            "uniqueItems": true,
            "type": "array",
            "description": "Find YouTube videos, Shorts, channels or playlists for each keyword.",
            "items": {
              "type": "string",
              "minLength": 1
            },
            "default": []
          },
          "maxResults": {
            "title": "Maximum results per search or playlist",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Stops each keyword search or playlist after this many videos.",
            "default": 100
          },
          "searchType": {
            "title": "Result type",
            "enum": [
              "all",
              "video",
              "shorts",
              "channel",
              "playlist",
              "movie"
            ],
            "type": "string",
            "description": "Choose the kind of YouTube result returned for keyword searches.",
            "default": "video"
          },
          "uploadDate": {
            "title": "Upload date",
            "enum": [
              "all",
              "today",
              "week",
              "month",
              "year"
            ],
            "type": "string",
            "description": "Limit search results to videos uploaded during this period.",
            "default": "all"
          },
          "duration": {
            "title": "Video duration",
            "enum": [
              "all",
              "under_three_mins",
              "three_to_twenty_mins",
              "over_twenty_mins"
            ],
            "type": "string",
            "description": "Limit keyword results by the length of each video.",
            "default": "all"
          },
          "sortBy": {
            "title": "Sort results by",
            "enum": [
              "relevance",
              "popularity"
            ],
            "type": "string",
            "description": "Order keyword results by relevance or popularity.",
            "default": "relevance"
          },
          "features": {
            "title": "Video features",
            "type": "array",
            "description": "Optional. Return only videos matching every selected feature.",
            "items": {
              "type": "string",
              "enum": [
                "hd",
                "subtitles",
                "creative_commons",
                "3d",
                "live",
                "4k",
                "360",
                "location",
                "hdr",
                "vr180"
              ]
            },
            "default": []
          },
          "channelContentTypes": {
            "title": "Channel content",
            "type": "array",
            "description": "Choose the channel tabs to collect from every channel URL.",
            "items": {
              "type": "string",
              "enum": [
                "videos",
                "shorts",
                "live",
                "playlists"
              ]
            },
            "default": [
              "videos"
            ]
          },
          "maxVideosPerChannel": {
            "title": "Maximum videos per channel tab",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Stops each selected channel tab after this many videos.",
            "default": 100
          },
          "scrapeVideoDetails": {
            "title": "Collect full video metadata",
            "type": "boolean",
            "description": "Adds full description, exact duration, views, likes, category, keywords, flags and available caption languages.",
            "default": true
          },
          "includeTranscripts": {
            "title": "Include transcripts",
            "type": "boolean",
            "description": "Adds the complete transcript and timestamped segments when captions are available.",
            "default": false
          },
          "transcriptLanguage": {
            "title": "Preferred transcript language",
            "type": "string",
            "description": "Language code such as en, es, it or de. Falls back to an available caption track.",
            "default": "en"
          },
          "includeRelatedVideos": {
            "title": "Include related videos",
            "type": "boolean",
            "description": "Adds the recommendations shown beside each video.",
            "default": false
          },
          "downloadYoutubeVideo": {
            "title": "Download YouTube videos",
            "type": "boolean",
            "description": "Save each selected video as an MP4 file in the run's key-value store.",
            "default": false
          },
          "videoDownloadQuality": {
            "title": "Video download quality",
            "enum": [
              "360p",
              "480p",
              "720p",
              "1080p",
              "best",
              "bestefficiency"
            ],
            "type": "string",
            "description": "Choose the preferred MP4 quality. YouTube may provide a lower available quality for some videos.",
            "default": "360p"
          },
          "maxVideoDownloads": {
            "title": "Maximum videos to download",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Safety limit for downloaded video files across the entire run.",
            "default": 1
          },
          "maxCommentsPerVideo": {
            "title": "Maximum comments per video",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Collect up to this many top-level comments for each video; use 0 to skip comments.",
            "default": 0
          },
          "commentSort": {
            "title": "Comment order",
            "enum": [
              "top",
              "newest"
            ],
            "type": "string",
            "description": "Collect the most relevant comments or newest comments first.",
            "default": "top"
          },
          "includeReplies": {
            "title": "Include replies",
            "type": "boolean",
            "description": "Collect replies beneath each saved top-level comment.",
            "default": true
          },
          "maxRepliesPerComment": {
            "title": "Maximum replies per comment",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "Stops each reply thread after this many replies.",
            "default": 20
          },
          "language": {
            "title": "Language code",
            "type": "string",
            "description": "Two-letter language code used to localize YouTube results, such as en, es or it.",
            "default": "en"
          },
          "location": {
            "title": "Country code",
            "type": "string",
            "description": "Two-letter country code used to localize YouTube results, such as US, IT or GB.",
            "default": "US"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}