Analytics API
The Analytics API provides detailed usage analytics and API call history for your account. Track your API consumption, monitor usage patterns, and analyze which APIs you're calling most frequently.
Calling this API does NOT consume any of your API quota.
Use Cases
- Monitor your API usage to optimize costs
- Track which APIs are most popular in your application
- Analyze usage patterns over time
- Build custom dashboards and reporting tools
- Set up alerts when approaching quota limits
From 10,194 users
Applications using this API
API Status
API Response Times
Average | P50 | P75 | P90 | P95 |
|---|---|---|---|---|
| 220ms | 230ms | 292ms | 460ms | 1086ms |
Didn't find what you were looking for? Suggest an improvement
/v1/analytics GET
Professional and Enterprise tiers only
https://api.api-ninjas.com/v1/analytics
Returns comprehensive analytics data for your API account, including subscription information, current usage, and detailed API call history.
Parameters
api_keyrequiredYour API Key. This is passed as a query parameter instead of in the header for this endpoint.
Response
A JSON object with the following fields or an error if the request is unsuccessful.
api_keyYour API key.
account_creation_dateThe date your account was created (YYYY-MM-DD format).
subscription_tierYour current subscription tier (e.g., Business, Professional, Enterprise).
subscription_periodYour subscription billing period:
monthoryear.api_reset_dateThe date when your API quota will reset (YYYY-MM-DD format).
current_month_usageTotal number of API calls made in the current billing period.
api_call_historyObject containing daily API call history. Each key is a date (YYYY-MM-DD), and the value is an object mapping API names to call counts for that day.
Sample Request Live Demo!
Try this API endpoint with all available parameters in our API playground
https://api.api-ninjas.com/v1/analytics?api_key=YOUR_API_KEYHeaders
X-Api-KeyLog in or sign up to get your API KeySample Response
Code Examples
1
curl -X GET "https://api.api-ninjas.com/v1/analytics?api_key=YOUR_API_KEY"If your programming language is not listed in the Code Example above, you can still make API calls by using a HTTP request library written in your programming language and following the above documentation.
Notes
- Unlike other API endpoints, the Analytics API requires your API key to be passed as a query parameter (
?api_key=YOUR_KEY) rather than in theX-Api-Keyheader. - Only the API call counts in
api_call_historyare stored. API inputs (including parameters, body, etc.) and API responses are not stored for privacy reasons. - This endpoint is rate-limited to prevent abuse. Please cache responses when building dashboards.
Frequently Asked Questions
Can I use the Analytics API for commercial purposes?
Yes, but you must have a premium subscription. Commercial use of the Analytics API is not permitted on the free tier. See our pricing page to choose a plan that fits your needs.How do I get an API key and start using the Analytics API?
Sign up for a free account to instantly get your API key, then pass it in theX-Api-Keyheader on every request. The documentation above includes ready-to-run examples in cURL, Python, JavaScript, Node.js, and more.What happens if I exceed my quota for the month?
Your API requests will simply be denied once you hit your monthly quota — you will never be charged more than the plan you signed up for. To increase your quota, you can upgrade your plan any time on our pricing page.What happens if a request to the Analytics API fails?
The API responds with a standard HTTP status code and a JSON error message describing the problem. See our error codes reference for the full list of codes and how to resolve each one, or contact support if you need help.What does the Analytics API response include?
The Analytics API returns a JSON object with yoursubscription_tier,subscription_period,account_creation_date,api_reset_date,current_month_usage(total calls in the current billing period), andapi_call_history, an object keyed by date (YYYY-MM-DD) mapping each API name to its call count for that day.How do I authenticate requests to the Analytics API?
Unlike other API Ninjas endpoints, the Analytics endpoint requires your API key to be passed as theapi_keyquery parameter (for example?api_key=YOUR_API_KEY) rather than in theX-Api-Keyheader; you can get a key by signing up at registration.Does calling the Analytics API count against my quota, and which tiers can use it?
No, calling the Analytics API does not consume any of your API quota, but the endpoint is only available on the Professional and Enterprise tiers shown on the pricing page.What are some use cases for the Analytics API?
You can use thecurrent_month_usageandapi_call_historyfields to monitor consumption and optimize costs, identify which of your API Ninjas APIs are called most frequently, analyze usage patterns over time, and build custom dashboards or quota-limit alerts.