Final Redirect

What's Covered?

In this guide you’ll learn more about making API calls to the Final Redirect endpoint for the Links API V2.

This endpoint returns the final redirect target of a page after following known redirects in the index. If no redirects are known, returns an empty response.

This documentation specifies information for Moz Links API V2. V1 of the Links API does not include a Final Redirect endpoint.

Quick Links

Getting Started

Before making calls to the Final Redirect endpoint, be sure you are set up with an Access ID and Secret Key within your Moz Account.

Just a reminder - the Links API V2 supports Basic Auth in which you are able to use your Access ID as a username and and your Secret Key as a password.

All requests and responses are structured in JSON.

Endpoint Location

When requesting final redirect data from Links V2, be sure to use the following endpoint.

          
https://lsapi.seomoz.com/v2/final_redirect
        

Request Syntax

          
{
    "page": "string"
}
        

Example JSON Request

          
{
    "page": "seomoz.com/blog"
}
        

Request Parameters

"page" - A page to find the final target for.

  • Type: string
  • Required: yes

Response Syntax

          
{
    "page": "string"
}
        

Example JSON Response

          
{
   "page": "moz.com/blog"
}
        

Response Elements

"page" - The final target of a page after following known redirects, or an empty string if no redirects are known.

  • Type: string

Errors

See the Common Errors section for errors that are common to all endpoints.

Example HTTP Request

          
POST /v2/final_redirect
Host: lsapi.seomoz.com
Content-Length: [length of request payload in bytes]
User-Agent: [user agent string]
Authorization: Basic [credentials]
{
    "page": "seomoz.com/blog"
}
        

Example cURL Request

          
curl -d '{"page": "seomoz.org/blog"}' -X POST https://lsapi.seomoz.com/v2/final_redirect -u 'access_id:secret_key'
        

Example Python Request

          
import requests
auth = (access_id, secret_key)<
url = "https://lsapi.seomoz.com/v2/final_redirect"
data = """{
"page": "seomoz.org/blog",
    }"""
request = requests.post(url, data=data, auth=auth)
        

Related Articles


Woo! 🎉
Thanks for the feedback.

Got it.
Thanks for the feedback.