It's implicitly provided by hosting the forum, blog, etc. at a publicly accessible URL. HTTP is an API, HTML is a data interchange format. There's this weird idea (which I've seen parroted both in this article, and in u/spez's discourse on the topic) that "scraping" is somehow evil and bad, when it's actually an intentional feature of the web. Scraping is quite literally how Google built its search empire. It seems to me, now that the major players are sufficiently centralized and entrenched, they want to turn scraping into a boogeyman so nobody can follow in their wake.
The advantage of providing a "real" API is to (a) limit scope narrower than an account/session, and (b) eliminate the overhead implicit in laying out the content for human eyeballs; reducing processing costs for both the server and client.
I find it somewhat hypocritical for Reddit et al. to provide the former for free, and charge for the latter, when the latter is explicitly designed to optimize their costs.