Absolute beginners guide to slaying APIs using Python

Prashanth Xavier
Quick Code
Published in
10 min readFeb 9, 2019

--

Have you ever wondered how online travel search engines like skyscanner or expedia cater the best deals for you, How they manage to keep their data updated even if it means gathering data from hundreds of carriers, How this data is relaying back and forth between a number of websites?

The answer is API, acronym for Application Programming Interface.

Lets begin by dwelling into the prime essence of API and requests, how to use them in python, and then build up on our API knowledge by strolling through some basic open APIs, like Open Notify that counts number of people in space, datamuse to find related words and finally we conclude with the implementation of a more complex API which involves authentication, all this and more in under 10 minutes.

What is an API ?

The technical definition of an API goes like this, a set of subroutine definitions, communication protocols ……zzzzzzzzzzzzzzzzzzzzzzzzzzzzzz

Fancy! Lets try to flatten this a bit, imagine you are at a restaurant and you are in the mood for some cheese(apparently its your cheat day), and the waiter gives you the menu and you customize a pizza the way you like it and place your order. The waiter then sends your order straight to the kitchen, where it is prepared for you by Gordon Ramsay…

--

--