slidedeckai.helpers.image_search.get_photo_url_from_api_response#

slidedeckai.helpers.image_search.get_photo_url_from_api_response(json_response: dict) tuple[str | None, str | None][source]#

Return a randomly chosen photo from a Pexels search API response. In addition, also return the original URL of the page on Pexels.

Parameters:

json_response – The JSON response.

Returns:

The selected photo URL and page URL or None. Empty tuple if no photos found or API key is not set.