NAVNavbar
Logo
cURL php NodeJS Python cSharp

Backlinks History


This endpoint will provide you with historical backlinks data back to the beginning of 2019. You can receive the number of backlinks a given domain had in a specific time period, the number of new & lost backlinks, referring domains, and more.

Instead of ‘login’ and ‘password’ use your credentials from https://app.dataforseo.com/api-dashboard

<?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-dashboard
$client = new RestClient($api_url, null, 'login', 'password');
$post_array = array();
// simple way to set a task
$post_array[] = array(
   "target" => "cnn.com",
   "date_from" => "2020-01-01",
   "date_to" => "2021-01-01"
);
try {
   // POST /v3/backlinks/history/live
   $result = $client->post('/v3/backlinks/history/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.20210907",
  "status_code": 20000,
  "status_message": "Ok.",
  "time": "0.2038 sec.",
  "cost": 0.02027,
  "tasks_count": 1,
  "tasks_error": 0,
  "tasks": [
    {
      "id": "09101547-1535-0266-0000-cc387f51a45c",
      "status_code": 20000,
      "status_message": "Ok.",
      "time": "0.1329 sec.",
      "cost": 0.02027,
      "result_count": 1,
      "path": [
        "v3",
        "backlinks",
        "history",
        "live"
      ],
      "data": {
        "api": "backlinks",
        "function": "history",
        "target": "cnn.com",
        "date_from": "2020-01-01",
        "date_to": "2021-01-01"
      },
      "result": [
        {
          "target": "cnn.com",
          "date_from": "2020-01-01",
          "date_to": "2021-01-01",
          "items_count": 9,
          "items": [
            {
              "type": "backlinks_history",
              "date": "2020-01-30 00:00:00 +00:00",
              "rank": 594,
              "backlinks": 17180922,
              "new_backlinks": 0,
              "lost_backlinks": 0,
              "new_referring_domains": 0,
              "lost_referring_domains": 0,
              "crawled_pages": 1775912,
              "internal_links_count": 62450543,
              "external_links_count": 20278599,
              "broken_backlinks": 2126,
              "broken_pages": 93801,
              "referring_domains": 523483,
              "referring_main_domains": 402571,
              "referring_ips": 189296,
              "referring_subnets": 78785,
              "referring_pages": 14753676,
              "referring_links_tld": {
                "com": 11107130,
                "org": 1095070,
                "net": 519693,
                "co.il": 182016,
                "gr": 156634,
                "co.jp": 90726,
                "edu": 82244,
                "info": 77388,
                "ru": 75473,
                "it": 72804
              },
              "referring_links_types": {
                "anchor": 14693062,
                "canonical": 34705,
                "redirect": 24916,
                "alternate": 993
              },
              "referring_links_attributes": {
                "nofollow": 2504152,
                "noopener": 1123687,
                "noreferrer": 536743,
                "external": 103425,
                "ugc": 17937,
                "bookmark": 13830,
                "tag": 1598,
                "alternate": 549,
                "author": 486,
                "self": 377
              },
              "referring_links_platform_types": {
                "unknown": 8079466,
                "cms": 5859773,
                "blogs": 5579348,
                "wikis": 252132,
                "message-boards": 217955,
                "ecommerce": 123988
              },
              "referring_links_semantic_locations": {
                "": 7727850,
                "article": 3082231,
                "footer": 1862657,
                "aside": 827077,
                "section": 817135,
                "main": 287050,
                "nav": 78988,
                "header": 49245,
                "figure": 14330,
                "figcaption": 5910
              }
            },
            {
              "type": "backlinks_history",
              "date": "2020-02-28 00:00:00 +00:00",
              "rank": 596,
              "backlinks": 17988506,
              "new_backlinks": 0,
              "lost_backlinks": 0,
              "new_referring_domains": 0,
              "lost_referring_domains": 0,
              "crawled_pages": 1995765,
              "internal_links_count": 67626762,
              "external_links_count": 21867229,
              "broken_backlinks": 2198,
              "broken_pages": 100600,
              "referring_domains": 535398,
              "referring_main_domains": 411113,
              "referring_ips": 193473,
              "referring_subnets": 80047,
              "referring_pages": 15429248,
              "referring_links_tld": {
                "com": 11602750,
                "org": 1125985,
                "net": 553788,
                "co.il": 212910,
                "gr": 167184,
                "co.jp": 96409,
                "edu": 83329,
                "info": 80555,
                "ru": 79746,
                "it": 74970
              },
              "referring_links_types": {
                "anchor": 15365687,
                "canonical": 35899,
                "redirect": 26617,
                "alternate": 1045
              },
              "referring_links_attributes": {
                "nofollow": 2665732,
                "noopener": 1182986,
                "noreferrer": 573242,
                "external": 104172,
                "ugc": 23513,
                "bookmark": 14087,
                "tag": 1638,
                "alternate": 553,
                "author": 497,
                "self": 384
              },
              "referring_links_platform_types": {
                "unknown": 8534620,
                "cms": 6043753,
                "blogs": 5770307,
                "wikis": 257104,
                "message-boards": 222591,
                "ecommerce": 134184
              },
              "referring_links_semantic_locations": {
                "": 8063038,
                "article": 3200478,
                "footer": 1993042,
                "section": 867702,
                "aside": 842368,
                "main": 297668,
                "nav": 87950,
                "header": 54178,
                "figure": 15427,
                "figcaption": 6218
              }
            },
            {
              "type": "backlinks_history",
              "date": "2020-04-29 00:00:00 +00:00",
              "rank": 598,
              "backlinks": 18757583,
              "new_backlinks": 0,
              "lost_backlinks": 0,
              "new_referring_domains": 0,
              "lost_referring_domains": 0,
              "crawled_pages": 2142213,
              "internal_links_count": 71372488,
              "external_links_count": 22924114,
              "broken_backlinks": 2267,
              "broken_pages": 106568,
              "referring_domains": 554301,
              "referring_main_domains": 426576,
              "referring_ips": 198780,
              "referring_subnets": 81742,
              "referring_pages": 16147745,
              "referring_links_tld": {
                "com": 12120812,
                "org": 1169441,
                "net": 586522,
                "co.il": 240861,
                "gr": 176433,
                "co.jp": 100729,
                "edu": 87908,
                "info": 84694,
                "ru": 83289,
                "it": 77798
              },
              "referring_links_types": {
                "anchor": 16076394,
                "canonical": 37894,
                "redirect": 32391,
                "alternate": 1066
              },
              "referring_links_attributes": {
                "nofollow": 2806643,
                "noopener": 1279146,
                "noreferrer": 641452,
                "external": 108836,
                "ugc": 26885,
                "bookmark": 14723,
                "tag": 1684,
                "alternate": 577,
                "author": 513,
                "self": 383
              },
              "referring_links_platform_types": {
                "unknown": 8995644,
                "cms": 6301372,
                "blogs": 5981377,
                "wikis": 261682,
                "message-boards": 236704,
                "ecommerce": 145089
              },
              "referring_links_semantic_locations": {
                "": 8408835,
                "article": 3352020,
                "footer": 2112117,
                "section": 916411,
                "aside": 868426,
                "main": 310029,
                "nav": 99264,
                "header": 56893,
                "figure": 16001,
                "figcaption": 6582
              }
            },
            {
              "type": "backlinks_history",
              "date": "2020-06-29 00:00:00 +00:00",
              "rank": 599,
              "backlinks": 19341008,
              "new_backlinks": 0,
              "lost_backlinks": 0,
              "new_referring_domains": 0,
              "lost_referring_domains": 0,
              "crawled_pages": 2376866,
              "internal_links_count": 76377263,
              "external_links_count": 24592744,
              "broken_backlinks": 2285,
              "broken_pages": 111260,
              "referring_domains": 568934,
              "referring_main_domains": 438116,
              "referring_ips": 203729,
              "referring_subnets": 83273,
              "referring_pages": 16698681,
              "referring_links_tld": {
                "com": 12521994,
                "org": 1199383,
                "net": 611614,
                "co.il": 258919,
                "gr": 187257,
                "co.jp": 104509,
                "info": 89912,
                "edu": 89064,
                "ru": 87378,
                "it": 80107
              },
              "referring_links_types": {
                "anchor": 16617737,
                "redirect": 40129,
                "canonical": 39725,
                "alternate": 1090
              },
              "referring_links_attributes": {
                "nofollow": 2934917,
                "noopener": 1378573,
                "noreferrer": 718003,
                "external": 108814,
                "ugc": 33638,
                "bookmark": 15220,
                "tag": 1681,
                "alternate": 599,
                "author": 519,
                "self": 385
              },
              "referring_links_platform_types": {
                "unknown": 9366736,
                "cms": 6469927,
                "blogs": 6115780,
                "wikis": 274795,
                "message-boards": 247831,
                "ecommerce": 152035
              },
              "referring_links_semantic_locations": {
                "": 8668709,
                "article": 3509004,
                "footer": 2191495,
                "section": 957745,
                "aside": 869690,
                "main": 313865,
                "nav": 102688,
                "header": 61244,
                "figure": 15855,
                "figcaption": 7153
              }
            },
            {
              "type": "backlinks_history",
              "date": "2020-07-30 00:00:00 +00:00",
              "rank": 601,
              "backlinks": 20059235,
              "new_backlinks": 0,
              "lost_backlinks": 0,
              "new_referring_domains": 0,
              "lost_referring_domains": 0,
              "crawled_pages": 2637493,
              "internal_links_count": 81772653,
              "external_links_count": 27594686,
              "broken_backlinks": 2295,
              "broken_pages": 115061,
              "referring_domains": 585309,
              "referring_main_domains": 450395,
              "referring_ips": 208322,
              "referring_subnets": 84629,
              "referring_pages": 17377678,
              "referring_links_tld": {
                "com": 13026775,
                "org": 1226801,
                "net": 629037,
                "co.il": 272314,
                "gr": 197552,
                "co.jp": 109370,
                "edu": 95384,
                "info": 93530,
                "ru": 92731,
                "it": 83684
              },
              "referring_links_types": {
                "anchor": 17286369,
                "redirect": 47655,
                "canonical": 42549,
                "alternate": 1105
              },
              "referring_links_attributes": {
                "nofollow": 3069678,
                "noopener": 1521282,
                "noreferrer": 842953,
                "external": 115773,
                "ugc": 39742,
                "bookmark": 16117,
                "tag": 1757,
                "alternate": 618,
                "author": 433,
                "self": 384
              },
              "referring_links_platform_types": {
                "unknown": 9804277,
                "cms": 6704706,
                "blogs": 6319685,
                "wikis": 280389,
                "message-boards": 251504,
                "ecommerce": 160039
              },
              "referring_links_semantic_locations": {
                "": 8951347,
                "article": 3713784,
                "footer": 2243449,
                "section": 1037630,
                "aside": 905880,
                "main": 330496,
                "nav": 107055,
                "header": 63314,
                "figure": 15900,
                "figcaption": 7561
              }
            },
            {
              "type": "backlinks_history",
              "date": "2020-08-30 00:00:00 +00:00",
              "rank": 603,
              "backlinks": 20657445,
              "new_backlinks": 0,
              "lost_backlinks": 0,
              "new_referring_domains": 0,
              "lost_referring_domains": 0,
              "crawled_pages": 2948481,
              "internal_links_count": 87784900,
              "external_links_count": 30248233,
              "broken_backlinks": 2311,
              "broken_pages": 122300,
              "referring_domains": 598132,
              "referring_main_domains": 459439,
              "referring_ips": 211575,
              "referring_subnets": 85759,
              "referring_pages": 17921364,
              "referring_links_tld": {
                "com": 13428259,
                "org": 1254697,
                "net": 648812,
                "co.il": 288716,
                "gr": 195285,
                "co.jp": 113826,
                "ru": 98433,
                "edu": 98247,
                "info": 95756,
                "it": 87288
              },
              "referring_links_types": {
                "anchor": 17811889,
                "redirect": 55123,
                "canonical": 53251,
                "alternate": 1101
              },
              "referring_links_attributes": {
                "nofollow": 3181658,
                "noopener": 1628709,
                "noreferrer": 936201,
                "external": 120997,
                "ugc": 43786,
                "bookmark": 17219,
                "tag": 1793,
                "alternate": 640,
                "self": 384,
                "author": 379
              },
              "referring_links_platform_types": {
                "unknown": 10150076,
                "cms": 6892527,
                "blogs": 6476047,
                "wikis": 287190,
                "message-boards": 253188,
                "ecommerce": 165534
              },
              "referring_links_semantic_locations": {
                "": 9168642,
                "article": 3888638,
                "footer": 2287610,
                "section": 1097255,
                "aside": 929167,
                "main": 345835,
                "nav": 112277,
                "header": 66870,
                "figure": 15818,
                "figcaption": 8011
              }
            },
            {
              "type": "backlinks_history",
              "date": "2020-09-29 00:00:00 +00:00",
              "rank": 605,
              "backlinks": 21552892,
              "new_backlinks": 0,
              "lost_backlinks": 0,
              "new_referring_domains": 0,
              "lost_referring_domains": 0,
              "crawled_pages": 3201537,
              "internal_links_count": 93647218,
              "external_links_count": 32616540,
              "broken_backlinks": 2352,
              "broken_pages": 128027,
              "referring_domains": 615651,
              "referring_main_domains": 473056,
              "referring_ips": 216651,
              "referring_subnets": 87112,
              "referring_pages": 18734099,
              "referring_links_tld": {
                "com": 14003670,
                "org": 1306683,
                "net": 688485,
                "co.il": 303620,
                "gr": 195141,
                "co.jp": 118918,
                "ru": 103260,
                "info": 102314,
                "edu": 101733,
                "it": 90392
              },
              "referring_links_types": {
                "anchor": 18604382,
                "canonical": 67363,
                "redirect": 61204,
                "alternate": 1150
              },
              "referring_links_attributes": {
                "nofollow": 3333478,
                "noopener": 1782396,
                "noreferrer": 1052537,
                "external": 130258,
                "ugc": 54781,
                "bookmark": 19252,
                "tag": 1959,
                "alternate": 663,
                "self": 391,
                "author": 361
              },
              "referring_links_platform_types": {
                "unknown": 10574673,
                "cms": 7248113,
                "blogs": 6815964,
                "wikis": 290730,
                "message-boards": 261117,
                "ecommerce": 179582
              },
              "referring_links_semantic_locations": {
                "": 9466605,
                "article": 4168579,
                "footer": 2334023,
                "section": 1198284,
                "aside": 974337,
                "main": 373184,
                "nav": 114999,
                "header": 77080,
                "figure": 16988,
                "figcaption": 8726
              }
            },
            {
              "type": "backlinks_history",
              "date": "2020-10-30 00:00:00 +00:00",
              "rank": 608,
              "backlinks": 22788694,
              "new_backlinks": 0,
              "lost_backlinks": 0,
              "new_referring_domains": 0,
              "lost_referring_domains": 0,
              "crawled_pages": 3465726,
              "internal_links_count": 101344712,
              "external_links_count": 35367021,
              "broken_backlinks": 2393,
              "broken_pages": 143939,
              "referring_domains": 636217,
              "referring_main_domains": 489122,
              "referring_ips": 222274,
              "referring_subnets": 88555,
              "referring_pages": 19824043,
              "referring_links_tld": {
                "com": 14797843,
                "org": 1370748,
                "net": 743842,
                "co.il": 317873,
                "gr": 188682,
                "co.jp": 126187,
                "info": 111826,
                "ru": 109605,
                "edu": 104925,
                "it": 94192
              },
              "referring_links_types": {
                "anchor": 19677518,
                "canonical": 81513,
                "redirect": 63788,
                "alternate": 1224
              },
              "referring_links_attributes": {
                "nofollow": 3542572,
                "noopener": 1991305,
                "noreferrer": 1221696,
                "external": 140052,
                "ugc": 63282,
                "bookmark": 22319,
                "tag": 2026,
                "alternate": 725,
                "self": 391,
                "author": 377
              },
              "referring_links_platform_types": {
                "unknown": 11135512,
                "cms": 7722948,
                "blogs": 7282100,
                "wikis": 294438,
                "message-boards": 293202,
                "ecommerce": 204035
              },
              "referring_links_semantic_locations": {
                "": 9884781,
                "article": 4487723,
                "footer": 2438022,
                "section": 1314543,
                "aside": 1072861,
                "main": 396439,
                "nav": 117808,
                "header": 82252,
                "figure": 18873,
                "figcaption": 9513
              }
            },
            {
              "type": "backlinks_history",
              "date": "2020-12-30 00:00:00 +00:00",
              "rank": 610,
              "backlinks": 23813489,
              "new_backlinks": 0,
              "lost_backlinks": 0,
              "new_referring_domains": 0,
              "lost_referring_domains": 0,
              "crawled_pages": 3712955,
              "internal_links_count": 112554394,
              "external_links_count": 38280050,
              "broken_backlinks": 2431,
              "broken_pages": 152004,
              "referring_domains": 651204,
              "referring_main_domains": 499421,
              "referring_ips": 226153,
              "referring_subnets": 89632,
              "referring_pages": 20751811,
              "referring_links_tld": {
                "com": 15467351,
                "org": 1426018,
                "net": 795925,
                "co.il": 339379,
                "gr": 184551,
                "co.jp": 131743,
                "info": 120010,
                "ru": 112773,
                "edu": 106869,
                "it": 97227
              },
              "referring_links_types": {
                "anchor": 20591309,
                "canonical": 93027,
                "redirect": 66165,
                "alternate": 1310
              },
              "referring_links_attributes": {
                "nofollow": 3713820,
                "noopener": 2192503,
                "noreferrer": 1370179,
                "external": 146808,
                "ugc": 70205,
                "bookmark": 23646,
                "tag": 2087,
                "alternate": 776,
                "self": 392,
                "sponsored": 387
              },
              "referring_links_platform_types": {
                "unknown": 11654296,
                "cms": 8080231,
                "blogs": 7633014,
                "message-boards": 322894,
                "wikis": 299795,
                "ecommerce": 229624
              },
              "referring_links_semantic_locations": {
                "": 10210689,
                "article": 4774825,
                "footer": 2528609,
                "section": 1385649,
                "aside": 1185571,
                "main": 426343,
                "nav": 121465,
                "header": 86933,
                "figure": 20358,
                "figcaption": 10160
              }
            }
          ]
        }
      ]
    }
  ]
}

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.

You can specify the time range, and we will provide historical backlink data within the set period.

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
a domain should be specified without https:// and www.
date_from string starting date of the time range
optional field
minimum value 2019-01-01
if you don’t specify this field, the minimum value will be used by default
date format: "yyyy-mm-dd"
example:
"2019-01-15"
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:
"2019-01-15"
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
            target string target from the POST array
            date_from string starting date of the time range
in the UTC format: “yyyy-mm-dd”
example:
2019-01-01
            date_to string ending date of the time range
in the UTC format: "yyyy-mm-dd"
example:
"2019-01-15"
            items_count integer the number of results returned in the items array
            items array contains historical backlink data for the specified domain
the data is provided month-by-month;
the metrics are aggregated according to the backlinks the specified domain had on the first day of each given month
                type string type of element = ‘backlinks_history’
                date string date and time when the data for the target was stored
in the UTC format: “yyyy-mm-dd hh-mm-ss +00:00”
example:
2019-11-15 12:57:46 +00:00
                rank integer domain rank on the given date
                backlinks integer number of backlinks
                new_backlinks integer number of new backlinks for the target
data is provided based in a comparison with the previous period
Note: this data is available from May 2021;
if the date range specified in the POST request preceds May 2021, the field will equal 0
                lost_backlinks integer number of lost backlinks for the target
data is provided based in a comparison with the previous period
Note: this data is available from May 2021;
if the date range specified in the POST request preceds May 2021, the field will equal 0
                new_referring_domains integer number of new referring domains for the target
data is provided based in a comparison with the previous period
Note: this data is available from May 2021;
if the date range specified in the POST request preceds May 2021, the field will equal 0
                lost_referring_domains integer number of lost referring domains for the target
data is provided based in a comparison with the previous period
Note: this data is available from May 2021;
if the date range specified in the POST request preceds May 2021, the field will equal 0
                crawled_pages integer number of crawled pages for the target
                internal_links_count integer number of internal links
calculated as the sum of internal links on the pages of the specified target
                external_links_count integer number of external links on the page
calculated as the sum of external links on the pages of the specified target
                broken_backlinks integer number of broken backlinks
number of broken backlinks pointing to the target
                broken_pages integer number of broken pages
number of pages that receive backlinks but respond with 4xx or 5xx status codes
                referring_domains integer number of referring domains
referring domains include subdomains that are counted as separate domains for this metric
                referring_main_domains integer number of referring main domains
                referring ips integer number of referring IP addresses
number of IP addresses pointing to this page
                referring subnets integer number of referring subnetworks
                referring_pages integer number of pages pointing to the target
                referring_links_tld object top-level domains of the referring links
contains top-level domains and referring link count per each
                referring_links_types object types of referring links
indicates the types of the referring links and link count per each type
possible values:
anchor, image, link, meta, canonical, alternate, redirect
                referring_links_attributes object link attributes of the referring links
indicates link attributes of the referring links and link count per each attribute
                referring_links_platform_types object types of referring platforms
indicates referring platform types and and link count per each platform
                referring_links_semantic_locations object semantic locations of the referring links
indicates semantic elements in HTML where the referring links are located and link count per each semantic location
you can get the full list of semantic elements here
examples:
article, section, summary

‌‌