Collecting free to use photos from Pexels using Python and Pexels API

In the life of any software engineer or researcher there is a moment when it is required to collect a dataset with images under free to use license.

You can easily download thousands of images from pexels.com using less than hundred lines of code. First, you need to install python wrapper for API

pip install pexels-api

Then, go to https://www.pexels.com/api/ to get a token for API. You just need to provide information on how you will use the API. After that…