You’ve been playing through Wilco quests and have decided it is time to build your own project or maybe you have decided to build your own quest using our Quest Builder. You’ve started planning your project and you realised that it would be great if you could just use some external data/information, so that you wouldn’t have to write your own or be limited to your own skill set.
Turns out you can!
It’s called an Application Programming Interface or API for short. An API is a way for multiple computer programs to communicate; in this case your project with an API. Calls are made to the API and the API returns the information needed. The best part, the user of the API does not need to know how the API works, only how to request, send, and read the information. There are many different kinds of APIs but for your project you will want to use a Web API.
Web APIs are services accessed by the client using HTTP requests. The information returned to the client in either XML or, more commonly today, JSON. Web APIs are especially useful for querying databases of information. Web APIs can be categorised as either a SOAP API or REST API.
SOAP stands for Simple Object Access Protocol, and as the name implies it’s a standard protocol for accessing an API. The main advantages of this is you know exactly how your response from the API will be formatted and the information is more secure overall. SOAP APIs will only provide XML responses. REST stands for Representational State Transfer and has not specific protocol. The main advantages of a REST API is the speed of sending and receiving the information in either XML or JSON, however there is a huge disadvantage that any information sent or requested is less secure.
A simple analogy would be letter in an envelope and a postcard. The letter in an envelope has to follow rules: the letter must be inside the envelope, the envelope must be sealed, there must be a stamp in a specific spot in relation to the address, and the envelope must be addressed in a specific spot. No one can look into the envelope and read the letter. Upon receiving the envelope you know how to open it to read the letter. On the other hand a postcard gets a stamp, address, and message. Anyone can read the message the postcard is carrying and can see where the postcard is heading; however the postcard will get to its destination quicker than the letter. SOAP is the letter in an envelope and REST is the postcard.
In order to test an API or make an API request, you can use API clients like Postman e.t.c.
Maybe before today you had no interest in writing your own project but all this talk about APIs has piqued your interest.
Here are 10 public free APIs you can use in your next project:
Has any of these inspired a project? What are you waiting for? Start planning and coding!
Oh, and don’t forget to let us know when you complete your project with one of these APIs!