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 documentation specifies information for Moz Links API V2. V1 of the Links API does not include a Final Redirect endpoint.
What is this endpoint for?
Use this endpoint to see the final redirect target of a page after following known redirects in the index. For example, if we request the final redirect for seomoz.com/blog, the API will return moz.com/blog as the final redirect target. This data can be helpful for tasks like technical audits. If you have migrated your domain or a set of pages and need to check that the redirects were implemented correctly, this endpoint can help with that.
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
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.