4 Examples of Building with WP API

APIs or application programming interface provide you with a way to integrate services or features with your website. Before APIs, you need to partner with companies in order to use their code in your website or app. You have a WordPress website. Can you use an API to create additional features? With their WP API, you can build solutions unique to your WordPress website.

4 Examples of Building with WP API

What can you do with WP API?

You can use the WP API to build solutions that integrate with WordPress or use it as a back-end database. Maybe you need to create new features that talk to an external API. I found four examples that show you how to use the WP API to integrate with WordPress and an external API for Instagram.

Fetch Random Posts

Chris Coyier demonstrates how to use the WP API to randomly fetch posts from WordPress. In his example, he uses WordPress to store quotes about design and randomly displays one to you.

Screenshot of Quotes On Design Website

Go to Quotes on Design to see the api at work.

Retrieving Posts in C#

What if you want to use the WP API with a different programming language? With WP API, you can use a programming language like C# instead of PHP to retrieve posts from WordPress. Hendrik Bulens chose to use ASP.NET MVC as the front end to retrieve the latest blog posts from WordPress.

Voting for Blog Posts

You spend time writing blog posts and want to allow your readers to vote on whether or not they liked the post. In the past, you need to write a plugin using PHP. You can use WP API to accomplish this. Use this example from Delicious Brains to create your blog voting.

Integrate WordPress with Instagram

If you use Instagram, you may want to include photos from your account. WebDev Studios show you how to use the API to integrate Instagram with WordPress.

Summary

These examples show you how to use WP API to modify WordPress and work with an external API. If you want to learn more, Chris Lema has a guide that contains resources and tutorials on Getting Started with APIs and WordPress. You can also check out Getting Started with using an API.

Getting Started with using an API

You’ve heard about application programming interface. Companies like Twitter, FaceBook and Google have them. With an API, you can use it build new and interesting things.

Getting Started with an API

What is an api?

By definition, it is an application programming interface. Programmers use an api to create a new app that uses the data from another source like getting the current weather in Austin, TX.

How do I start using an API

To start learning how to integrate an API into a web project, you can use an API that provides photos as a placeholder. You could use an API like Dog CEO API to place photos of dog or other animals quickly in your design.

If you prefer, you can start with Programmable Web’s API University. The API University provides you with tips, tutorials and best practices on using and designing APIs.

Where do I find APIs?

You can find apis at Programmable Web , API List or API Hound. Or on Reddit where you can find recommendations from other programmers.

Summary

With an application programming interface, you don’t need to know the same programming language that they used to build the API. You can incorporate it into your WordPress, static website or other CMS easily. With so many APIs to choose from, you can create almost anything.