With all the buzz that’s been going around the WP REST API for the past year or so, I thought it’s time we take a look at some of the awesome implementations that have been made recently (or not so recently).
If you don’t know what it is, the REST API is basically a new way for things outside of WordPress to communicate with a WordPress site. (Things like Facebook timelines and Twitter feeds that show up on pages can be run by an API. And you know those “Login with Facebook/Twitter/Google” pages? You guessed it, API again.)
This makes it possible to for example code the entire front end in a different language, for example, the very popular JavaScript, or you can even use it communicate with mobile apps.
In this post we’re going to look at a few awesome implementations of the WordPress REST API.
Calypso
Calypso, the new WordPress.com multi-site dashboard is a perfect showcase for the power of the REST API. It uses the REST API to communicate with not one, but all of your WordPress sites(yes, even .org ones as long as you have Jetpack installed and multisite dashboard enabled).
This means that you can for example, easily post content to multiple sites from within one dashboard, quickly update plugins/themes or core on multiple sites and much more.
It was made 100% with React, a JavaScript framework, so it’s a perfect example of an ambitious project that uses the API to connect a WordPress backend with a JS frontend.
New York Times Live Coverage Blogs
You may have already heard about this use case in Matt Mullenweg’s state of the word 2015 speech. The NYT use the WP REST API to power their live coverage blogs.
This might not come as totally surprising, as the New York times have not only been using WordPress for a long time, but have also invested in Auttomattic, the company that runs WordPress.com, and authors plugins like JetPack and Akismet.
Their latest addition of WP technology is the live coverage ‘plugin’ that uses the REST API, along with Backbone.js and React.js. They use it to communicate between the WP backend, and a custom editor made with Backbone.js. This content is then filtered and shown by a React-based app on the front end.
You can watch the full talk about the project by NYT developer Scott Taylor.
Public Knowledge Project – Managing Plugin Submissions
Nate Wright mentioned last year that he was using the REST API to manage plugin submissions for the Public Knowledge Project. The Public Knowledge Project aims to supply academic journals with free software for managing their online versions. This is done to combat the monopoly of certain big journal moguls with expensive fees that also lead to expensive journal access. Through offering free software, PBK’s goal is to democratize the industry, and make academic knowledge more freely available to people at large.
iOS App for The Norwegian Ministry of Petroleum and Energy
As early as July last year, Per Soderlind mentioned that he was working on an iOS App for the Norwegian Ministry of Petroleum and Energy.
While the author is not very specific about what exactly it does, he does mention that the app is for the purpose of telling people “what to do when sh*t happens”.
This is an interesting use case because it demonstrates the wide variety of people that might be using WordPress on the backend of their web or mobile apps moving forward with the REST API.
StoryCorps Mobile App (iOS and Android)
For those of you who saw Matt’s State of The Word speech late last year (or early this year online), you hae probably already heard about this example. StoryCorps is a website where anyone can share their stories. They used the WP REST API to create iOS and Android apps, so people can easily share their stories from the cellphones. This content then gets synced from the app to the WordPress backend, and content published on the website will get synced to the mobile apps as well.
What this basically means is that if you upload a story in your app, you will be able to see it on your account on the website, and if the management publishes something to the website in a relevant area for the app, it will also be updated on your app.
One of the interesting things about this implementation, is that it demonstrates the scalability of WordPress, and also the REST API.
On Thanksgiving last year, Google actually linked to StoryCorps from it’s homepage, reminding people to record the stories of their elders.
NomadBase – Webapp Working With the REST API
NomadBase is a web app that shows you where Nomads currently find themselves around the world(in this case Digital Nomads that are members of the app, not random nomads in the Sahara or other deserts.)
The web app was built by Human Made, a WordPress agency that even have some members contributing to the REST API itself.
The app was inspired by digital nomads coming together, meeting up at a DNX conference.
Custom Contact Forms – (re)Building a Contact Form Plugin
Custom Contact Forms is a plugin that’s built using the WP REST API. It is a sleek plugin for making, you guessed it, custom contact forms and adding them to your WordPress site.
The plugin uses the API not only in the frontend, but also in the backend. The app was completely rebuilt to use the API, but it has not been without problems. On WP Tavern, the author Taylor Lovett, goes as far as saying
“There have been a number of backwards compatibility breaks with the JSON REST API project. If I had known going into it what would happen, I probably would have not used the API.”
But still he believes that increased exposure for the API ultimately means a better, more modern WordPress for everyone with major strides applications built using it.
Letting Other Apps Communicate With Plugin – Event Espresso, Maps by Store Locator Plus, more
Maps by Store Locator Plus, is basically a plugin that makes it easy to show many different maps on websites for stores with multiple physical locations.
They use the REST API to make the plugin info available in the same way, for example to a JS Front End or mobile app.
Event Espresso is an event management app for WordPress. You can use it to schedule and manage different events.
They’ve made a free addon for their plugin available that works with the REST API. The addon shares access to Read all of the information stored in the plugin, like events, dates, questions and answers and more.
That means you can for example easily use a Javascript (or mobile app) to pull out that information and display it using the language or platform of your choice.
These and similar implementations are probably going to be the brunt of the first wave of REST API related plugin updates.
Going forward, as more and more people start using JS or developing native mobile apps for their front ends, whether or not a plugin supports that kind of use may make or break the popularity of plugins that specifically cater to WordPress developers.
Connecting Multiple Mobile Apps To Social Fitness Website
The creator of the Focused on Fit website, a social website focused on connecting people who want to be healthy and fit, mentioned last year that he was building not one, but multiple iOS apps that communicated with WordPress using the WP REST API.
Not only with standard WP though, he customized it so that it pulled out information not only from custom post types, but also Buddypress and more.
This is another example of a WordPress back end, mobile app front end.
Where To Read Up On The WP REST API
You can read more about the API and what it means for the future of WordPress in this free whitepaper published by human made.
You can read news about the API, in the WP REST API section of WP tavern.
You can read more about how to make a mobile app using the REST API.
Conclusion
As you can see in these examples, there are a wide variety of things that you can do
The REST API is powerful, and adds a whole new dimension to WordPress for developers and users at large to explore. Whether you are a passionate developer, eager to bring something new to the WP ecosystem, or you’re a passionate user, eagerly awaiting new, fancy JS based themes and plugins, the future will surely hold what you are looking for.
Essekia Paul says
Great to see awesome plugins built with REST API. At the time when people felt WordPress was falling behind the tech standards of the time, releasing REST and Calypso was a very good move indeed. Its gonna be interesting to see what people built with it.
Mike Nelson says
Hey FYI Calypso relies on the WordPress.COM REST API (aka Jetpack API), not the WP API (aka WP JSON API, WP REST API). So it actually relies on a COMPLETELY different system than the WP API documented here: http://v2.wp-api.org/.
This old doc compares the two: https://github.com/WP-API/WP-API.github.io/blob/master/misc/comparison.md. Yes, it’s confusing because both the WordPress.COM REST API and the WP API have a bunch of alternate names that are really similar.
So Calypso uses an API, but it’s not the WP API.
Ragnar says
Oh wow, I cant believe I missed that. Thanks for the head up I will make sure to amend the article.
Jeffrey Nolte says
We just released a pretty awesome toolset for building web apps with WordPress, The Wp-API, and Angular. Check it out here: getmoxied.net/lean
Ragnar says
Looks awesome. Will definitely take a closer look.
Mike Nelson says
Oh and FYI Event Espresso’s REST API is now actually included with the core plugin, even the free version: https://eventespresso.com/2016/01/rest-api-now-in-ee4-core/
And its using the REST API to power the checkin mobile apps: https://eventespresso.com/features/mobile-ticketing-apps/