Oh interesting! I must have mixed my facts up or something, my bad. You’re right that it’s attributed to Zhuge Liang, but it seems like Wikipedia thinks it was a fictional story when attributed to Zhuge Liang, but it looks like he wasn’t the first to use this strategy and he wasn’t the last. Regardless, I was wrong about Sun Tzu having done it and I learned more about history, so thanks!
Here’s the Wikipedia article I was referring to: https://en.wikipedia.org/wiki/Empty_Fort_Strategy#Zhuge_Liang
I haven’t seen anyone mention it yet, but a reason might be that providing an API is cheaper than web scraping.
If people really want access to your data, they can just scrape your website, but that requires loading all the data through the website itself which requires loading millions or billions of video thumbnails, comments, descriptions, recommendations, etc. It’s much cheaper for them to send a JSON through an API, even though they might know that some people are trying to undermine them by using that data to circumvent their advertising.