Skip to main content

Posts

Featured

Random Images from API with python

ByT. McDonald | 2/07/19
You may have heard of API’s and wondered what you can do with them. This is a simple but satisfying use of this powerful technology.

What is API? Application programming interface.

What does it do? An API will allow communication between two applications. The API I am using is a publicly available web-based API , which returns data as in JSON or XML.  In other words, I send a message to a stated website and request some data, in this case images are then returned to me. 


Using python 2 is a little different in the coding. 



It is worth noting that the ['file'] at the end of json.loads() may be different in the website you are connecting to.  I connected to randomcat.com

Hope you enjoyed this quick blog.  Please leave a comment below. 

Latest posts

An Outline Of The Data Pipeline

What is data?

Bletchley Bubble And Squeak

Coder's Mushroom Casserole

How I Gave Up Smoking.

What Is Mental Health And Who Is In Control Of It?