Untitled
Anonymous
python
02/16/2023 8:38 PM
720 B
18
Indexable
import js2py
js_getListOfLinks = '''const axios = require("axios");
const { createClient } = require("pexels");
const API_KEY="gIvOvBCxJhTaJp5hiqLfHvBX6j6KI7iTnaewI03JRx1pLuwx3FGBTFOJ";
const client = createClient(API_KEY);
async function getListOfLinks(query, per_page) {
const result = await client.photos.search({ query, per_page: 15 });
// console.log(`Our res : ${JSON.stringify(result.photos, null, 2)}`);
return result.photos;
}'''
get_list_of_links = js2py.eval_js(js_getListOfLinks)
print(get_list_of_links("Ocean", 2))Editor is loading...