{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Search Results & Rank Tracker Scraper",
    "description": "Give it keywords and get YouTube search results with rank, title, channel, views and duration. Rank tracker mode compares keyword rankings with the last run: rank change, new and dropped results, target videos or channels flagged, several countries per run. $0.24 per 1,000 results, failures free.",
    "version": "1.0",
    "x-build-id": "hcDQ6bObJnlTUYmEk"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/heyitsgautham~youtube-search-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-heyitsgautham-youtube-search-scraper",
        "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/heyitsgautham~youtube-search-scraper/runs": {
      "post": {
        "operationId": "runs-sync-heyitsgautham-youtube-search-scraper",
        "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/heyitsgautham~youtube-search-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-heyitsgautham-youtube-search-scraper",
        "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": {
          "queries": {
            "title": "Search queries",
            "type": "array",
            "description": "What you would type into the YouTube search box. One row per result, ranked in the order YouTube shows them.",
            "items": {
              "type": "string"
            }
          },
          "maxResultsPerQuery": {
            "title": "Max results per query",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Stops after this many results for each query. With result type All, YouTube often runs out of regular results after 30 to 60 and fills the feed with Shorts. Pick Videos for longer lists.",
            "default": 20
          },
          "type": {
            "title": "Result type",
            "enum": [
              "all",
              "video",
              "shorts",
              "channel",
              "playlist",
              "movie"
            ],
            "type": "string",
            "description": "Limit results to one type. All returns videos, channels and playlists as YouTube mixes them. Shorts rows get channel, exact views, duration and upload date from one extra small request each.",
            "default": "all"
          },
          "uploadDate": {
            "title": "Upload date",
            "enum": [
              "any",
              "hour",
              "today",
              "week",
              "month",
              "year"
            ],
            "type": "string",
            "description": "Only results uploaded within this window.",
            "default": "any"
          },
          "duration": {
            "title": "Duration",
            "enum": [
              "any",
              "short",
              "medium",
              "long"
            ],
            "type": "string",
            "description": "Under 4 minutes, 4 to 20 minutes, or over 20 minutes.",
            "default": "any"
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "relevance",
              "viewCount"
            ],
            "type": "string",
            "description": "Relevance or view count. YouTube removed sorting by upload date in 2025. Use the upload date filter instead.",
            "default": "relevance"
          },
          "features": {
            "title": "Features",
            "type": "array",
            "description": "Only results that have all of these features.",
            "items": {
              "type": "string",
              "enum": [
                "live",
                "4k",
                "hd",
                "subtitles",
                "creativeCommons",
                "360",
                "vr180",
                "hdr"
              ],
              "enumTitles": [
                "Live",
                "4K",
                "HD",
                "Subtitles/CC",
                "Creative Commons",
                "360°",
                "VR180",
                "HDR"
              ]
            }
          },
          "includeShortsShelves": {
            "title": "Include Shorts shelves",
            "type": "boolean",
            "description": "Also return the Shorts that YouTube shows in horizontal shelves between results. Each one gets channel, exact views, duration and upload date from one extra small request.",
            "default": false
          },
          "minSubscribers": {
            "title": "Min subscribers",
            "minimum": 0,
            "type": "integer",
            "description": "Optional. Keep only channels with at least this many subscribers, such as 10000. Uses the count YouTube shows, so 1.2M counts as 1,200,000. Turns the search into a channel search, and channels that hide their count are left out. Left-out channels are free."
          },
          "maxSubscribers": {
            "title": "Max subscribers",
            "minimum": 0,
            "type": "integer",
            "description": "Optional. Keep only channels with at most this many subscribers, such as 100000 to find small creators. Works alone or with Min subscribers."
          },
          "compareWithLastRun": {
            "title": "Compare with the last run (rank tracker)",
            "type": "boolean",
            "description": "Each result gets previousRank, rankChange (positive means it moved up) and isNew, against the last complete run of the same query, country, language, filters and max results in your account. Results from that run that are gone come back as free rows with status dropped. The first run has nothing to compare with, so those fields are null. History is kept in a key-value store named youtube-search-scraper-monitor in your account.",
            "default": false
          },
          "targets": {
            "title": "Target videos or channels",
            "type": "array",
            "description": "Optional. Your own or competitors' videos (URL or 11-character ID) and channels (@handle, channel URL or UC... ID). Results from them get isTarget: true, so you can filter to where they rank.",
            "items": {
              "type": "string"
            }
          },
          "videos": {
            "title": "Video URLs or IDs to look up",
            "type": "array",
            "description": "Optional. Get full details for specific videos: description, keywords, like count, category, upload date, live and Shorts flags. Accepts watch, youtu.be, Shorts, embed and live links, or 11-character IDs.",
            "items": {
              "type": "string"
            }
          },
          "language": {
            "title": "Interface language",
            "type": "string",
            "description": "YouTube interface language code such as en, es, de or hi. It changes text like \"3 days ago\" and \"views\".",
            "default": "en"
          },
          "country": {
            "title": "Country",
            "type": "string",
            "description": "Two-letter country code such as US, GB, IN or BR. Results are localised for this country, and the proxy uses IPs from it.",
            "default": "US"
          },
          "countries": {
            "title": "Several countries",
            "type": "array",
            "description": "Optional. Run every query once per country, such as US, GB and IN, each through residential IPs from that country. Every result row then has a country field. Replaces Country when set.",
            "items": {
              "type": "string"
            }
          },
          "proxyInCountry": {
            "title": "Route proxy through the country",
            "type": "boolean",
            "description": "Use residential IPs from the chosen country, so results match what local viewers see. Turn off to use IPs from any country.",
            "default": true
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "How many queries or video lookups run in parallel.",
            "default": 10
          },
          "useProxy": {
            "title": "Use residential proxy",
            "type": "boolean",
            "description": "Leave on. YouTube blocks cloud IPs.",
            "default": true
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}