Untitled

 avatar
unknown
python
2 years ago
539 B
6
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...