from flushai.integrations.serpapi import PexelsAPIWrapper

Initialization

To use this wrapper, you must sign up for an API key by registering on the Pexels website.

wrapper = PexelsAPIWrapper("your_api_key")

Retrieving Results

The search function can be used to retrieve results by passing in a prompt. By default, only 10 images are retrieved, but you can pass in a custom number of images to retrieve.

wrapper.search("astronaut", num=3)

A Document is returned. For reference, we provide the images returned below: