The generated API clients are a work in progress, you can also find our stable clients on the Algolia documentation.

Skip to main content

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.

Base URL

The base URL for requests to the Usage API is:

  • https://usage.algolia.com

All requests must use HTTPS.

Authentication

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.

Response status and errors

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.

Version

The current version of the Usage API is version 1, as indicated by the /1/ in each endpoint's URL.

Usage statistics

Get various metrics related to the usage of your Algolia applications.

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

// 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

Content type
application/json
{ }

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.

object

Responses

Request samples

// 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

Content type
application/json
{ }

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.

object

Responses

Request samples

// 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

Content type
application/json
{ }

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

// 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

Content type
application/json
{ }

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 * to retrieve all usage metrics, otherwise add one or more of the following metrics, separated by a comma.

Search operations

  • search_operations. All search operations.
  • total_search_operations: Sum of all search operations.
  • total_search_requests: Sum of all search requests. The number of billed search requests is equal to this value minus querysuggestions_total_search_requests.
  • queries_operations. Number of single index search operations.
  • multi_queries_operations. Number of multi-index search operations.

ACL operations

  • acl_operations. All ACL operations.
  • total_acl_operations. Sum of all ACL operations.
  • get_api_keys_operations. Number of list API keys operations.
  • get_api_key_operations. Number of get API key permission operations.
  • add_api_key_operations. Number of create API key operations.
  • update_api_key_operations. Number of update API key operations.
  • delete_api_key_operations. Number of delete API key operations.
  • list_api_key_operations. Number of list index API keys operations.

Indexing operations

  • indexing_operations. All indexing operations.
  • total_indexing_operations. Sum of all indexing operations.
  • browse_operations. Number of browse index operations.
  • clear_index_operations. Number of clear records operations.
  • copy_move_operations. Number of copy or move index operations.
  • delete_index_operations. Number of delete index operations.
  • get_log_operations. Number of get logs operations.
  • get_settings_operations. Number of get settings operations.
  • set_settings_operations. Number of set settings operations.
  • list_indices_operations. Number of list indices operations.
  • wait_task_operations. Number of wait operations.

Record operations

Synonym operations

  • synonym_operations. All synonym operations.
  • total_synonym_operations. Sum of all synonym operations.
  • batch_synonym_operations. Number of save all synonyms operations.
  • clear_synonym_operations. Number of clear synonyms operations.
  • delete_synonym_operations. Number of delete synonym operations.
  • get_synonym_operations. Number of get synonym operations.
  • query_synonym_operations. Number of search synonyms operations.
  • update_synonym_operations. Number of save a synonym operations.

Rule operations

  • rule_operations. All rule operations.
  • total_rules_operations. Sum of all rule operations.
  • batch_rules_operations. Number of batch rules operations.
  • clear_rules_operations. Number of delete rule operations.
  • delete_rules_operations. Number of clear rules operations.
  • get_rules_operations. Number of get rule operations.
  • save_rules_operations. Number of save rule operations.
  • search_rules_operations. Number of search rules operations.

Total operations

  • total_recommend_requests. Number of Recommend requests
  • total_write_operations. Number of Write operations
  • total_read_operations. Number of read operations
  • total_operations. Sum of all operations

Total Query Suggestions operations

Query Suggestions operations are a subset of total_search_operations.

  • querysuggestions_total_search_operations. Number of Query Suggestions search operations.
  • querysuggestions_total_search_requests. Number of Query Suggestions search requests.
  • querysuggestions_total_acl_operations. Sum of all Query Suggestions ACL operations.
  • querysuggestions_total_indexing_operations. Number of Query Suggestions indexing operations.
  • querysuggestions_total_records_operations. Number of Query Suggestions record operations.
  • querysuggestions_total_synonym_operations. Number of Query Suggestions synonym operations.
  • querysuggestions_total_rules_operations. Number of Query Suggestions Rule operations.
  • querysuggestions_total_write_operations. Number of Query Suggestions Write operations.
  • querysuggestions_total_read_operations. Number of Query Suggestions Read operations.
  • querysuggestions_total_operations. Sum of all Query Suggestions operations.

