# Including API key in the header :(

**URL:** https://discourse.processing.org/t/including-api-key-in-the-header/21936
**Category:** Coding Questions
**Created:** [June 17, 2020, 12:49am UTC](https://discourse.processing.org/t/including-api-key-in-the-header/21936 "2020-06-17T00:49:00Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![Sven](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/sven/32/8293_2.png) [@Sven](https://discourse.processing.org/u/Sven)
#### Post date: [June 17, 2020, 11:25am UTC](https://discourse.processing.org/t/including-api-key-in-the-header/21936/2 "2020-06-17T11:25:15Z")

</div>

Every API is different, there’s no single way to provide an API key. It’s up to the designer of the API. So we can’t tell if your code fetches the JSON as intended unless you share a link to the API documentation.

The code has another potential problem as-well; the variable `spid` may not be available when `draw` is called. (Like I [mentioned last time](https://discourse.processing.org/t/how-can-i-read-this-json-file/21623/3).) You can see one [possible solution to that problem in the documentation](https://p5js.org/reference/#/p5/httpDo) (the code right below the comment `// wait until the data is loaded`).

---

_[View the full topic](https://discourse.processing.org/t/including-api-key-in-the-header/21936)._
