in reply to Re: Running JavaScript from within Perl (or just use the API)
in thread Running JavaScript from within Perl

I tried following the A Beginners’s Guide to the WordPress REST API tutorial

It didn't work for my own (free) WordPress account, but when I used the "the-art-of-autism.com" (a premium account on which I have admin privileges) in place of "yourdomain.com" I was able to follow the tutorial successfully.

However, none of the Routes or Endpoints seem to give me what I want, which is the number of followers for an arbitrary WordPress account on which I don't have admin privileges. I'm encouraged by the REST API Handbook Reference page stating "The REST API provides public data accessible to any client anonymously, as well as private data only available after authentication."

I can't find any way to determine the number of followers, or what public data is accessible anonymously. Can you help with either of those? Thanks.

  • Comment on Re^2: Running JavaScript from within Perl (or just use the API)

Replies are listed 'Best First'.
Re^3: Running JavaScript from within Perl (or just use the API)
by Corion (Patriarch) on Sep 13, 2019 at 19:47 UTC

    It seems that the URL to use is

    https://developer.wordpress.com/docs/api/1.1/get/sites/$site/stats/fol +lowers/

    ... but you need to be authenticated:

    curl "https://public-api.wordpress.com/rest/v1.1/sites/the-art-of-auti +sm.com/stats/followers" {"error":"unauthorized","message":"user cannot view stats"}

    So, you will either have to get permission by the respective sites or you will have to continue scraping the websites.