# Getting headers response Nodejs API client

**URL:** <https://community.hubspot.com/t/getting-headers-response-nodejs-api-client/77282>\
**Category:** APIs & Integrations\
**Tags:** professional\
**Created:** [March 15, 2023, 11:04pm UTC](https://community.hubspot.com/t/getting-headers-response-nodejs-api-client/77282 "2023-03-15T23:04:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ACarr3](https://avatars.discourse-cdn.com/v4/letter/a/76d3ee/32.png) [@ACarr3](https://community.hubspot.com/u/ACarr3)\
**Post date:** [March 15, 2023, 11:04pm UTC](https://community.hubspot.com/t/getting-headers-response-nodejs-api-client/77282/1 "2023-03-15T23:04:58Z")

</div>

Hey guys, I would like to read the X-HubSpot-RateLimit-Daily header. Do you know if I can do this using the nodejs client? I know I can use axios instead but before changing all my API calls I would like to know if I can avoid that.

---

<div class="post-metadata">

**Author:** ![himanshurauthan](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/himanshurauthan/32/53076_2.png) [@himanshurauthan](https://community.hubspot.com/u/himanshurauthan)\
**Post date:** [March 16, 2023, 9:44am UTC](https://community.hubspot.com/t/getting-headers-response-nodejs-api-client/77282/2 "2023-03-16T09:44:31Z")

</div>

Hello @ACarr3  
retrieve the X-HubSpot-RateLimit-Daily header using the Node.js HTTP/HTTPS module.  
Here’s an example:

```lia-code-sample
const https = require('https');

const options = {
 hostname: 'api.hubapi.com',
 path: '/contacts/v1/lists/all/contacts/all',
 headers: {
 'Authorization': 'Bearer <your access token>',
 'Accept': 'application/json'
 }
};

https.get(options, (res) => {
 const dailyRateLimit = res.headers['x-hubspot-ratelimit-daily'];
 console.log(`X-HubSpot-RateLimit-Daily: ${dailyRateLimit}`);
});

```

In this example, we make a GET request to the HubSpot Contacts API and retrieve the daily rate limit from the response headers. You’ll need to replace `<your access token>` with your HubSpot API access token.

**Note** that if you’re making a large number of API calls, you may want to consider using a library like Axios to handle HTTP requests, as it provides more features and is easier to use than the built-in HTTP/HTTPS module.

Thanks & Regards  
Himanshu Rauthan
