External WordPress API

As of WordPress 4.7 (released December 2016), a REST API is provided out of the box on WordPress.

As you’re probably aware, REST APIs are interfaced with by standard HTTP GET and POST requests, so if you have a WordPress 4.7 installation, you can access it at this URL, by plugging this into your browser:

http://your.site.com/wp/v2/posts

Further reading:


Important side note:

Because this is turned on be default, because this exposes endpoints that can changes your data (via POST/PATCH/DELETE requests), and because WordPress prefers you not to disable it, you really really ought to turn on some form of authentication. Thankfully, turning on basic WP logged-in authentication isn’t particularly hard, and there are plugins that will enable OAuth.

Leave a Comment