Usage API (1.0.0)
Download OpenAPI specification:Download
The Usage API gives you access to statistics about all requests made to your Algolia applications.
The base URL for requests to the Usage API is:
https://usage.algolia.com
All requests must use HTTPS.
To authenticate your API requests, add these headers:
x-algolia-application-id
. Your Algolia application ID.x-algolia-api-key
. The Usage API key.
You can find your application ID and Usage API key in the Algolia dashboard.
The Usage API returns JSON responses. Since JSON doesn't guarantee any specific ordering, don't rely on the order of attributes in the API response.
Successful responses return a 2xx
status. Client errors return a 4xx
status. Server errors are indicated by a 5xx
status.
Error responses have a message
property with more information.
The current version of the Usage API is version 1, as indicated by the /1/
in each endpoint's URL.
Send requests to the Algolia REST API
This method allow you to send requests to the Algolia REST API.
path Parameters
path required | string Example: /keys Path of the endpoint, anything after "/1" must be specified. |
query Parameters
object Query parameters to apply to the current query. |
Responses
Request samples
- C#
- Go
- Java
- JavaScript
- Kotlin
- PHP
- Python
- Ruby
- Scala
- Swift
// Initialize the client var client = new UsageClient(new UsageConfig("YOUR_APP_ID", "YOUR_API_KEY")); // Call the API var response = await client.CustomGetAsync("test/minimal");
Response samples
- 200
- 400
- 402
- 403
- 404
{ }
Send requests to the Algolia REST API
This method allow you to send requests to the Algolia REST API.
path Parameters
path required | string Example: /keys Path of the endpoint, anything after "/1" must be specified. |
query Parameters
object Query parameters to apply to the current query. |
Request Body schema: application/json
Parameters to send with the custom request.
Responses
Request samples
- C#
- Go
- Java
- JavaScript
- Kotlin
- PHP
- Python
- Ruby
- Scala
- Swift
// Initialize the client var client = new UsageClient(new UsageConfig("YOUR_APP_ID", "YOUR_API_KEY")); // Call the API var response = await client.CustomPostAsync("test/minimal");
Response samples
- 200
- 400
- 402
- 403
- 404
{ }
Send requests to the Algolia REST API
This method allow you to send requests to the Algolia REST API.
path Parameters
path required | string Example: /keys Path of the endpoint, anything after "/1" must be specified. |
query Parameters
object Query parameters to apply to the current query. |
Request Body schema: application/json
Parameters to send with the custom request.
Responses
Request samples
- C#
- Go
- Java
- JavaScript
- Kotlin
- PHP
- Python
- Ruby
- Scala
- Swift
// Initialize the client var client = new UsageClient(new UsageConfig("YOUR_APP_ID", "YOUR_API_KEY")); // Call the API var response = await client.CustomPutAsync("test/minimal");
Response samples
- 200
- 400
- 402
- 403
- 404
{ }
Send requests to the Algolia REST API
This method allow you to send requests to the Algolia REST API.
path Parameters
path required | string Example: /keys Path of the endpoint, anything after "/1" must be specified. |
query Parameters
object Query parameters to apply to the current query. |
Responses
Request samples
- C#
- Go
- Java
- JavaScript
- Kotlin
- PHP
- Python
- Ruby
- Scala
- Swift
// Initialize the client var client = new UsageClient(new UsageConfig("YOUR_APP_ID", "YOUR_API_KEY")); // Call the API var response = await client.CustomDeleteAsync("test/minimal");
Response samples
- 200
- 400
- 402
- 403
- 404
{ }
Retrieve usage information
Retrieves usage statistics evaluated over a specified period.
path Parameters
statistic required | string Enum: "*" "90p_processing_time" "99p_processing_time" "acl_operations" "add_api_key_operations" "add_record_operations" "avg_processing_time" "avg_used_search_capacity" "batch_operations" "batch_rules_operations" "batch_synonym_operations" "browse_operations" "clear_index_operations" "clear_rules_operations" "clear_synonym_operations" "copy_move_operations" "data_size" "degraded_queries_max_capacity_queries_impacted" "degraded_queries_max_capacity_seconds_impacted" "degraded_queries_ssd_used_queries_impacted" "degraded_queries_ssd_used_seconds_impacted" "delete_api_key_operations" "delete_by_query_operations" "delete_index_operations" "delete_record_operations" "delete_rules_operations" "delete_synonym_operations" "file_size" "get_api_key_operations" "get_api_keys_operations" "get_log_operations" "get_record_operations" "get_rules_operations" "get_settings_operations" "get_synonym_operations" "indexing_operations" "list_api_key_operations" "list_indices_operations" "max_qps" "multi_queries_operations" "partial_update_record_operations" "queries_above_last_ms_processing_time" "queries_operations" "query_synonym_operations" "querysuggestions_total_acl_operations" "querysuggestions_total_indexing_operations" "querysuggestions_total_operations" "querysuggestions_total_read_operations" "querysuggestions_total_records_operations" "querysuggestions_total_rules_operations" "querysuggestions_total_search_operations" "querysuggestions_total_search_requests" "querysuggestions_total_synonym_operations" "querysuggestions_total_write_operations" "record_operations" "records" "region_avg_used_search_capacity" "region_max_qps" "region_used_search_capacity" "rule_operations" "save_rules_operations" "search_operations" "search_rules_operations" "set_settings_operations" "synonym_operations" "total_acl_operations" "total_avg_used_search_capacity" "total_indexing_operations" "total_max_qps" "total_operations" "total_read_operations" "total_recommend_requests" "total_records_operations" "total_rules_operations" "total_search_operations" "total_search_requests" "total_synonym_operations" "total_used_search_capacity" "total_write_operations" "update_api_key_operations" "update_record_operations" "update_synonym_operations" "used_search_capacity" "wait_task_operations" Example: records,max_qps,region_max_qps Usage statistics to retrieve. Use Search operations
ACL operations
Indexing operations
Record operations
Synonym operations
Rule operations
Total operations
Total Query Suggestions operations Query Suggestions operations are a subset of
Processing time
Indices
Maximum queries per second
Used search capacity The following capacities are reported in percent:
Degraded queries Check the impact of degraded queries.
|
query Parameters
endDate required | string Example: endDate=2023-01-21 End date of the period to analyze, in |
granularity | string Default: "daily" Enum: "daily" "hourly" Granularity of the aggregated metrics.
|
startDate required | string Example: startDate=2022-09-19 Start date of the period to analyze, in |
Responses
Request samples
- C#
- Go
- Java
- JavaScript
- Kotlin
- PHP
- Python
- Ruby
- Scala
- Swift
// Initialize the client var client = new UsageClient(new UsageConfig("YOUR_APP_ID", "YOUR_API_KEY")); // Call the API var response = await client.GetUsageAsync( Enum.Parse<Statistic>("QueriesOperations"), "2024-04-03T12:46:43Z", "2024-04-05T12:46:43Z" );
Response samples
- 200
- 400
- 401
- 403
- 404
- 422
{- "statistics": [
- {
- "t": 1455451200000,
- "v": 0
}
]
}
Retrieve usage information for one index
Retrieves the selected usage statistics for one index.
path Parameters
indexName required | string Example: YourIndexName Name of the index on which to perform the operation. |
statistic required | string Enum: "*" "90p_processing_time" "99p_processing_time" "acl_operations" "add_api_key_operations" "add_record_operations" "avg_processing_time" "avg_used_search_capacity" "batch_operations" "batch_rules_operations" "batch_synonym_operations" "browse_operations" "clear_index_operations" "clear_rules_operations" "clear_synonym_operations" "copy_move_operations" "data_size" "degraded_queries_max_capacity_queries_impacted" "degraded_queries_max_capacity_seconds_impacted" "degraded_queries_ssd_used_queries_impacted" "degraded_queries_ssd_used_seconds_impacted" "delete_api_key_operations" "delete_by_query_operations" "delete_index_operations" "delete_record_operations" "delete_rules_operations" "delete_synonym_operations" "file_size" "get_api_key_operations" "get_api_keys_operations" "get_log_operations" "get_record_operations" "get_rules_operations" "get_settings_operations" "get_synonym_operations" "indexing_operations" "list_api_key_operations" "list_indices_operations" "max_qps" "multi_queries_operations" "partial_update_record_operations" "queries_above_last_ms_processing_time" "queries_operations" "query_synonym_operations" "querysuggestions_total_acl_operations" "querysuggestions_total_indexing_operations" "querysuggestions_total_operations" "querysuggestions_total_read_operations" "querysuggestions_total_records_operations" "querysuggestions_total_rules_operations" "querysuggestions_total_search_operations" "querysuggestions_total_search_requests" "querysuggestions_total_synonym_operations" "querysuggestions_total_write_operations" "record_operations" "records" "region_avg_used_search_capacity" "region_max_qps" "region_used_search_capacity" "rule_operations" "save_rules_operations" "search_operations" "search_rules_operations" "set_settings_operations" "synonym_operations" "total_acl_operations" "total_avg_used_search_capacity" "total_indexing_operations" "total_max_qps" "total_operations" "total_read_operations" "total_recommend_requests" "total_records_operations" "total_rules_operations" "total_search_operations" "total_search_requests" "total_synonym_operations" "total_used_search_capacity" "total_write_operations" "update_api_key_operations" "update_record_operations" "update_synonym_operations" "used_search_capacity" "wait_task_operations" Example: records,max_qps,region_max_qps Usage statistics to retrieve. Use Search operations
ACL operations
Indexing operations
Record operations
Synonym operations
Rule operations
Total operations
Total Query Suggestions operations Query Suggestions operations are a subset of
Processing time
Indices
Maximum queries per second
Used search capacity The following capacities are reported in percent:
Degraded queries Check the impact of degraded queries.
|
query Parameters
endDate required | string Example: endDate=2023-01-21 End date of the period to analyze, in |
granularity | string Default: "daily" Enum: "daily" "hourly" Granularity of the aggregated metrics.
|
startDate required | string Example: startDate=2022-09-19 Start date of the period to analyze, in |
Responses
Request samples
- C#
- Go
- Java
- JavaScript
- Kotlin
- PHP
- Python
- Ruby
- Scala
- Swift
// Initialize the client var client = new UsageClient(new UsageConfig("YOUR_APP_ID", "YOUR_API_KEY")); // Call the API var response = await client.GetIndexUsageAsync( Enum.Parse<Statistic>("QueriesOperations"), "myIndexName", "2024-04-03T12:46:43Z", "2024-04-05T12:46:43Z" );
Response samples
- 200
- 400
- 401
- 403
- 404
- 422
{- "statistics": [
- {
- "t": 1455451200000,
- "v": 0
}
]
}