API: Class PyPexels

This is the main class used to interact with the Pexels REST API.

PyPexels(api_key)

Create an instance of class PyPexels. The api_key parameter is required. API keys can be obtained from Pexels API page.

Parameters

Argument Type Optional/Required Notes
api_key string required Your API key
api_version string optional API version to use. Default: ‘v1’

Returns

Object Instance of class PyPexels

Example

import pypexels
py_pexel = pypexels.PyPexels(api_key='YOUR_API_KEY')

Methods

Methods exposed by the PyPexels class.