Processing time

  • avg_processing_time. Average processing time (in milliseconds).
  • 90p_processing_time. 90th percentile of processing time (in milliseconds).
  • 99p_processing_time. 99th percentile of processing time (in milliseconds).
  • queries_above_last_ms_processing_time. Number of queries that take one or more seconds to process.

Indices

  • records. Number of records.
  • data_size. The size of the records (in bytes).
  • file_size. The size of the records and index metadata (in bytes).

Maximum queries per second

  • max_qps. Maximum queries per second per server.
  • region_max_qps. Maximum queries per second per region.
  • total_max_qps. Maximum queries per second across all servers.

Used search capacity

The following capacities are reported in percent:

  • used_search_capacity. Maximum search capacity used per server.
  • avg_used_search_capacity. Average search capacity used per server.
  • region_used_search_capacity. Maximum search capacity used per region.
  • region_avg_used_search_capacity. Average search capacity used per region.
  • total_used_search_capacity. Maximum search capacity used for all servers.
  • total_avg_used_search_capacity. Average used search capacity for all servers.

Degraded queries

Check the impact of degraded queries.

  • degraded_queries_ssd_used_queries_impacted. Percentage of degraded queries due to the Algolia search engine having to read from the server's SSD.
  • degraded_queries_ssd_used_seconds_impacted. Percentage of seconds affected by ssd_used degraded queries.
  • degraded_queries_max_capacity_queries_impacted. Percentage of degraded queries due to all search threads being used.
  • degraded_queries_max_capacity_seconds_impacted. Percentage of seconds affected by max_capacity degraded queries.
query Parameters
endDate
required
string
Example: endDate=2023-01-21

End date of the period to analyze, in YYYY-MM-DD format.

granularity
string
Default: "daily"
Enum: "daily" "hourly"

Granularity of the aggregated metrics.

  • hourly: the maximum time range for hourly metrics is 7 days.
  • daily: the maximum time range for daily metrics is 365 days.
startDate
required
string
Example: startDate=2022-09-19

Start date of the period to analyze, in YYYY-MM-DD format.

Responses

Request samples

// 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

Content type
application/json
{
  • "statistics": [
    ]
}

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 * to retrieve all usage metrics, otherwise add one or more of the following metrics, separated by a comma.

Search operations

  • search_operations. All search operations.
  • total_search_operations: Sum of all search operations.
  • total_search_requests: Sum of all search requests. The number of billed search requests is equal to this value minus querysuggestions_total_search_requests.
  • queries_operations. Number of single index search operations.
  • multi_queries_operations. Number of multi-index search operations.

ACL operations

  • acl_operations. All ACL operations.
  • total_acl_operations. Sum of all ACL operations.
  • get_api_keys_operations. Number of list API keys operations.
  • get_api_key_operations. Number of get API key permission operations.
  • add_api_key_operations. Number of create API key operations.
  • update_api_key_operations. Number of update API key operations.
  • delete_api_key_operations. Number of delete API key operations.
  • list_api_key_operations. Number of list index API keys operations.

Indexing operations

  • indexing_operations. All indexing operations.
  • total_indexing_operations. Sum of all indexing operations.
  • browse_operations. Number of browse index operations.
  • clear_index_operations. Number of clear records operations.
  • copy_move_operations. Number of copy or move index operations.
  • delete_index_operations. Number of delete index operations.
  • get_log_operations. Number of get logs operations.
  • get_settings_operations. Number of get settings operations.
  • set_settings_operations. Number of set settings operations.
  • list_indices_operations. Number of list indices operations.
  • wait_task_operations. Number of wait operations.

Record operations

