API Pexels (API keys + color search)
Virginie
Posted on April 1, 2022
We are 3 learners in dev school, for a data visualization project, realized in JavaScript. We used the Pexels API, but we encountered problems when we followed its documentation.
This one is rather light and did not work for us.
Here's how we solved our hang-ups:
- Authorization to insert the API key Pexels documentation:
import { createClient } from 'pexels';
const client = createClient('YOUR_API_KEY');
Our solution:
headers: {
Authorization: "YOUR_API_KEY",
}
- Search for a photo by color: remove the # in front of the hexadecimal code (in lower case).
Marine, Audrey & Virginie
💖 💪 🙅 🚩
Virginie
Posted on April 1, 2022
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.
Related
webdev Understanding HTTP, Cookies, Email Protocols, and DNS: A Guide to Key Internet Technologies
November 30, 2024