Daily API Usage data-get API

I’m trying to get daily api usage data response in an account using this api( 'https://api.hubapi.com/account-info/v3/api-usage/daily?hapikey=YOUR_HUBSPOT_API_KEY’). But it allows only api key,not private app accesstoken. Is there any way to do this without api key?

Hi @06020,

Instead of looking there, all HubSpot API calls return headers that contain the information for your secondly and daily ratelimit, like the header: “X-HubSpot-RateLimit-Daily-Remaining”. You can see more information about those headers here: HubSpot Developer Documentation - HubSpot docs. So you can just make any API request. For a do nothing request you can make a GET request to the “https://api.hubapi.com/integrations/v1/me” endpoint with a private app token.

Best,

Hi @06020

No, there is no way to do this without an API key. The API key is used to authenticate your requests to the HubSpot API. Without an API key, HubSpot will not be able to identify you and will not allow you to access the API.
If you do not have an API key, you can create one in the HubSpot Admin Center. To do this, go to Settings > API Keys and click Create API Key.
Once you have created an API key, you can use it to make requests to the HubSpot API. To do this, you will need to include the API key in the request header. The following example shows how to do this:
Code snippet
curl -X GET \
‘https://api.hubapi.com/account-info/v3/api-usage/daily?hapikey=YOUR_HUBSPOT_API_KEY’

Replace YOUR_HUBSPOT_API_KEY with your actual API key.
If you are using a programming language, you can use the appropriate library to make requests to the HubSpot API. For example, if you are using Python, you can use the requests library.
The following example shows how to use the requests library to make a request to the HubSpot API:
Code snippet
import requests

url = ‘https://api.hubapi.com/account-info/v3/api-usage/daily’

headers = {
‘Authorization’: ‘Bearer YOUR_HUBSPOT_API_KEY’
}

response = requests.get(url, headers=headers)

if response.status_code == 200:
data = response.json()

print(data)

else:
print(response.status_code)

Replace YOUR_HUBSPOT_API_KEY with your actual API key.
The data variable will contain the response from the HubSpot API. You can then use this data to do whatever you need to do.

Hope this will helps you out. Please mark it as Solution Accepted to help other Community member.

Thanks!