{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Rank Checker - Keyword Positions for Videos & Channels",
    "description": "Check where a YouTube video or channel ranks in YouTube search for your keywords, by country and language. Get the rank, all positions, the matched video, the change since your last run and the top 10. $3 per 1,000 keyword checks; failed searches and invalid targets are free.",
    "version": "1.0",
    "x-build-id": "KowWRIUyLUY2E8lgj"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/tenfoldfleet~youtube-rank-checker/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-tenfoldfleet-youtube-rank-checker",
        "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/tenfoldfleet~youtube-rank-checker/runs": {
      "post": {
        "operationId": "runs-sync-tenfoldfleet-youtube-rank-checker",
        "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/tenfoldfleet~youtube-rank-checker/run-sync": {
      "post": {
        "operationId": "run-sync-tenfoldfleet-youtube-rank-checker",
        "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": [
          "keywords",
          "targets"
        ],
        "properties": {
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Search phrases to check, one per line, exactly as a viewer would type them into YouTube search. Up to 100 keywords per run (split bigger lists into several runs or a schedule). Works on the Apify free plan; the free plan's monthly credit covers about 1,500 keyword checks.",
            "items": {
              "type": "string"
            }
          },
          "targets": {
            "title": "Videos or channels to find",
            "type": "array",
            "description": "What to look for in the results: video URLs or 11-character video IDs (watch, youtu.be and /shorts/ links all work), channel IDs (UC...), @handles (a channel name without the @ is looked up as a handle) or channel URLs (/@name, /channel/UC..., /c/name, /user/name). Video IDs are checked first, so a typo is a free error item, not a charged row. A channel target ranks at the position of its best video. Up to 20 targets. Every keyword is checked for every target: 10 keywords x 3 targets = 30 checks.",
            "items": {
              "type": "string"
            }
          },
          "country": {
            "title": "Country (gl)",
            "type": "string",
            "description": "Two-letter country code of the YouTube results, e.g. US, GB, DE, IN, BR. Rankings differ by country. An unknown code stops the run with a free error item.",
            "default": "US"
          },
          "language": {
            "title": "Language (hl)",
            "type": "string",
            "description": "Interface language of the results, e.g. en, de, es, pt-BR, zh-TW. A code YouTube does not accept stops the run with a free error item.",
            "default": "en"
          },
          "depth": {
            "title": "How deep to look",
            "minimum": 10,
            "maximum": 100,
            "type": "integer",
            "description": "How many search results to scan per keyword, from 10 to 100 (20, 50 and 100 are the usual choices). A target that is not in that many results comes back with rank null (not in the top N). The price is the same at every depth.",
            "default": 50
          },
          "resultType": {
            "title": "Result type",
            "enum": [
              "all",
              "videos",
              "shorts"
            ],
            "type": "string",
            "description": "Rank among all results (long videos and standalone Shorts), long videos only, or Shorts only (the Shorts filter of YouTube search).",
            "default": "all"
          },
          "compareWithPreviousRun": {
            "title": "Compare with the previous run",
            "type": "boolean",
            "description": "Save every rank in a named key-value store and report previousRank, rankChange and movement (up, down, same, new, lost) on the next run. Turn it on and schedule the actor daily or weekly to track positions over time.",
            "default": true
          },
          "historyStoreName": {
            "title": "History store name",
            "type": "string",
            "description": "Name of the key-value store in your account that keeps the rank history. Use a different name for each project or client so their histories stay separate.",
            "default": "youtube-rank-history"
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "The Apify datacenter proxy is used by default and is enough for YouTube search. A residential group is replaced by datacenter.",
            "default": {
              "useApifyProxy": 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}