Synonym operations

  • synonym_operations. All synonym operations.
  • total_synonym_operations. Sum of all synonym operations.
  • batch_synonym_operations. Number of save all synonyms operations.
  • clear_synonym_operations. Number of clear synonyms operations.
  • delete_synonym_operations. Number of delete synonym operations.
  • get_synonym_operations. Number of get synonym operations.
  • query_synonym_operations. Number of search synonyms operations.
  • update_synonym_operations. Number of save a synonym operations.

Rule operations

  • rule_operations. All rule operations.
  • total_rules_operations. Sum of all rule operations.
  • batch_rules_operations. Number of batch rules operations.
  • clear_rules_operations. Number of delete rule operations.
  • delete_rules_operations. Number of clear rules operations.
  • get_rules_operations. Number of get rule operations.
  • save_rules_operations. Number of save rule operations.
  • search_rules_operations. Number of search rules operations.

Total operations

  • total_recommend_requests. Number of Recommend requests
  • total_write_operations. Number of Write operations
  • total_read_operations. Number of read operations
  • total_operations. Sum of all operations

Total Query Suggestions operations

Query Suggestions operations are a subset of total_search_operations.

  • querysuggestions_total_search_operations. Number of Query Suggestions search operations.
  • querysuggestions_total_search_requests. Number of Query Suggestions search requests.
  • querysuggestions_total_acl_operations. Sum of all Query Suggestions ACL operations.
  • querysuggestions_total_indexing_operations. Number of Query Suggestions indexing operations.
  • querysuggestions_total_records_operations. Number of Query Suggestions record operations.
  • querysuggestions_total_synonym_operations. Number of Query Suggestions synonym operations.
  • querysuggestions_total_rules_operations. Number of Query Suggestions Rule operations.
  • querysuggestions_total_write_operations. Number of Query Suggestions Write operations.
  • querysuggestions_total_read_operations. Number of Query Suggestions Read operations.
  • querysuggestions_total_operations. Sum of all Query Suggestions operations.

Processing time

  • avg_processing_time. Average processing time (in milliseconds).
  • 90p_processing_time. 90th percentile of processing time (in milliseconds).
  • 99p_processing_time. 99th percentile of processing time (in milliseconds).
  • queries_above_last_ms_processing_time. Number of queries that take one or more seconds to process.

Indices

  • records. Number of records.
  • data_size. The size of the records (in bytes).
  • file_size. The size of the records and index metadata (in bytes).

Maximum queries per second

  • max_qps. Maximum queries per second per server.
  • region_max_qps. Maximum queries per second per region.
  • total_max_qps. Maximum queries per second across all servers.

Used search capacity

The following capacities are reported in percent:

  • used_search_capacity. Maximum search capacity used per server.
  • avg_used_search_capacity. Average search capacity used per server.
  • region_used_search_capacity. Maximum search capacity used per region.
  • region_avg_used_search_capacity. Average search capacity used per region.
  • total_used_search_capacity. Maximum search capacity used for all servers.
  • total_avg_used_search_capacity. Average used search capacity for all servers.

Degraded queries

Check the impact of degraded queries.

  • degraded_queries_ssd_used_queries_impacted. Percentage of degraded queries due to the Algolia search engine having to read from the server's SSD.
  • degraded_queries_ssd_used_seconds_impacted. Percentage of seconds affected by ssd_used degraded queries.
  • degraded_queries_max_capacity_queries_impacted. Percentage of degraded queries due to all search threads being used.
  • degraded_queries_max_capacity_seconds_impacted. Percentage of seconds affected by max_capacity degraded queries.
query Parameters
endDate
required
string
Example: endDate=2023-01-21

End date of the period to analyze, in YYYY-MM-DD format.

granularity
string
Default: "daily"
Enum: "daily" "hourly"

Granularity of the aggregated metrics.

  • hourly: the maximum time range for hourly metrics is 7 days.
  • daily: the maximum time range for daily metrics is 365 days.
startDate
required
string
Example: startDate=2022-09-19

Start date of the period to analyze, in YYYY-MM-DD format.

Responses

Request samples

// 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

Content type
application/json
{
  • "statistics": [
    ]
}