Writing APIs is a relatively simple skill

The WordPress REST API - at the heart of the CMS

Behind the term WordPress REST-API there is a interface, which makes it possible to use the Database to communicate. The abbreviation API stands for "Application Programming Interface", in German "Programming Interface". It allows the exchange between different programs according to a fixed pattern - comparable to the conversation of two people who only understand each other when they are talking to each other common understandable language serve. Further information can be found in our article "APIs: What you need to know about programming interfaces".

The abbreviation REST means "Representational State Transfer". These are the principles for the exchange of information, designed in 1994 by the US computer scientist Roy Fielding:

  • uniformity: The URLs for accessing resources must be uniform, consistent and accessible via a common approach such as GET.
  • Client-server separation: If the server-side technology (e.g. WordPress) changes, a client-side application (e.g. an app) must still be able to access it.
  • Stateless: The server does not change its status with a new request via the API and does not save the request.
  • Cache capability: Ensures high speed and compliance on the server or client side.
  • Layered system: Access is possible over several layers.
  • Code on Demand (optional): Code for local execution is only transferred to the client when required.

In WordPress are these requirements since Version 4.7. in the so-called Core, i.e. the core programming of the content management system. Before that, the plug-in "WP REST API (WP API)" was available until May 13, 2018. From the WordPress version 5.x Elements have been added to the core of the system that allow existing communication options with other (web) applications and apps expand.