There is no information about subscribers and views count while searching for channel for keyword. Fields ‘subscriberCountText’ and ‘videoCountText’ are empty strings.
In most cases, YouTube’s backend only provides the rendered text version of numeric data. Their text contents are directly displayed on the UI, and the format is not 100% guaranteed to be stable when the UI design is changed.
To get both subscribers and video stats of a channel, the possible solution is to use the endpoint /channel/details where you can get both subscriberCountText and videoCountText.
Can’t you just put result of subscribers number from statsText to subscriberCountText? I need pure number of subscribers in my application, so it would be tough for me to get that information from statsText while there would be also info about videoCountText.
We fixed the issue by introducing a new field statsText that contains a combination of a channel’s subscriberCountText and videoCountText (currently, 1 or 0 of them). The original fields are remained empty but not removed due to the concern about stability.
It looks weird, but it is currently how YouTube’s backend communicates with its UI. These two fields used to be severed.
By the way, if you want to parse the number of statsText, please note that it’s backend-rendered by YouTube, and the parameter lang can affect its content by translating it into another language; the format of the number is not fixed on our end. That’s why we don’t parse the number for API consumers, but consumers can do it simply with lang unchanged.
Aşağıya yorum ekleyerek tartışmaya katılın:
Yeni yorumlar göndermek için giriş yapın / kaydolun
For now I will base on your subscriber count based in statsText, thanks
In most cases, YouTube’s backend only provides the rendered text version of numeric data. Their text contents are directly displayed on the UI, and the format is not 100% guaranteed to be stable when the UI design is changed.
To get both subscribers and video stats of a channel, the possible solution is to use the endpoint
/channel/details
where you can get bothsubscriberCountText
andvideoCountText
.Or at least tell me how statsText will be looking. How it will be standarised, or propose other solution
Can’t you just put result of subscribers number from statsText to subscriberCountText? I need pure number of subscribers in my application, so it would be tough for me to get that information from statsText while there would be also info about videoCountText.
Hello. Thanks for choosing us.
We fixed the issue by introducing a new field
statsText
that contains a combination of a channel’ssubscriberCountText
andvideoCountText
(currently, 1 or 0 of them). The original fields are remained empty but not removed due to the concern about stability.It looks weird, but it is currently how YouTube’s backend communicates with its UI. These two fields used to be severed.
By the way, if you want to parse the number of
statsText
, please note that it’s backend-rendered by YouTube, and the parameterlang
can affect its content by translating it into another language; the format of the number is not fixed on our end. That’s why we don’t parse the number for API consumers, but consumers can do it simply withlang
unchanged.