WordPress REST API
-
Hello!
I’m new to wordpress, trying to make use of its REST API. I’ve tried the following URLshttps://mysite.wordpress.com/index.php/wp-json/wp/v2/posts?per_page=1&page=1
and
https://mysite.wordpress.com/wp-json/wp/v2/posts?per_page=1&page=1Both returned ‘404’ not found….
Are the REST API endpoints disabled by default on wordpress.com? Are they active for certain paid plans?
thanks!The blog I need help with is: (visible only to logged in users)
-
Hi there!
The REST endpoints on WordPress.com differ from those on WordPress.org. You can find a list of WordPress.com REST endpoints here: https://developer.wordpress.com/docs/api/
So you’ll use: https://public-api.wordpress.com/rest/v1.1/sites/mysite.wordpress.com/posts/?number=1
You can check out the WordPress.com Developer Console here to play around with it: https://developer.wordpress.com/docs/api/console/
I hope this helps!
-
Thanks a lot, works fine! It seems v2 isn’t supported yet. How long is v1.1 supposed to remain the current supported version?
-
Ah! Sorry, didn’t see this one:
I’m all set, thanks for your prompt response!
-A
- The topic ‘WordPress REST API’ is closed to new replies.