Historical Rank Overview
This endpoint will provide you with historical data on rankings and traffic of the specified domain, such as domain ranking distribution in SERPs and estimated monthly traffic volume for both organic and paid results.
This endpoint will provide you with historical data on rankings and traffic of the specified domain, such as domain ranking distribution in SERPs and estimated monthly traffic volume for both organic and paid results.
Instead of ‘login’ and ‘password’ use your credentials from https://app.dataforseo.com/api-access
<?php // You can download this file from here https://cdn.dataforseo.com/v3/examples/php/php_RestClient.zip require('RestClient.php'); $api_url = 'https://api.dataforseo.com/'; // Instead of 'login' and 'password' use your credentials from https://app.dataforseo.com/api-access $client = new RestClient($api_url, null, 'login', 'password'); $post_array = array(); // simple way to set a task $post_array[] = array( "target" => "dataforseo.com", "language_name" => "English", "location_code" => 2840, "date_from" => "2021-01-01", "date_to" => "2021-03-29" ); try { // POST /v3/dataforseo_labs/google/historical_rank_overview/live $result = $client->post('/v3/dataforseo_labs/google/historical_rank_overview/live', $post_array); print_r($result); // do something with post result } catch (RestClientException $e) { echo "\n"; print "HTTP code: {$e->getHttpCode()}\n"; print "Error code: {$e->getCode()}\n"; print "Message: {$e->getMessage()}\n"; print $e->getTraceAsString(); echo "\n"; } $client = null; ?>
The above command returns JSON structured like this:
{ "version": "0.1.20240514", "status_code": 20000, "status_message": "Ok.", "time": "0.3473 sec.", "cost": 0.106, "tasks_count": 1, "tasks_error": 0, "tasks": [ { "id": "06131943-1535-0406-0000-0f4d2c2727db", "status_code": 20000, "status_message": "Ok.", "time": "0.2914 sec.", "cost": 0.106, "result_count": 1, "path": [ "v3", "dataforseo_labs", "google", "historical_rank_overview", "live" ], "data": { "api": "dataforseo_labs", "function": "historical_rank_overview", "se_type": "google", "target": "walmart.com", "language_name": "English", "location_code": 2840 }, "result": [ { "se_type": "google", "target": "walmart.com", "location_code": 2840, "language_code": "en", "total_count": 6, "items_count": 6, "items": [ { "se_type": "google", "year": 2024, "month": 6, "metrics": { "organic": { "pos_1": 509822, "pos_2_3": 1150822, "pos_4_10": 4724643, "pos_11_20": 5257155, "pos_21_30": 4367957, "pos_31_40": 3674706, "pos_41_50": 3088802, "pos_51_60": 2557156, "pos_61_70": 2073114, "pos_71_80": 1699732, "pos_81_90": 1418531, "pos_91_100": 1006455, "etv": 739386585.3538767, "impressions_etv": 50033708.736064754, "count": 31529023, "estimated_paid_traffic_cost": 680544683.7358212, "is_new": 13230766, "is_up": 7521177, "is_down": 8776911, "is_lost": 12264646, "clickstream_etv": 8241904.270340362, "clickstream_gender_distribution": { "female": 38, "male": 61 }, "clickstream_age_distribution": { "18-24": 19, "25-34": 34, "35-44": 35, "45-54": 6, "55-64": 3 } }, "paid": { "pos_1": 3722, "pos_2_3": 642, "pos_4_10": 211, "pos_11_20": 1, "pos_21_30": 0, "pos_31_40": 0, "pos_41_50": 0, "pos_51_60": 0, "pos_61_70": 0, "pos_71_80": 0, "pos_81_90": 0, "pos_91_100": 0, "etv": 10545915.813505903, "impressions_etv": 2885339.860408403, "count": 4576, "estimated_paid_traffic_cost": 3392752.083181726, "is_new": 4050, "is_up": 133, "is_down": 97, "is_lost": 9849, "clickstream_etv": 282502.15979999985, "clickstream_gender_distribution": { "female": 56, "male": 43 }, "clickstream_age_distribution": { "18-24": 9, "25-34": 19, "35-44": 41, "45-54": 16, "55-64": 12 } } } }, { "se_type": "google", "year": 2024, "month": 5, "metrics": { "organic": { "pos_1": 518159, "pos_2_3": 1192459, "pos_4_10": 4743488, "pos_11_20": 5229984, "pos_21_30": 4285707, "pos_31_40": 3613820, "pos_41_50": 3062787, "pos_51_60": 2543448, "pos_61_70": 2065034, "pos_71_80": 1687959, "pos_81_90": 1401378, "pos_91_100": 991627, "etv": 743947951.9096156, "impressions_etv": 50308589.4210616, "count": 31335987, "estimated_paid_traffic_cost": 685357589.2078723, "is_new": 13419522, "is_up": 7525731, "is_down": 8382388, "is_lost": 12218230, "clickstream_etv": 8985627.835984584, "clickstream_gender_distribution": { "female": 34, "male": 65 }, "clickstream_age_distribution": { "18-24": 1, "25-34": 47, "35-44": 46, "45-54": 3, "55-64": 0 } }, "paid": { "pos_1": 4031, "pos_2_3": 622, "pos_4_10": 223, "pos_11_20": 1, "pos_21_30": 0, "pos_31_40": 0, "pos_41_50": 0, "pos_51_60": 0, "pos_61_70": 0, "pos_71_80": 0, "pos_81_90": 0, "pos_91_100": 0, "etv": 9764996.324482664, "impressions_etv": 2885658.8824956194, "count": 4877, "estimated_paid_traffic_cost": 3199411.5351820625, "is_new": 4326, "is_up": 130, "is_down": 109, "is_lost": 12957, "clickstream_etv": 301403.0448, "clickstream_gender_distribution": { "female": 47, "male": 52 }, "clickstream_age_distribution": { "18-24": 0, "25-34": 28, "35-44": 59, "45-54": 9, "55-64": 1 } } } }, { "se_type": "google", "year": 2024, "month": 4, "metrics": { "organic": { "pos_1": 558191, "pos_2_3": 1357499, "pos_4_10": 4924178, "pos_11_20": 5300462, "pos_21_30": 4221710, "pos_31_40": 3570377, "pos_41_50": 3036258, "pos_51_60": 2507072, "pos_61_70": 2033914, "pos_71_80": 1643909, "pos_81_90": 1333932, "pos_91_100": 930041, "etv": 779520854.9144412, "impressions_etv": 52794571.86772727, "count": 31417571, "estimated_paid_traffic_cost": 720300471.252897, "is_new": 14766318, "is_up": 7855547, "is_down": 6891033, "is_lost": 12641150, "clickstream_etv": 0, "clickstream_gender_distribution": { "female": 0, "male": 0 }, "clickstream_age_distribution": { "18-24": 0, "25-34": 0, "35-44": 0, "45-54": 0, "55-64": 0 } }, "paid": { "pos_1": 6754, "pos_2_3": 1075, "pos_4_10": 331, "pos_11_20": 0, "pos_21_30": 0, "pos_31_40": 0, "pos_41_50": 0, "pos_51_60": 0, "pos_61_70": 0, "pos_71_80": 0, "pos_81_90": 0, "pos_91_100": 0, "etv": 9211994.069159314, "impressions_etv": 3028338.9325954467, "count": 8160, "estimated_paid_traffic_cost": 2961977.858257655, "is_new": 7916, "is_up": 55, "is_down": 61, "is_lost": 40255, "clickstream_etv": 0, "clickstream_gender_distribution": { "female": 0, "male": 0 }, "clickstream_age_distribution": { "18-24": 0, "25-34": 0, "35-44": 0, "45-54": 0, "55-64": 0 } } } }, { "se_type": "google", "year": 2024, "month": 3, "metrics": { "organic": { "pos_1": 563683, "pos_2_3": 1322095, "pos_4_10": 4792967, "pos_11_20": 4869136, "pos_21_30": 3915619, "pos_31_40": 3370293, "pos_41_50": 2898255, "pos_51_60": 2425421, "pos_61_70": 1994127, "pos_71_80": 1636323, "pos_81_90": 1339453, "pos_91_100": 935445, "etv": 762340322.7934461, "impressions_etv": 54323434.67761994, "count": 30062944, "estimated_paid_traffic_cost": 680955699.9671698, "is_new": 12535336, "is_up": 7113255, "is_down": 8255930, "is_lost": 11900096, "clickstream_etv": 0, "clickstream_gender_distribution": { "female": 0, "male": 0 }, "clickstream_age_distribution": { "18-24": 0, "25-34": 0, "35-44": 0, "45-54": 0, "55-64": 0 } }, "paid": { "pos_1": 40720, "pos_2_3": 1111, "pos_4_10": 274, "pos_11_20": 0, "pos_21_30": 0, "pos_31_40": 0, "pos_41_50": 0, "pos_51_60": 0, "pos_61_70": 0, "pos_71_80": 0, "pos_81_90": 0, "pos_91_100": 0, "etv": 3773664.9025530517, "impressions_etv": 396712.1689415127, "count": 42105, "estimated_paid_traffic_cost": 4692455.695887562, "is_new": 42083, "is_up": 9, "is_down": 8, "is_lost": 7221, "clickstream_etv": 0, "clickstream_gender_distribution": { "female": 0, "male": 0 }, "clickstream_age_distribution": { "18-24": 0, "25-34": 0, "35-44": 0, "45-54": 0, "55-64": 0 } } } }, { "se_type": "google", "year": 2024, "month": 2, "metrics": { "organic": { "pos_1": 562105, "pos_2_3": 1312901, "pos_4_10": 4769571, "pos_11_20": 4776698, "pos_21_30": 3860081, "pos_31_40": 3350778, "pos_41_50": 2905275, "pos_51_60": 2447029, "pos_61_70": 2025784, "pos_71_80": 1671843, "pos_81_90": 1373103, "pos_91_100": 959704, "etv": 718399615.0404546, "impressions_etv": 54321171.62086673, "count": 30015004, "estimated_paid_traffic_cost": 628047254.0836341, "is_new": 11974586, "is_up": 6343980, "is_down": 9445051, "is_lost": 11789235, "clickstream_etv": 0, "clickstream_gender_distribution": { "female": 0, "male": 0 }, "clickstream_age_distribution": { "18-24": 0, "25-34": 0, "35-44": 0, "45-54": 0, "55-64": 0 } }, "paid": { "pos_1": 54110, "pos_2_3": 947, "pos_4_10": 137, "pos_11_20": 0, "pos_21_30": 0, "pos_31_40": 0, "pos_41_50": 0, "pos_51_60": 0, "pos_61_70": 0, "pos_71_80": 0, "pos_81_90": 0, "pos_91_100": 0, "etv": 3687987.6822375953, "impressions_etv": 411514.92065660655, "count": 55194, "estimated_paid_traffic_cost": 4500352.398346298, "is_new": 55167, "is_up": 5, "is_down": 13, "is_lost": 843, "clickstream_etv": 0, "clickstream_gender_distribution": { "female": 0, "male": 0 }, "clickstream_age_distribution": { "18-24": 0, "25-34": 0, "35-44": 0, "45-54": 0, "55-64": 0 } } } }, { "se_type": "google", "year": 2024, "month": 1, "metrics": { "organic": { "pos_1": 553410, "pos_2_3": 1329303, "pos_4_10": 4952170, "pos_11_20": 4801954, "pos_21_30": 3886121, "pos_31_40": 3354368, "pos_41_50": 2881108, "pos_51_60": 2412761, "pos_61_70": 1994232, "pos_71_80": 1645283, "pos_81_90": 1352431, "pos_91_100": 946924, "etv": 726778104.9467928, "impressions_etv": 56122434.750503644, "count": 30110098, "estimated_paid_traffic_cost": 745933021.9422338, "is_new": 12827769, "is_up": 5945949, "is_down": 9241808, "is_lost": 12282061, "clickstream_etv": 0, "clickstream_gender_distribution": { "female": 0, "male": 0 }, "clickstream_age_distribution": { "18-24": 0, "25-34": 0, "35-44": 0, "45-54": 0, "55-64": 0 } }, "paid": { "pos_1": 449, "pos_2_3": 113, "pos_4_10": 12, "pos_11_20": 0, "pos_21_30": 0, "pos_31_40": 0, "pos_41_50": 0, "pos_51_60": 0, "pos_61_70": 0, "pos_71_80": 0, "pos_81_90": 0, "pos_91_100": 0, "etv": 23985.645048499107, "impressions_etv": 13137.270827203989, "count": 574, "estimated_paid_traffic_cost": 25575.684668798, "is_new": 564, "is_up": 2, "is_down": 0, "is_lost": 195, "clickstream_etv": 0, "clickstream_gender_distribution": { "female": 0, "male": 0 }, "clickstream_age_distribution": { "18-24": 0, "25-34": 0, "35-44": 0, "45-54": 0, "55-64": 0 } } } } ] } ] } ] }
All POST data should be sent in the JSON format (UTF-8 encoding). The task setting is done using the POST method. When setting a task, you should send all task parameters in the task array of the generic POST array. You can send up to 2000 API calls per minute. The maximum number of requests that can be sent simultaneously is limited to 30.
You can specify the number of results you want to retrieve, filter and sort them.
Below you will find a detailed description of the fields you can use for setting a task.
Description of the fields for setting a task:
Field name | Type | Description |
---|---|---|
target |
string | domain required field the domain name of the target website the domain should be specified without https:// and www. |
location_name |
string | full name of the location required field if you don’t specify location_code Note: it is required to specify either location_name or location_code you can receive the list of available locations with their location_name by making a separate request to thehttps://api.dataforseo.com/v3/dataforseo_labs/locations_and_languages example: United Kingdom |
location_code |
integer | location code required field if you don’t specify location_name Note: it is required to specify either location_name or location_code you can receive the list of available locations with their location_code by making a separate request to thehttps://api.dataforseo.com/v3/dataforseo_labs/locations_and_languages example: 2840 |
language_name |
string | full name of the language required field if you don’t specify language_code Note: it is required to specify either language_name or language_code you can receive the list of available locations with their language_name by making a separate request to thehttps://api.dataforseo.com/v3/dataforseo_labs/locations_and_languages example: English |
language_code |
string | language code required field if you don’t specify language_name Note: it is required to specify either language_name or language_code you can receive the list of available locations with their language_code by making a separate request to thehttps://api.dataforseo.com/v3/dataforseo_labs/locations_and_languages example: en |
date_from |
string | starting date of the time range optional field if you don’t specify this field, the data will be provided for the previous 6 months minimal possible value: 2020-10-01 date format: "yyyy-mm-dd"
|
date_to |
string | ending date of the time range optional field if you don’t specify this field, the today’s date will be used by default date format: "yyyy-mm-dd" example: "2021-04-01" |
correlate |
boolean | correlate data with previously obtained datasets optional field default value: true if you use this parameter, our system will correlate data you obtain now with previously obtained datasets this parameter is intended to mitigate any inconsistencies that may result from changes to our database we recommend always setting correlate to true |
ignore_synonyms |
boolean | ignore highly similar keywords optional field if set to true , only data based on core keywords will be returned, data for all highly similar keywords will be excluded;default value: false |
include_clickstream_data |
boolean | include or exclude data from clickstream-based metrics in the result optional field if the parameter is set to true , you will receive clickstream_etv , clickstream_gender_distribution , and clickstream_age_distribution fields with clickstream data in the response;default value: false ;
Note: historical clickstream data is available from 2024/05 (May, 2024); |
tag |
string | user-defined task identifier optional field the character limit is 255 you can use this parameter to identify the task and match it with the result you will find the specified tag value in the data object of the response |
As a response of the API server, you will receive JSON-encoded data containing a tasks
array with the information specific to the set tasks.
Description of the fields in the results array:
Field name | Type | Description |
---|---|---|
version |
string | the current version of the API |
status_code |
integer | general status code you can find the full list of the response codes here Note: we strongly recommend designing a necessary system for handling related exceptional or error conditions |
status_message |
string | general informational message you can find the full list of general informational messages here |
time |
string | execution time, seconds |
cost |
float | total tasks cost, USD |
tasks_count |
integer | the number of tasks in the tasks array |
tasks_error |
integer | the number of tasks in the tasks array returned with an error |
tasks |
array | array of tasks |
id |
string | task identifier unique task identifier in our system in the UUID format |
status_code |
integer | status code of the task generated by DataForSEO; can be within the following range: 10000-60000 you can find the full list of the response codes here |
status_message |
string | informational message of the task you can find the full list of general informational messages here |
time |
string | execution time, seconds |
cost |
float | cost of the task, USD |
result_count |
integer | number of elements in the result array |
path |
array | URL path |
data |
object | contains the same parameters that you specified in the POST request |
result |
array | array of results |
se_type |
string | search engine type |
target |
string | target domain in a POST array |
location_code |
integer | location code in a POST array |
language_code |
string | language code in a POST array |
total_count |
integer | total amount of results in our database relevant to your request |
items_count |
integer | the number of results returned in the items array |
items |
array | contains historical ranking and traffic data |
se_type |
string | search engine type |
year |
integer | year for which the data is provided |
month |
integer | month for which the data is provided |
metrics |
object | ranking data relevant to the specified domain |
organic |
object | ranking and traffic data from organic search |
pos_1 |
integer | number of organic SERPs where the domain ranks #1 |
pos_2_3 |
integer | number of organic SERPs where the domain ranks #2-3 |
pos_4_10 |
integer | number of organic SERPs where the domain ranks #4-10 |
pos_11_20 |
integer | number of organic SERPs where the domain ranks #11-20 |
pos_21_30 |
integer | number of organic SERPs where the domain ranks #21-30 |
pos_31_40 |
integer | number of organic SERPs where the domain ranks #31-40 |
pos_41_50 |
integer | number of organic SERPs where the domain ranks #41-50 |
pos_51_60 |
integer | number of organic SERPs where the domain ranks #51-60 |
pos_61_70 |
integer | number of organic SERPs where the domain ranks #61-70 |
pos_71_80 |
integer | number of organic SERPs where the domain ranks #71-80 |
pos_81_90 |
integer | number of organic SERPs where the domain ranks #81-90 |
pos_91_100 |
integer | number of organic SERPs where the domain ranks #91-100 |
etv |
float | estimated traffic volume estimated organic monthly traffic to the domain calculated as the product of CTR (click-through-rate) and search volume values of all keywords the domain ranks for learn more about how the metric is calculated in this help center article |
impressions_etv |
float | estimated traffic volume based on impressions estimated organic monthly traffic to the domain calculated as the product of CTR (click-through-rate) and impressions values of all keywords the domain ranks for learn more about how the metric is calculated in this help center article |
count |
integer | total count of organic SERPs that contain the domain |
estimated_paid_traffic_cost |
float | estimated cost of converting organic search traffic into paid represents the estimated monthly cost of running ads (USD) for all keywords that a domain ranks for the metric is calculated as the product of organic etv and paid cpc values and indicates the cost of driving the estimated volume of monthly organic traffic through PPC advertising in Google Searchlearn more about how the metric is calculated in this help center article |
is_new |
integer | number of new ranked elements indicates how many new ranked elements were found for the indicated target |
is_up |
integer | rank went up indicates how many ranked elements of the indicated target went up |
is_down |
integer | rank went down indicates how many ranked elements of the indicated target went down |
is_lost |
integer | lost ranked elements indicates how many ranked elements of the indicated target were previously presented in SERPs, but weren’t found during the last check |
clickstream_etv |
integer | estimated traffic volume based on clickstream data calculated as the product of click-through-rate and clickstream search volume values of all keywords the domain ranks for to retrieve results for this field, the parameter include_clickstream_data must be set to true learn more about how the metric is calculated in this help center article |
clickstream_gender_distribution |
object | distribution of estimated clickstream-based metrics by gender to retrieve results for this field, the parameter include_clickstream_data must be set to true learn more about how the metric is calculated in this help center article |
female |
integer | number of female users in the relevant clickstream dataset |
male |
integer | number of male users in the relevant clickstream dataset |
clickstream_age_distribution |
object | distribution of clickstream-based metrics by age to retrieve results for this field, the parameter include_clickstream_data must be set to true learn more about how the metric is calculated in this help center article |
18-24 |
integer | number of users in the relevant clickstream dataset that fall within the 18-24 age range |
25-34 |
integer | number of users in the relevant clickstream dataset that fall within the 25-34 age range |
35-44 |
integer | number of users in the relevant clickstream dataset that fall within the 35-44 age range |
45-54 |
integer | number of users in the relevant clickstream dataset that fall within the 45-54 age range |
55-64 |
integer | number of users in the relevant clickstream dataset that fall within the 55-64 age range |
paid |
object | ranking and traffic data from paid search |
pos_1 |
integer | number of paid SERPs where the domain ranks #1 |
pos_2_3 |
integer | number of paid SERPs where the domain ranks #2-3 |
pos_4_10 |
integer | number of paid SERPs where the domain ranks #4-10 |
pos_11_20 |
integer | number of paid SERPs where the domain ranks #11-20 |
pos_21_30 |
integer | number of paid SERPs where the domain ranks #21-30 |
pos_31_40 |
integer | number of paid SERPs where the domain ranks #31-40 |
pos_41_50 |
integer | number of paid SERPs where the domain ranks #41-50 |
pos_51_60 |
integer | number of paid SERPs where the domain ranks #51-60 |
pos_61_70 |
integer | number of paid SERPs where the domain ranks #61-70 |
pos_71_80 |
integer | number of paid SERPs where the domain ranks #71-80 |
pos_81_90 |
integer | number of paid SERPs where the domain ranks #81-90 |
pos_91_100 |
integer | number of paid SERPs where the domain ranks #91-100 |
etv |
float | estimated traffic volume estimated paid monthly traffic to the domain calculated as the product of CTR (click-through-rate) and search volume values of all keywords the domain ranks for learn more about how the metric is calculated in this help center article |
impressions_etv |
float | estimated traffic volume based on impressions estimated paid monthly traffic to the domain calculated as the product of CTR (click-through-rate) and impressions values of all keywords the domain ranks for learn more about how the metric is calculated in this help center article |
count |
integer | total count of paid SERPs that contain the domain |
estimated_paid_traffic_cost |
float | estimated cost of monthly search traffic represents the estimated cost of paid monthly traffic (USD) based on etv and cpc valueslearn more about how the metric is calculated in this help center article |
is_new |
integer | number of new ranked elements indicates how many new ranked elements were found for the indicated target |
is_up |
integer | rank went up indicates how many ranked elements of the indicated target went up |
is_down |
integer | rank went down indicates how many ranked elements of the indicated target went down |
is_lost |
integer | lost ranked elements indicates how many ranked elements of the indicated target were previously presented in SERPs, but weren’t found during the last check |
clickstream_etv |
integer | estimated traffic volume based on clickstream data calculated as the product of click-through-rate and clickstream search volume values of all keywords the domain ranks for to retrieve results for this field, the parameter include_clickstream_data must be set to true learn more about how the metric is calculated in this help center article |
clickstream_gender_distribution |
object | distribution of estimated clickstream-based metrics by gender to retrieve results for this field, the parameter include_clickstream_data must be set to true learn more about how the metric is calculated in this help center article |
female |
integer | number of female users in the relevant clickstream dataset |
male |
integer | number of male users in the relevant clickstream dataset |
clickstream_age_distribution |
object | distribution of clickstream-based metrics by age to retrieve results for this field, the parameter include_clickstream_data must be set to true learn more about how the metric is calculated in this help center article |
18-24 |
integer | number of users in the relevant clickstream dataset that fall within the 18-24 age range |
25-34 |
integer | number of users in the relevant clickstream dataset that fall within the 25-34 age range |
35-44 |
integer | number of users in the relevant clickstream dataset that fall within the 35-44 age range |
45-54 |
integer | number of users in the relevant clickstream dataset that fall within the 45-54 age range |
55-64 |
integer | number of users in the relevant clickstream dataset that fall within the 55-64 age range |