ViewStats API - PHP

PeraNETWORK

Newbie
Joined
Aug 5, 2021
Messages
25
Reaction score
20
Hello BHW family,

Today, I want to introduce you to the PHP library I developed for https://viewstats.com. Recently, I needed to pull data from Socialblade.com, but I faced several challenges that made this process quite difficult. I was frequently encountering issues with VPN and proxy access while scraping, and finding a suitable API service was also not easy (only a business API was available).

Therefore, I conducted research on ViewStats.com, which operates on a similar structure to that of MrBeast. However, during my investigations, I noticed a problem: while sending my requests normally, the responses I received were in an encrypted format. At first, I thought this was due to "gzip" compression, but it turned out not to be the case.

Upon examining the JavaScript code of ViewStats.com, I realized they were using an encrypt-decrypt mechanism. After deciphering this encryption algorithm, I quickly developed a PHP library and began retrieving all the data in JSON format.

Screenshot 2024-09-30 at 20.56.41.png


Usage:

Screenshot 2024-09-30 at 20.57.38.png


Some Endpoints:

Screenshot 2024-09-30 at 20.57.42.png


Maybe if you have any projects on YouTube, you can use my library to create easy and user-friendly apps. You won’t have to deal with the annoying Google API anymore.

Github:
https://github.com/peranetwork/viewstats-api

If you have any questions, feel free to DM me or write in this topic.
Thank you. :smirk:
 
HI @PeraNETWORK, That's a great solution which I am planning to use it but I am more interested in how you figured out the encrypt-decrypt mechanism from the JavaScript code. Can you please explain the process of identifying this with screenshots or maybe a video.

Thanks
 
nice, health to your hands. but since you made it public, the site owner will change the encryption method. even “zainkhana 10x” can be the site owner : ) You can use innertube without apikey for the data you want to pull.
 
Last edited:
I am not the owner @Kokoin. I converted this code into JS to use in my application. Just asking for learning purposes, how he identified this. I agree PeraNETWORK should delete this, so I can work long term
 
What wait viewstats.com owner is mrbeast, did they hired you or what.
 
Back
Top