Installing WP API

The current stable version of the WordPress API is on the plugin directory, and can be installed on your site via your WordPress admin. Beta and Development versions are on Github.

Once the plugin is installed and activated you can check for the API by loading `` in your browser. You should see a block of JSON text.

It may be fun at this point to check on some other routes such as wp-json/posts. And if you visit wp-json/users you’ll get an authorization error because the API handles authentication via the same cookie that the WordPress admin uses.

Note: This lesson assumes you are using pretty permalinks on your site. Without pretty permalinks, an API route would look like for example ``

The full set of routes and endpoints are listed for your benefit on

Pretty JSON

If you want to test out the routes and view well formatted JSON responses, try the Postman Extension for Chrome. Or, for example, use a command line helper to get pretty JSON

curl | python -m json.tool

Leave a Reply

Powered by

Up ↑

%d bloggers like this: