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
Application used this API in the last 28 days.
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
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_keyoptionalYour API key. Pass it here or in the
X-Api-Keyheader; one of the two is required.
Headers
X-Api-KeyoptionalYour API key. Pass it here or as the
api_keyquery parameter; one of the two is required.
Response
The /v1/analytics endpoint returns 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., 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.
current_month_document_pagesDocument pages used in the current billing period by the file and document APIs, such as PDF to Image and Word to PDF. Present only once your account has used document pages this period.
document_pages_limitYour plan's monthly document-page allowance. Present together with
current_month_document_pages.current_month_background_removalsImages processed this calendar month (UTC) by the Remove Background API. Present only once your account has used it this month.
background_removals_limitYour plan's monthly background-removal allowance. Present together with
current_month_background_removals.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.
endpoint_call_historyDaily API calls broken down by endpoint. Each key is a date (YYYY-MM-DD), and the value is an object mapping endpoints (such as
/v1/cars) to call counts for that day, newest day first.
Live Demo
Get a free API key to get started — no credit card required.
Code Examples
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
- Pass your API key in the
X-Api-Keyheader, as with every other endpoint, or as theapi_keyquery parameter (?api_key=YOUR_KEY). Either works. - Only the API call counts in
api_call_historyandendpoint_call_historyare stored. API inputs (including parameters, body, etc.) and API responses are not stored for privacy reasons. - 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?
Pass your API key in theX-Api-Keyheader, as with every other API Ninjas endpoint, or as theapi_keyquery parameter (for example?api_key=YOUR_API_KEY). Either works; 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.
Explore API integration use cases for recommended APIs and workflow examples.