REST API Introduction

The WordPress REST API provides an interface for applications to interact with your WordPress site by sending and receiving data as JSON. It is the foundation of the WordPress Block Editor and can likewise enable your theme, plugin, or custom application to present new, powerful interfaces for managing and publishing your site content.

The REST API is a developer-oriented feature of WordPress. It provides data access to the content of your site and implements the same authentication restrictions — content that is public on your site is publicly accessible via the REST API while private content, password-protected content, internal users, custom post types, and metadata is only available with authentication or if you specifically set it to be so.

What Is A REST API?

An API is an Application Programming Interface. REST, stands for “Representational State Transfer,” is a set of concepts for modelling and accessing your application’s data as interrelated objects and collections.

The WordPress REST API provides REST endpoints (URLs) representing the posts, pages, taxonomies, and other built-in WordPress data types.

Your application can send and receive JSON data to these endpoints to query, modify and create content on your site. JSON is an open standard data format that is lightweight and human-readable and looks like Objects do in JavaScript.

When you request content from or send content to the API, the response will also be returned in JSON. Because JSON is widely supported in many programming languages, developers can build WordPress applications in client-side JavaScript (like the block editor), as mobile apps, or as desktop or command line tools.