The WordPress REST API is a powerful built-in tool that allows external applications and front-end scripts to interact with your WordPress site by sending and receiving data as JSON (JavaScript Object Notation) objects.
It transforms WordPress from a traditional content management system (CMS) into a flexible application platform, enabling headless WordPress setups, mobile app integrations, and custom single-page applications (SPAs).
01 Key concepts
Endpoints & routes
A route is the URL path—for example, /wp-json/wp/v2/posts—and an endpoint is the combination of a route and an HTTP method.
HTTP methods
GET retrieves data; POST creates new data; PUT/PATCH updates existing data; DELETE removes data.
Data format
Data flows in and out as lightweight JSON, usable with JavaScript (React, Vue, Node.js), mobile frameworks (Swift, Kotlin), Python, PHP, and more.
02 How to access it
Every WordPress REST API request starts with the site’s API namespace. These are example URLs using yourwebsite.com; they are not claims that wp-restapi.com is a live WordPress installation.
https://yourwebsite.com/wp-json/Lists available routes and endpoints.
https://yourwebsite.com/wp-json/wp/v2/postsReturns public blog posts as JSON.
03 Common use cases
- Headless WordPressUse WordPress as a backend content repository with a Next.js or Nuxt.js front end.
- Mobile applicationsBuild iOS and Android apps that pull from or post to WordPress.
- Third-party integrationsConnect content with CRMs and automation tools such as Zapier.
- Modern admin interfacesThe Gutenberg / Block Editor uses the REST API extensively.
04 Authentication methods
Public data—published posts and public pages—can usually be read without authentication. Creating, updating, or viewing private or draft data requires authentication.
Cookie authentication
For logged-in dashboard users and internal JavaScript scripts.
Application Passwords
For external applications and scripts.
JWT / OAuth
For secure, scalable third-party and decoupled-front-end integrations.