Search Analytics API
Scale Plan or higher requiredThe Search Analytics API allows you to retrieve and explore your account's search analytics. Access requires a Scale plan or above.
This API is free of charge to use and provides access to your search history from the last year only. Older search records are not accessible via this endpoint.
API Parameters
Search Parameters
-
- Name
-
api_key - Required
- Required
- Description
-
The
api_keyauthenticates your requests. Use it as a query parameter (https://www.searchapi.io/api/v1/search?api_key=YOUR_API_KEY) or in the Authorization header (Bearer YOUR_API_KEY).
-
- Name
-
engine - Required
- Optional
- Description
-
Filter analytics by specific search engine. Accepts engine names like
google,bing,amazonorallfor all engines. Defaults toall.
-
- Name
-
bucket - Required
- Optional
- Description
-
Time bucket used for aggregating your search analytics. Accepts
dailyorhourly. Defaults todaily.
Time Period
-
- Name
-
time_period - Required
- Optional
- Description
-
Preset time period to filter analytics. Accepts
last_day,last_week,last_month,last_6_months, orlast_year. Overridestime_period_minandtime_period_maxif provided.
-
- Name
-
time_period_min - Required
- Optional
- Description
-
The start of the time period to filter by. Accepts date format (
2024-10-01) or RFC 3339 datetime format (2024-10-01T14:30:00Z,2024-10-01T14:30:00+05:00). Defaults to one month ago.
If a timezone is provided, it must be the same astime_period_maxand it will be used to split the buckets.
-
- Name
-
time_period_max - Required
- Optional
- Description
-
The end of the time period to filter by. Accepts date format (
2024-10-15) or RFC 3339 datetime format (2024-10-15T23:59:59Z,2024-10-15T23:59:59+05:00). Defaults to today.
If a timezone is provided, it must be the same astime_period_minand it will be used to split the buckets.
Zero Data Retention
-
- Name
-
zero_retention - Enterprise Only
- Enterprise Only
- Required
- Optional
- Description
-
Set this parameter to
trueto disable all logging and persistent storage. No request parameters, HTML, or JSON responses are stored or logged. Suitable for high-compliance use cases. Debugging and support may be limited while enabled.
API Examples
Search Analytics
This example retrieves the search analytics for the all engines from 2026-03-03 to 2026-04-03.
The response is broken down by day since bucket defaults to daily.
Response parameters:
search_parameters- Parameters used in the search.summary- Summary of the search analytics for the entire time period for all engines.performance_by_engine- Performance of each search engine for the entire time period.buckets- Search analytics for each interval, broken down by thebucketparameter.
https://www.searchapi.io/api/v1/search_analytics?time_period_max=2026-04-03&time_period_min=2026-03-03
- Python
- Node
- Ruby
- Java
- Go
- PHP
- Bash
- R
- Kotlin
- Swift
- C#
- C
- C++
- requests
import requests
url = "https://www.searchapi.io/api/v1/search_analytics"
params = {
"time_period_min": "2026-03-03",
"time_period_max": "2026-04-03"
}
response = requests.get(url, params=params)
print(response.text)
{
"search_parameters": {
"engine": "all",
"time_period_min": "2025-07-16T00:00:00Z",
"time_period_max": "2025-08-15T23:59:59Z",
"bucket": "daily"
},
"summary": {
"avg_speed_time_s": 2.66,
"total_searches": 1739,
"total_success": 1739,
"success_rate": 100,
"total_errors": 0,
"error_rate": 0
},
"performance_by_engine": [
{
"engine": "google",
"avg_speed_time_s": 1.78,
"total_searches": 359,
"success_count": 359,
"success_rate": 100,
"error_count": 0,
"error_rate": 0
},
...
],
"buckets": [
{
"start_datetime": "2025-07-16T00:00:00Z",
"end_datetime": "2025-07-16T23:59:59Z",
"avg_speed_time_s": 1.8,
"total_searches": 3,
"success_count": 3,
"success_rate": 100,
"error_count": 0,
"error_rate": 0
},
{
"start_datetime": "2025-07-17T00:00:00Z",
"end_datetime": "2025-07-17T23:59:59Z",
"avg_speed_time_s": 1.6,
"total_searches": 34,
"success_count": 34,
"success_rate": 100,
"error_count": 0,
"error_rate": 0
}
]
}
Hourly breakdowns
Using bucket=hourly will return search analytics broken down by hour.
https://www.searchapi.io/api/v1/search_analytics?bucket=hourly
- Python
- Node
- Ruby
- Java
- Go
- PHP
- Bash
- R
- Kotlin
- Swift
- C#
- C
- C++
- requests
import requests
url = "https://www.searchapi.io/api/v1/search_analytics"
params = {
"bucket": "hourly"
}
response = requests.get(url, params=params)
print(response.text)
{
"buckets": [
{
"start_datetime": "2025-07-17T15:00:00Z",
"end_datetime": "2025-07-17T15:59:59Z",
"avg_speed_time_s": 1.3,
"total_searches": 3000,
"success_count": 3000,
"success_rate": 100,
"error_count": 0,
"error_rate": 0
},
{
"start_datetime": "2025-07-17T16:00:00Z",
"end_datetime": "2025-07-17T16:59:59Z",
"avg_speed_time_s": 1.1,
"total_searches": 2000,
"success_count": 2000,
"success_rate": 100,
"error_count": 0,
"error_rate": 0
},
...
]
}
By engine
If you need analytics for a specific engine, you can filter by engine using the engine parameter.
performance_by_engine is omitted from response when engine is provided.
https://www.searchapi.io/api/v1/search_analytics?engine=google
- Python
- Node
- Ruby
- Java
- Go
- PHP
- Bash
- R
- Kotlin
- Swift
- C#
- C
- C++
- requests
import requests
url = "https://www.searchapi.io/api/v1/search_analytics"
params = {
"engine": "google"
}
response = requests.get(url, params=params)
print(response.text)
{
"search_parameters": {
"engine": "google",
"time_period_min": "2025-07-16T00:00:00.000Z",
"time_period_max": "2025-08-15T23:59:59.999Z",
"bucket": "daily"
},
"summary": {
"avg_speed_time_s": 1.03,
"total_searches": 66,
"total_success": 66,
"success_rate": 100,
"total_errors": 0,
"error_rate": 0
},
"buckets": [
{
"start_datetime": "2025-07-16T00:00:00Z",
"end_datetime": "2025-07-16T23:59:59Z",
"avg_speed_time_s": 1.8,
"total_searches": 3,
"success_count": 3,
"success_rate": 100,
"error_count": 0,
"error_rate": 0
},
{
"start_datetime": "2025-07-17T00:00:00Z",
"end_datetime": "2025-07-17T23:59:59Z",
"avg_speed_time_s": 1.2,
"total_searches": 5,
"success_count": 5,
"success_rate": 100,
"error_count": 0,
"error_rate": 0
},
...
]
}