SOP: How to Use Pexels API in n8n: Step-by-Step Guide

:memo: Create a Pexels developer account and register your application to get an API key. You can sign up at https://www.pexels.com/api/new/.

:heavy_plus_sign: Add an HTTP Request node to your n8n workflow.

:wrench: Configure the HTTP Request node by entering the Pexels API endpoint URL in the “URL” field: https://api.pexels.com/v1/search.

:mag: In the “Headers” section, add the following parameter:

:old_key: Authorization: Your Pexels API key

For example, you might set the following parameter:

:old_key: Authorization: your_api_key
:mag: In the “Query Parameters” section, add the following parameters:
:mag_right: query: The search term for the photos you want to find
:scroll: per_page: The number of results you want to return per page
:page_facing_up: page: The page number of the results you want to retrieve
For example, you might set the following parameters:

:mag_right: query: nature
:scroll: per_page: 10
:page_facing_up: page: 1
:outbox_tray: In the “Response Format” section, choose “JSON” as the response type.

:rocket: Click “Execute Node” to run the node and retrieve the photos from the Pexels API.

That’s it! :tada: You can use the data returned by the Pexels API to display the photos in your application or perform other actions with them. Don’t forget to follow the Pexels API guidelines and attribution requirements for displaying photos in your application.