V1 Links
This guide outlines the endpoints for now archived Moz Links API endpoints. The new Moz Links API endpoints are available here.
The links
endpoint returns information about links between a target URL and other pages and domains. Parameters for links
let you receive a wide array or a narrow subset of results, with multiple options for how results are sorted. Response fields help you organize the information Moz Links API returns.
The links
endpoint is accessible with a free API subscription with the exception of Spam Score and Sort by Spam Score.
Parameters
A Moz API links
call accepts these parameters:
Scope
indicates which links to return based on whether the target and source URLs are pages, domains, or subdomains.Sort
: Sortlinks
results by:- Page Authority (
page_authority
) - Domain Authority (
domain_authority
) - Number of unique root domains linking to the root domain (
domains_linking_domain
) - Number of unique root domains linking to the page (
domains_linking_page
) Filter
excludes results unless they meet criteria you specify. You can specify more than one value by separating multiple Filter parameters with a plus symbol+
.Limit
andOffset
: The default value ofLimit
is 25 and the maximum value is 50.SourceDomain
excludes results unless they originate from the root domain you specify.TargetCols
is a bit flag: a numerical value specifying which data to include about the target URL.SourceCols
is a bit flag: a numerical value specifying which data to include about source URLs that link to the target URL.LinkCols
is a bit flag: a numerical value specifying which data to include about the link itself (for example, if the link is nofollowed).
TargetCols
and SourceCols
use the same possible values for the Cols
parameter.Include LinkCols, SourceCols
, or TargetCols
in every links
call; otherwise, your call may be valid but returns no data.
Sort
The default value of Sort
for links
is page_authority.
Parameter | Description |
---|---|
page_authority | Source URLs with the most Page Authority return first. |
domain_authority | Source URLs with the most Domain Authority return first. |
domains_linking_domain | The number of distinct root domains linking to a source URL's root domain. |
domains_linking_page | The number of distinct root domains linking to a source URL. |
spam_score | Sort source URLs by spam score. See Spam Score. |
Using Scope and Sort Together
Moz Links returns an error for calls that specify Scope=domain<em>to</em>*
and Sort=page_authority
. Moz Links also only allows sorting by page authority when results include pages.
- All
Scope
values permitSort=domain_authority
. Scope
values ofpage_to_\*
permitSort
values ofdomains_linking_page
.Scope
values ofdomain_to_\*
permitSort
values ofdomains_linking_domain
.
If the Scope is... | …then valid Sort values are: |
---|---|
page_to_page page_to_subdomain page_to_domain | page_authority domain_authority domains_linking_page |
domain_to_page domain_to_subdomain domain_to_domain | domain_authority domains_linking_domain |
Filter
For links
calls, Filter
is additive: you can apply more than one filter to a query. Use the "plus" symbol +
between criteria to specify more than one filter parameter. Filter
is a true logical "and", meaning results return only if they meet all filter criteria.
There is no default value for Filter
on a links
call. A filter value of 302 is only compatible with Sort values of page authority
or domain authority
.
Query Parameter | Description |
---|---|
external | Returns links not classified as internal |
follow | Returns equity-passing links without a rel=nofollow attribute specified |
nofollow | Returns links with a rel=nofollow attribute specified |
nonequity | Returns links with any of these attributes specified: nofollow, meta-nofollow, offscreen, 302 or an RSS feed |
equity | Returns links not classified as non-equity, including followed links and 301 (permanent) redirects. |
rel_canonical | Returns links with a rel=canonical attribute |
301 [Deprecated] | Returns links with a 301 redirect specified Deprecated, now returns all redirects not just 301s |
302 [Deprecated] | Returns links with a 302 redirect specified Deprecated, now returns all redirects, not just 302s |
Values for LinkCols
Metric | Bit Flag | Response Field | Description |
---|---|---|---|
Null | 0 | Null | If set to zero along with SourceCols and TargetCols, LinkCols = 0 returns an empty array. |
Link Flags | 2 | If | A numerical value indicating attributes of the link |
Anchor Text | 4 | lt | The anchor text of the link, including any markup (for example, image tags with alt text) |
Normalized & Anchor Text | 8 | lnt | The anchor text of the link, excluding markup |
LinkCols Flags
When you set LinkCols
to values that return Flags (for example, LinksCols=2
) , Moz Link API returns a numerical value in the <code>lf</code> response code fields.. The numerical value indicates attributes of the link, as specified in the following table.
Bit field values are additive. If your API call returns a value not listed below, multiple attributes are true and their bit values are added together.
Metric | Bit Flag | Description |
---|---|---|
nofollow | 1 | This link has the 'rel=nofollow' attribute specified |
same subdomain | 2 | This link's source and target subdomains are the same |
same root domain | 4096 | This link's source and target root-domains are the same |
image | 8192 | This link is inside an image tag |
rel_canonical | 32768 | This link has the 'rel=canonical' attribute specified |
Sample Requests
This request finds the page (Scope=page_to_page&Limit=1
) pointed to moz.com/blog with the highest Page Authority (Sort=page_authority
) on the microsoft.com root domain (SourceDomain=microsoft.com
), showing the canonical forms of the source URL (SourceCols=4
) and the target URL (TargetCols=4
).
<p><code>http://lsapi.seomoz.com/linkscape/links/moz.com%2fblog?SourceCols=4&TargetCols=4&Scope=page_to_page&Sort=page_authority&SourceDomain=microsoft.com&Limit=1& AccessID=member-cf180f7081&Expires=1225138899&Signature=LmXYcPqc%2BkapNKzHzYz2BI4SXfC%3D</code></p>
This example finds the page (Scope=page_to_page
) with the highest Page Authority (Sort=page_authority
) containing an internal 301 link (Filter=internal+301&Limit=1
) pointing to the default page on www.google.com, returns the canonical URL for the target page (TargetCols=4
), and returns the canonical URL and the HTTP status code for the source page (SourceCols=536870916
).
http://lsapi.seomoz.com/linkscape/links/moz.com?Scope=page<em>to</em>page&Sort=page_authority&Filter=internal+301&Limit=1&SourceCols=536870916&TargetCols= 4&AccessID=member-cf180f7081&Expires=1225138899&Signature=LmXYcPqc%2BkapNKzHzYz2BI4SXfC%3D
Related Articles
Was this article helpful?
Yes! Amazing! Yes! It was what I needed. Meh. It wasn’t really what I was looking for. No, it wasn’t helpful at all.
Thanks for the feedback.