# How do I import Pexels API library in Processing?

**URL:** <https://discourse.processing.org/t/how-do-i-import-pexels-api-library-in-processing/27004>\
**Category:** Libraries\
**Created:** [January 12, 2021, 10:37pm UTC](https://discourse.processing.org/t/how-do-i-import-pexels-api-library-in-processing/27004 "2021-01-12T22:37:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![eclipse](https://avatars.discourse-cdn.com/v4/letter/e/6a8cbe/32.png) [@eclipse](https://discourse.processing.org/u/eclipse)\
**Post date:** [January 12, 2021, 10:37pm UTC](https://discourse.processing.org/t/how-do-i-import-pexels-api-library-in-processing/27004/1 "2021-01-12T22:37:32Z")

</div>

> Hello, I am attempting to use an API for the first time but am having some trouble. Here is the API that I have chosen: [Pexels API Documentation](https://www.pexels.com/api/documentation/).
> 
> I have already received an API key and tried to adapt the following JavaScript code from the documentation to search for images:
> 
> `import { createClient } from 'pexels';`  
> `const client = createClient('myAPIKeyHere');`  
> `const query = 'Nature';`  
> `client.photos.search({ query, per_page: 1 }).then(photos => {...});'`
> 
> I think the first issue I am having is that I am not able to import the pexels library? Can anyone help me figure out how to rewrite the first line of code in Processing?

---

<div class="post-metadata">

**Author:** ![SomeOne](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/someone/32/8639_2.png) [@SomeOne](https://discourse.processing.org/u/SomeOne)\
**Post date:** [January 14, 2021, 6:26pm UTC](https://discourse.processing.org/t/how-do-i-import-pexels-api-library-in-processing/27004/2 "2021-01-14T18:26:25Z")

</div>

Welcome to the forum.

I would guess that ‘pexels’ library (a file) is not in the same folder as your javascript file is. Import statement as is requires it. [import - JavaScript | MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import) for example tells you a bit more about imports and has some examples too.
