{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Trending Scraper - Charts, Shorts & Music",
    "description": "Scrape YouTube trending videos and the official YouTube Charts for 68 countries: rank, previous rank, places climbed, views, channel, artists and release date. Covers trending videos, top music videos, top Shorts tracks, top songs and top artists. No API key and no browser.",
    "version": "0.1",
    "x-build-id": "bsrZOQPxNl5QbXGIU"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrapesage~youtube-trending-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrapesage-youtube-trending-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/scrapesage~youtube-trending-scraper/runs": {
      "post": {
        "operationId": "runs-sync-scrapesage-youtube-trending-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/scrapesage~youtube-trending-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-scrapesage-youtube-trending-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": {
          "charts": {
            "title": "Charts",
            "type": "array",
            "description": "Which YouTube charts to pull. Leave empty to run a small sample (US trending videos).",
            "items": {
              "type": "string",
              "enum": [
                "trendingVideos",
                "topVideos",
                "topVideosWeekly",
                "topShorts",
                "topShortsWeekly",
                "topSongs",
                "topArtists"
              ],
              "enumTitles": [
                "Trending videos (trendingVideos)",
                "Top music videos (daily) (topVideos)",
                "Top music videos (weekly) (topVideosWeekly)",
                "Top Shorts tracks (daily) (topShorts)",
                "Top Shorts tracks (weekly) (topShortsWeekly)",
                "Top songs (weekly) (topSongs)",
                "Top artists (weekly) (topArtists)"
              ]
            }
          },
          "countries": {
            "title": "Countries",
            "type": "array",
            "description": "Which countries to pull each chart for. YouTube publishes charts for these 68 markets only.",
            "items": {
              "type": "string",
              "enum": [
                "ae",
                "ar",
                "at",
                "au",
                "be",
                "bo",
                "br",
                "ca",
                "ch",
                "cl",
                "co",
                "cr",
                "cz",
                "de",
                "dk",
                "do",
                "ec",
                "ee",
                "eg",
                "es",
                "fi",
                "fr",
                "gb",
                "gt",
                "hk",
                "hn",
                "hu",
                "id",
                "ie",
                "il",
                "in",
                "is",
                "it",
                "jp",
                "ke",
                "kr",
                "lu",
                "mx",
                "my",
                "ng",
                "ni",
                "nl",
                "no",
                "nz",
                "pa",
                "pe",
                "ph",
                "pl",
                "pt",
                "py",
                "ro",
                "rs",
                "ru",
                "sa",
                "se",
                "sg",
                "sv",
                "th",
                "tr",
                "tw",
                "tz",
                "ua",
                "ug",
                "us",
                "uy",
                "vn",
                "za",
                "zw"
              ],
              "enumTitles": [
                "United Arab Emirates (ae)",
                "Argentina (ar)",
                "Austria (at)",
                "Australia (au)",
                "Belgium (be)",
                "Bolivia (bo)",
                "Brazil (br)",
                "Canada (ca)",
                "Switzerland (ch)",
                "Chile (cl)",
                "Colombia (co)",
                "Costa Rica (cr)",
                "Czechia (cz)",
                "Germany (de)",
                "Denmark (dk)",
                "Dominican Republic (do)",
                "Ecuador (ec)",
                "Estonia (ee)",
                "Egypt (eg)",
                "Spain (es)",
                "Finland (fi)",
                "France (fr)",
                "United Kingdom (gb)",
                "Guatemala (gt)",
                "Hong Kong (hk)",
                "Honduras (hn)",
                "Hungary (hu)",
                "Indonesia (id)",
                "Ireland (ie)",
                "Israel (il)",
                "India (in)",
                "Iceland (is)",
                "Italy (it)",
                "Japan (jp)",
                "Kenya (ke)",
                "South Korea (kr)",
                "Luxembourg (lu)",
                "Mexico (mx)",
                "Malaysia (my)",
                "Nigeria (ng)",
                "Nicaragua (ni)",
                "Netherlands (nl)",
                "Norway (no)",
                "New Zealand (nz)",
                "Panama (pa)",
                "Peru (pe)",
                "Philippines (ph)",
                "Poland (pl)",
                "Portugal (pt)",
                "Paraguay (py)",
                "Romania (ro)",
                "Serbia (rs)",
                "Russia (ru)",
                "Saudi Arabia (sa)",
                "Sweden (se)",
                "Singapore (sg)",
                "El Salvador (sv)",
                "Thailand (th)",
                "Turkey (tr)",
                "Taiwan (tw)",
                "Tanzania (tz)",
                "Ukraine (ua)",
                "Uganda (ug)",
                "United States (us)",
                "Uruguay (uy)",
                "Vietnam (vn)",
                "South Africa (za)",
                "Zimbabwe (zw)"
              ]
            }
          },
          "maxItemsPerChart": {
            "title": "Max rows per chart",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Upper bound per chart+country pull. YouTube publishes 30 trending videos, 50 Shorts tracks and 100 for the other charts.",
            "default": 100
          },
          "onlyRisingEntries": {
            "title": "Only rising entries",
            "type": "boolean",
            "description": "Keep only entries that climbed the chart since the previous period. Trending videos carry no previous rank, so this filter empties that chart.",
            "default": false
          },
          "minRankChange": {
            "title": "Minimum rank climb",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Keep only entries that climbed at least this many places. 0 disables the filter.",
            "default": 0
          },
          "outputFields": {
            "title": "Output fields",
            "type": "array",
            "description": "Limit the columns written to the dataset. Leave empty for every field.",
            "items": {
              "type": "string",
              "enum": [
                "type",
                "chart",
                "chartLabel",
                "chartType",
                "period",
                "listType",
                "chartDate",
                "countryCode",
                "country",
                "entryKind",
                "rank",
                "previousRank",
                "rankChange",
                "periodsOnChart",
                "viewsChangePercent",
                "viewCount",
                "thumbnailUrl",
                "artists",
                "releaseDate",
                "entryId",
                "title",
                "videoId",
                "videoUrl",
                "durationSeconds",
                "channelName",
                "channelId",
                "channelUrl",
                "label",
                "songwriters",
                "songProducers",
                "scrapedAt"
              ],
              "enumTitles": [
                "Row type (type)",
                "Chart key (chart)",
                "Chart name (chartLabel)",
                "Chart type (raw) (chartType)",
                "Period (daily/weekly) (period)",
                "List type (raw) (listType)",
                "Chart date (chartDate)",
                "Country code (countryCode)",
                "Country (country)",
                "Entry kind (video/track/artist) (entryKind)",
                "Rank on the chart (rank)",
                "Rank last period (previousRank)",
                "Places climbed (+) or fallen (-) (rankChange)",
                "Periods on the chart (periodsOnChart)",
                "View change vs last period (%) (viewsChangePercent)",
                "Views (viewCount)",
                "Thumbnail (thumbnailUrl)",
                "Artists (artists)",
                "Release date (releaseDate)",
                "Entry ID (entryId)",
                "Title (title)",
                "YouTube video ID (videoId)",
                "YouTube video link (videoUrl)",
                "Duration (seconds) (durationSeconds)",
                "Channel name (channelName)",
                "Channel ID (channelId)",
                "Channel link (channelUrl)",
                "Record label (label)",
                "Songwriters (songwriters)",
                "Producers (songProducers)",
                "Scraped at (scrapedAt)"
              ]
            }
          },
          "language": {
            "title": "Language",
            "type": "string",
            "description": "Language code for chart labels, e.g. en, es, de.",
            "default": "en"
          },
          "monitorMode": {
            "title": "Monitor mode (only new entries)",
            "type": "boolean",
            "description": "Remember entries already returned and emit only new ones on the next run. Nothing is charged for skipped rows.",
            "default": false
          },
          "monitorStoreName": {
            "title": "Monitor store name",
            "type": "string",
            "description": "Named key-value store holding the memory for monitor mode.",
            "default": "youtube-trending-monitor"
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 8,
            "type": "integer",
            "description": "How many chart pulls to run at once.",
            "default": 3
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Apify Proxy. The datacenter pool included with every plan is enough - this Actor reads a public JSON endpoint and needs no residential traffic.",
            "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}