How can I query blog stats via HTTP?
-
How can I query my blog stats programatically? (from a remote application, not from a server plugin).
The WordPress REST API does not seem to have anything to query statistics…
http://developer.wordpress.com/docs/api/The Jetpack plugin (which I believe handles the stats) does not seem to have any API.
http://jetpack.meAm I missing something?
Best regards,
John
The blog I need help with is: (visible only to logged in users)
-
-
Thanks for the links, but both of those don’t really give me the stats data I want (all the info in the main stats page) in an easily digestible format for a program. I was hoping/expecting that there would be a REST API that returns a JSON object with the stats data.
I could parse the HTML from http://m.wordpress.com/, but that only contains very basic data (today’s views/visitors).
The main stats page at http://wordpress.com/#!/my-stats/ does have lots of detailed data, but it loads and processes it via other AJAX requests, e.g. I have found that I can get historical stats data using a request like…
In summary, I just want to know if there is an easier / documented / recommended / better way of getting this data.
Thanks!
-
I don’t have an answer for you so I’ll tag this thread for Staff assistance. Please subscribe to the thread so you are notified when they respond and please be patient while waiting.
-
Hi John,
Blog stats are not currently available in the REST API, though it’s something we’ve considered adding. You can, however, access your blog’s stats at an older (still active) API: http://stats.wordpress.com/csv.php
To use it, you’ll need an API key: https://apikey.wordpress.com/
If you have any questions about this, please let me know. :)
-
-
I got the csv interface working – many thanks.
From the documentation, it seems that there is no way to query the number of visitors (only the number of views).
table String One of views, postviews, referrers, referrers_grouped, searchterms, clicks, videoplays.
Is there any way to get the number of visitors via this interface?
-
This API will only give you the number of views, not the number of visitors.
However, I checked again with our developers and they are planning a REST API for blog stats. I will pass along your comments so they can take them into consideration while they work on it. Cheers! :)
- The topic ‘How can I query blog stats via HTTP?’ is closed to new replies.