V1 Links

This guide outlines the endpoints for now archived Moz API V1 endpoints. The Moz API V2 endpoints are available here.

The links endpoint returns information about links between a target URL and other pages and domains. Parameters for linkslet 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 API V1 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: Sort links 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 and Offset: The default value of Limit 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.

ParameterDescription
page_authoritySource URLs with the most Page Authority return first.
domain_authoritySource URLs with the most Domain Authority return first.
domains_linking_domainThe number of distinct root domains linking to a source URL's root domain.
domains_linking_pageThe number of distinct root domains linking to a source URL.
spam_scoreSort 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 permit Sort=domain_authority.
  • Scope values of page_to_\* permit Sort values of domains_linking_page.
  • Scope values of domain_to_\* permit Sort values of domains_linking_domain.
If the Scope is...…then valid Sort values are:
page_to_page page_to_subdomain page_to_domainpage_authority domain_authority domains_linking_page
domain_to_page domain_to_subdomain domain_to_domaindomain_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 authorityor domain authority.

Query ParameterDescription
externalReturns links not classified as internal
followReturns equity-passing links without a rel=nofollow attribute specified
nofollowReturns links with a rel=nofollow attribute specified
nonequityReturns links with any of these attributes specified: nofollow, meta-nofollow, offscreen, 302 or an RSS feed
equityReturns links not classified as non-equity, including followed links and 301 (permanent) redirects.
rel_canonicalReturns 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

MetricBit FlagResponse FieldDescription
Null0NullIf set to zero along with SourceCols and TargetCols, LinkCols = 0 returns an empty array.
Link Flags2IfA numerical value indicating attributes of the link
Anchor Text4ltThe anchor text of the link, including any markup (for example, image tags with alt text)
Normalized & Anchor Text8lntThe 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.

MetricBit FlagDescription
nofollow1This link has the 'rel=nofollow' attribute specified
same subdomain2This link's source and target subdomains are the same
same root domain4096This link's source and target root-domains are the same
image8192This 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&amp;TargetCols=4&amp;Scope=page_to_page&amp;Sort=page_authority&amp;SourceDomain=microsoft.com&amp;Limit=1&amp; AccessID=member-cf180f7081&amp;Expires=1225138899&amp;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


Woo! 🎉
Thanks for the feedback.

Got it.
Thanks for the feedback.