javascriptwordpressapiwp-api

Get most recent post using WP-API JS


I'd like to be able to return the most recent Wordpress post from my blog using the WP-API (Version 2).

I can't work out what to put after:

/wp-json/wp/v2/

Any help is much appreciated. - Thanks.


Solution

  • Try this - /wp-json/wp/v2/posts?filter[posts_per_page]=1