Skip to main content
POST
/
api
/
socialblade
/
youtube
/
channels
/
top
/socialblade/youtube/channels/top
curl --request POST \
  --url https://api.anysite.io/api/socialblade/youtube/channels/top \
  --header 'Content-Type: application/json' \
  --header 'access-token: <api-key>' \
  --data '
{
  "count": 50,
  "timeout": 300,
  "field": "subscribers",
  "category": "all",
  "country": "global"
}
'
import requests

url = "https://api.anysite.io/api/socialblade/youtube/channels/top"

payload = {
    "count": 50,
    "timeout": 300,
    "field": "subscribers",
    "category": "all",
    "country": "global"
}
headers = {
    "access-token": "<api-key>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
  method: 'POST',
  headers: {'access-token': '<api-key>', 'Content-Type': 'application/json'},
  body: JSON.stringify({
    count: 50,
    timeout: 300,
    field: 'subscribers',
    category: 'all',
    country: 'global'
  })
};

fetch('https://api.anysite.io/api/socialblade/youtube/channels/top', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.anysite.io/api/socialblade/youtube/channels/top",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => json_encode([
    'count' => 50,
    'timeout' => 300,
    'field' => 'subscribers',
    'category' => 'all',
    'country' => 'global'
  ]),
  CURLOPT_HTTPHEADER => [
    "Content-Type: application/json",
    "access-token: <api-key>"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.anysite.io/api/socialblade/youtube/channels/top"

	payload := strings.NewReader("{\n  \"count\": 50,\n  \"timeout\": 300,\n  \"field\": \"subscribers\",\n  \"category\": \"all\",\n  \"country\": \"global\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("access-token", "<api-key>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.anysite.io/api/socialblade/youtube/channels/top")
  .header("access-token", "<api-key>")
  .header("Content-Type", "application/json")
  .body("{\n  \"count\": 50,\n  \"timeout\": 300,\n  \"field\": \"subscribers\",\n  \"category\": \"all\",\n  \"country\": \"global\"\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://api.anysite.io/api/socialblade/youtube/channels/top")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["access-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"count\": 50,\n  \"timeout\": 300,\n  \"field\": \"subscribers\",\n  \"category\": \"all\",\n  \"country\": \"global\"\n}"

response = http.request(request)
puts response.read_body
[
  {
    "rank": 123,
    "id": "<string>",
    "@type": "YoutubeTopChannel",
    "name": "<string>",
    "alias": "<string>",
    "image": "<string>",
    "banner": "<string>",
    "country": "<string>",
    "channel_type": "<string>",
    "is_made_for_kids": true,
    "is_disabled": true,
    "created_at": 123,
    "subscriber_count": 123,
    "view_count": 123,
    "video_count": 123
  }
]
{
  "detail": [
    {
      "loc": [
        "<string>"
      ],
      "msg": "<string>",
      "type": "<string>",
      "input": "<unknown>",
      "ctx": {}
    }
  ]
}

Authorizations

access-token
string
header
required

API token from the dashboard

Headers

access-token
string
required

Body

application/json
count
integer
required
Required range: 1 <= x <= 100
timeout
integer
default:300
Required range: 20 <= x <= 1500
field
enum<string>
default:subscribers
Available options:
subscribers,
views,
videos
category
enum<string>
default:all
Available options:
all,
games,
entertainment,
people,
animals,
film,
music,
sports,
tech,
howto,
news,
education,
comedy,
nonprofit,
autos,
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
TK,
PM,
MW,
SB,
GW

Response

Successful Response

rank
integer
required
id
string
required
@type
string
default:YoutubeTopChannel
name
string | null
alias
string | null
image
string | null
banner
string | null
country
string | null
channel_type
string | null
is_made_for_kids
boolean | null
is_disabled
boolean | null
created_at
integer | null
subscriber_count
integer | null
view_count
integer | null
video_count
integer | null