How to indicate a domain/subdomain/page/path as a target?
When setting a task to any of the Backlinks API endpoints, you’ll first need to define a “target” field (or “targets” array). Using this parameter, you can indicate if data should be retrieved for a domain, subdomain, or webpage. Additionally applying a filter, you can even get data for a specific path, and we’ll show you how to do it in step 4 below.
Note: domain/subdomain/webpage can be indicated for Summary, Anchors, Domain Intersection, Page Intersection, Referring Domains, Referring Networks. The Domain Pages endpoint supports only domain/subdomain as a “target”, however, you can further refine the data for a path or particular URL using filters. The History endpoint allows indicating a domain only and does not support data filtration.
1. To get data for the whole domain with all of its subdomains, you should specify the domain name in the “target” field/”targets” array (without https:// and www.) and set the “include_subdomains” parameter to true.
2. To retrieve data for a particular URL, you should specify an absolute URL with https:// and www. in the “target” field/”targets” array.
3. To analyze a domain without its subdomains, or to get data on a particular subdomain, you should specify the name of the domain/subdomain in the “target” field/”targets” array (without https:// and www.) and set the “include_subdomains” parameter to false.
4. To extract data for a specific path, you should indicate the domain name in the “target” field/”targets” array (without https:// and www.) and additionally apply the following filter: ["url_to","like","%/path/%"]
.
When setting tasks to Summary, Anchors, Domain Pages, Referring Domains, Referring Networks, you should specify this filter in the “backlinks_filters” array.
If you set a task to the Backlinks endpoint, use the “filters” array.
For Domain Intersection, specify the number of the corresponding target before the URL parameter in “backlinks_filters”: [“1.url_to”,”like”,”%/path/%”].
For the Page Intersection endpoint, specify the number of the corresponding target before the URL parameter in “filters”: [“1.url_to”,”like”,”%/path/%”].