Fortunately, it’s also really easy to register custom REST API routes to display exactly what we need.
There are a few options available and if you need a robust system you might consider setting up a custom controller that extends the core WP_REST_Controller class. That’s a great approach if you need a lot of structure and control.
If, however, you need to fire up a route in a hurry, a simple script like the following does a fantastic job. This example will provide a nice output of JSON formatted data at the