{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Rank Checker & Search Scraper",
    "description": "Check where your videos and channel rank on YouTube for each keyword, by country and language, and scrape the full search results: position, video rank, page, title, channel, views, duration and publish time on every row. YouTube's own filters. No API key.",
    "version": "0.1",
    "x-build-id": "hzQTUP2ZeAchvd6xX"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/siteacs~youtube-search-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-siteacs-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/siteacs~youtube-search-scraper/runs": {
      "post": {
        "operationId": "runs-sync-siteacs-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/siteacs~youtube-search-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-siteacs-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",
        "required": [
          "queries"
        ],
        "properties": {
          "queries": {
            "title": "Search queries",
            "type": "array",
            "description": "Keywords or phrases, one per line, typed as you would type them into YouTube's search box. Each query is searched on its own. Use Bulk edit to paste a long list. Duplicates are searched once.",
            "items": {
              "type": "string"
            }
          },
          "maxResults": {
            "title": "Max results per query",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "How many result rows to save for each query, in YouTube's order. YouTube sends about 20 results per page; 100 results is about 5 pages. A query stops earlier when YouTube has no more results. For a rank check, this is the depth: a target below it is reported as \"not in the top N\".",
            "default": 100
          },
          "rankTargets": {
            "title": "Rank check: your videos, channels or playlists",
            "type": "array",
            "description": "Optional. The videos, channels or playlists whose rank you want for every query: a video URL or 11-character id, a channel URL, @handle or UC... id, or a playlist URL. Rows that match get isTarget: true, and a free summary row per query gives each target's best position, or \"not in the top N\". A channel matches every video, playlist and channel result of that channel, including collaboration videos it is part of. Two spellings of the same target (@Name and youtube.com/@name/videos) are checked once; the summary lists the other spelling in alsoGivenAs.",
            "items": {
              "type": "string"
            }
          },
          "rankSamples": {
            "title": "Rank samples per query",
            "minimum": 1,
            "maximum": 5,
            "type": "integer",
            "description": "YouTube shuffles its order a little on every load. Above 1, each query is searched this many times in all, to the same depth, from fresh sessions (new IP, no cookies), and the summary gives each target its median, best and worst position over the samples, the position in each sample and how many samples found it. Only the first search saves rows and is charged; the repeats are free. Used only with rank-check targets.",
            "default": 1
          },
          "type": {
            "title": "Result type",
            "enum": [
              "all",
              "video",
              "short",
              "channel",
              "playlist",
              "live",
              "movie"
            ],
            "type": "string",
            "description": "YouTube's own Type filter. Live now is YouTube's Live filter: streams that are on air.",
            "default": "all"
          },
          "uploadDate": {
            "title": "Upload date",
            "enum": [
              "any",
              "lastHour",
              "today",
              "thisWeek",
              "thisMonth",
              "thisYear"
            ],
            "type": "string",
            "description": "YouTube's Upload date filter.",
            "default": "any"
          },
          "duration": {
            "title": "Duration",
            "enum": [
              "any",
              "under3",
              "3to20",
              "over20"
            ],
            "type": "string",
            "description": "YouTube's Duration filter.",
            "default": "any"
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "relevance",
              "popularity"
            ],
            "type": "string",
            "description": "YouTube's Prioritize setting. YouTube no longer offers sorting by upload date or rating; for recent videos use the Upload date filter. Shorts searches are always in relevance order: YouTube's Popularity order leaves Shorts out.",
            "default": "relevance"
          },
          "country": {
            "title": "Country (gl)",
            "type": "string",
            "description": "Two-letter country code whose results you want, as YouTube's gl setting: US, GB, DE, BR, IN, ... Results and their order differ by country.",
            "default": "US"
          },
          "language": {
            "title": "Language (hl)",
            "type": "string",
            "description": "Interface language code, as YouTube's hl setting: en, de, pt, es, pt-BR, ... It sets the language of view counts and dates in the rows. Exact view counts are read in any language; publishedAt (an estimate from \"3 weeks ago\") is filled for English only, other languages keep YouTube's text in publishedTimeText.",
            "default": "en"
          },
          "includeShelves": {
            "title": "Save the videos inside shelves",
            "type": "boolean",
            "description": "YouTube mixes shelves into the results, mostly rows of Shorts. Off: a shelf takes its place in the position count, as on the page, but its videos are not saved (they repeat on later pages and would fill your results). On: they are saved too, with shelfTitle and positionInShelf. A Shorts search (Result type: Shorts) always saves them: for some keywords YouTube lists Shorts on their own, for others only in shelves. Rank-check targets are found inside shelves either way.",
            "default": false
          },
          "maxConcurrency": {
            "title": "Queries at a time",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "How many queries are searched in parallel. The pages of one query are always read in order.",
            "default": 5
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Apify datacenter proxy (the default) works for search; a request YouTube refuses is retried on another IP.",
            "default": {
              "useApifyProxy": true
            }
          },
          "residentialFallback": {
            "title": "Retry refused pages through residential proxy",
            "type": "boolean",
            "description": "On: a page YouTube still refuses after 6 datacenter IPs is tried through Apify residential proxy, at no extra charge to you; a Shorts search that finds no Shorts is asked again from a residential IP in Germany. Off: the query ends there and its summary row says why.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}