---
title: "Comment by Dumi on \"Hide API Keys using Netlify token-hider Function\" | Hashnode"
description: "Hello, I found your article very useful. But, what if the API use the key in headers, not parameters? This is the example how I get data from the API: const BAS"
url: "https://hashnode.com/posts/hide-api-keys-using-netlify-token-hider-function/5f809db97762251b305d8879/comment/60463d0a73cc1742999bfaf0"
---

[Discussion](https://hashnode.com/posts/hide-api-keys-using-netlify-token-hider-function/5f809db97762251b305d8879)

Comment [Hide API Keys using Netlify token-hider Function](https://hashnode.com/posts/hide-api-keys-using-netlify-token-hider-function/5f809db97762251b305d8879)

[Dumi](https://hashnode.com/@dumidummy)

[Mar 8, 2021](https://hashnode.com/posts/hide-api-keys-using-netlify-token-hider-function/5f809db97762251b305d8879/comment/60463d0a73cc1742999bfaf0)

Hello, I found your article very useful. But, what if the API use the key in headers, not parameters? This is the example how I get data from the API:

```
const BASE_URL = ".....";
const ENDPOINTS = "/type=movie"; // There is more than one endpoint, it's dynamic
const API_KEY = {
  headers: {
    "key": "value";
  }
};

axios.get(`${BASE_URL}${ENDPOINTS}`, API_KEY).then(........
```

[Aadhi Keerthanan](https://hashnode.com/@DevAadhi)

[Mar 9, 2021](https://hashnode.com/posts/hide-api-keys-using-netlify-token-hider-function/5f809db97762251b305d8879/comment/60463d0a73cc1742999bfaf0#reply-604760feefdd714f7023997a)

Hi, you are directly fetching the api from your js file instead you have to send a request to the token-hider.js like this const res = await fetch("/.netlify/functions/token-hider" + "?q=" + searchField.value). I have used the fetch api but you can use axios if you prefer it. Can you send the token-hider.js file so that I can take a look and see what's the problem.

[Dumi](https://hashnode.com/@dumidummy)

[Mar 10, 2021](https://hashnode.com/posts/hide-api-keys-using-netlify-token-hider-function/5f809db97762251b305d8879/comment/60463d0a73cc1742999bfaf0#reply-604810b2c64c63545921cb95)

Thanks for your response, but the code above is code before I implemented it in token-hider.js (my current code). I don't know how to change it in token-hider.js. Your tutorial (and all the tutorials I read on Google) uses an API that puts the key in a parameters, while the API I use is in the headers. [Aadhi Keerthanan](https://hashnode.com/@DevAadhi)
