Retrieve posts per customised order through JSON REST API

Share on FacebookTweet about this on TwitterShare on Google+Share on LinkedInPrint this page

The JSON REST API service, fully implemented into WordPress since 4.7, provides a great way for other applications to connect. This is a huge step forward, as it can communicate and exchange data regardless of what languages an external program uses.

The API support a bunch of endpoints to cover pretty much all existing data. A full list can be found at

Post retrieval through the API can be done by invoking the “posts” endpoint as follow:

curl -X OPTIONS -i

The full list of supported arguments can be checked at

To retrieve the list of posts in an order predefined through a custom sort the orderby argument need to be passed through along the API call:

curl -X OPTIONS -i

The above return all posts which belong to category id 1, using the order defined in the sort list.