Skip to Content
Redirect Check API

Redirect Check1 Credit

Follow every redirect from a domain or URL, and see each hop and the service behind it.

GET
/v1/redirect

The Redirect Check API follows every redirect from a domain or URL and says where it lands and what sent it there. Each hop has its status code, how it redirects (a 3xx with a Location header, a Refresh header, a meta refresh or a script that sets the location), the address that answered, its TLS certificate and DNS, and the service behind it, such as a Cloudflare redirect rule or a registrar's domain forwarding. A bare host is checked four ways in one call: http and https, apex and www.

The target goes percent-encoded in one url parameter (encodeURIComponent), as in the Site Report API. A bare host, as ?url=github.com, traces all four variants; a URL with a scheme or a path is traced alone.

Each call costs 1 credit. Results are cached for up to 10 minutes.

Authorization

See Authentication for details.

headerX-API-Key<token>

Provide your API key in an HTTP request header.

Query Parameters

url*string

The domain or URL to check. A bare host (example.com) traces the apex and www over http and https; a URL with a scheme or a path (http://example.com/old-page) is traced alone. Percent-encode the whole value as one parameter (encodeURIComponent), so the target's own ?, & and # stay inside it. A fragment is dropped.

Length1 <= length
verbose?boolean

Return extra detail: totalElapsed, retries and params, plus each errors entry's detail when the lookup fails. For redirect, each hop also has its response headers (lowercased) and phase timings.

Defaultfalse
variants?string

Which URLs to trace. matrix (the default for a bare host) traces the apex and www over http and https: four traces in one call. single (the default for a URL with a scheme or a path) traces the URL alone. matrix takes a host or a root URL; a URL with a path, query or port is refused

Value in"matrix""single"
maxRedirects?integer

The most redirects a trace follows before it stops with too-many-redirects, at most 20

Range1 <= value <= 20
Default10
userAgent?string

The user agent to send, by preset name: a browser-like agent that names DNS.Tools by default, or a browser, phone, search or AI crawler (httpstatus.io's preset names, plus claudebot and perplexitybot)

Default"dnstools"
Value in"dnstools""browser""chrome""firefox""safari""edge""iphone""ipad""android""googlebot-desktop""googlebot-smartphone""bingbot-desktop""bingbot-mobile""yandexbot""applebot-desktop""duckduckbot""twitterbot""linkedinbot""facebook-crawler""slackbot""gptbot""chatgpt-user""claudebot""perplexitybot""ccbot"
followMetaRefresh?boolean

Follow a Refresh header and an HTML meta refresh on a 2xx page

Defaulttrue
followJs?boolean

Follow a simple script assignment to location (location.href = …, location.replace(…)) in the first HTML bytes. The script is read, never run

Defaulttrue
validateTlsCertificate?boolean

Stop a trace at an https hop whose certificate is not trusted. With false the trace keeps following, and the certificate problem is still reported in that hop's tls

Defaulttrue

Response Body

Successful redirect check. A redirect that fails (a loop, a TLS error, a host that does not resolve) is a 200 too, with the failure in its trace's error and in problems

application/json
  1. response
tool*string

Tool that generated this result

Value in"dns""domain""reverse""site""dnssec""ssl""email""redirect"
query*string

The original query string

requestId*|

Unique request identifier that generated this result

timestamp*string

UTC timestamp when the result was generated

elapsed*|

Time taken to generate the result in milliseconds

cached*boolean

Whether this result was served from cache

totalElapsed?|

Returned with verbose. Total time in milliseconds, including retries and any lookups this one made. For a cached result, the time to read it

retries?number

Returned with verbose. Number of retries before the answer, 0 for a cached result

params?

Returned with verbose. The query parameters you set that differ from their defaults

variants*string
Value in"matrix""single"
verdict*string

One line on where the query goes and what sends it there

finalUrl*|

Where the query lands: the traces' common final URL, else the first trace that ended on a 2xx

consistent*|

Matrix only: whether every trace that finished lands on the same URL

problems*array<>

Most severe first

traces*array<>
errors*array<>

Empty on a 200, including when a trace failed (that is in the trace's error). On any other status, why the request failed. The HTTP status is in the response line only

Errors

See Errors for the response format.

invalid_request
A parameter is missing or not valid.
400
invalid_query
The query is not an http or https URL or host, or variants=matrix was asked for a URL with a path, query or port.
400
blocked_address
The host resolves only to private or reserved addresses.
400
authentication_failed
No API key was sent, or it could not be checked.
401
invalid_api_key
The API key is not valid.
401
api_key_expired
The API key has expired.
401
out_of_credits
The account has no credits left.
402
forbidden
The caller may not use this tool.
403
rate_limited
The caller is over its rate limit; retry after the Retry-After header.
429
internal_error
An internal error on our side.
500
Example Request
curl -X GET 'https://api.dns.tools/v1/redirect?url=github.com'
Example Response
{  "tool": "redirect",  "query": "github.com",  "requestId": "754febf0-3bda-4128-833c-205f90027b19",  "timestamp": "2026-12-01T19:19:22.055Z",  "elapsed": 1971,  "cached": false,  "errors": [],  "variants": "matrix",  "verdict": "All 4 variants land on https://github.com/ · 301 → 1 hop → https://github.com/",  "finalUrl": "https://github.com/",  "consistent": true,  "problems": [],  "traces": [    {      "startUrl": "http://github.com/",      "finalUrl": "https://github.com/",      "finalStatusCode": 200,      "numberOfRedirects": 1,      "loop": null,      "error": null,      "seo": {        "permanent": true,        "httpsUpgrade": true,        "hostChange": "none",        "chainTooLong": false      },      "chain": [        {          "url": "http://github.com/",          "statusCode": 301,          "statusMessage": "Moved Permanently",          "redirectTo": "https://github.com/",          "mechanism": "http",          "redirectType": "same-origin",          "ip": "140.82.113.3",          "latency": 19,          "service": null,          "dns": {            "a": [              "140.82.113.4",              "140.82.114.4",              "140.82.114.5",              "185.199.108.105",              "185.199.109.105",              "185.199.110.105",              "185.199.111.105",              "140.82.112.31",              "140.82.112.32",              "140.82.113.31",              "140.82.113.32",              "140.82.114.31",              "140.82.114.32"            ],            "aaaa": [],            "cname": [],            "ns": [              "dns1.p08.nsone.net",              "dns2.p08.nsone.net",              "dns3.p08.nsone.net",              "dns4.p08.nsone.net",              "ns-421.awsdns-52.com",              "ns-520.awsdns-01.net",              "ns-1283.awsdns-32.org",              "ns-1707.awsdns-21.co.uk"            ]          },          "tls": null        },        {          "url": "https://github.com/",          "statusCode": 200,          "statusMessage": "OK",          "redirectTo": null,          "mechanism": null,          "redirectType": null,          "ip": "140.82.113.3",          "latency": 36,          "service": null,          "dns": {            "a": [              "140.82.113.4",              "140.82.114.4",              "140.82.114.5",              "185.199.108.105",              "185.199.109.105",              "185.199.110.105",              "185.199.111.105",              "140.82.112.31",              "140.82.112.32",              "140.82.113.31",              "140.82.113.32",              "140.82.114.31",              "140.82.114.32"            ],            "aaaa": [],            "cname": [],            "ns": [              "dns1.p08.nsone.net",              "dns2.p08.nsone.net",              "dns3.p08.nsone.net",              "dns4.p08.nsone.net",              "ns-421.awsdns-52.com",              "ns-520.awsdns-01.net",              "ns-1283.awsdns-32.org",              "ns-1707.awsdns-21.co.uk"            ]          },          "tls": {            "protocol": "TLSv1.3",            "trusted": true,            "issuer": "Sectigo Limited",            "expires": "2027-01-27T23:59:59.000Z",            "error": null          }        }      ],      "canonical": "https://github.com/",      "xRobotsTag": null    },    {      "startUrl": "https://github.com/",      "finalUrl": "https://github.com/",      "finalStatusCode": 200,      "numberOfRedirects": 0,      "loop": null,      "error": null,      "seo": {        "permanent": null,        "httpsUpgrade": false,        "hostChange": "none",        "chainTooLong": false      },      "chain": [        {          "url": "https://github.com/",          "statusCode": 200,          "statusMessage": "OK",          "redirectTo": null,          "mechanism": null,          "redirectType": null,          "ip": "140.82.113.3",          "latency": 36,          "service": null,          "dns": {            "a": [              "140.82.113.4",              "140.82.114.4",              "140.82.114.5",              "185.199.108.105",              "185.199.109.105",              "185.199.110.105",              "185.199.111.105",              "140.82.112.31",              "140.82.112.32",              "140.82.113.31",              "140.82.113.32",              "140.82.114.31",              "140.82.114.32"            ],            "aaaa": [],            "cname": [],            "ns": [              "dns1.p08.nsone.net",              "dns2.p08.nsone.net",              "dns3.p08.nsone.net",              "dns4.p08.nsone.net",              "ns-421.awsdns-52.com",              "ns-520.awsdns-01.net",              "ns-1283.awsdns-32.org",              "ns-1707.awsdns-21.co.uk"            ]          },          "tls": {            "protocol": "TLSv1.3",            "trusted": true,            "issuer": "Sectigo Limited",            "expires": "2027-01-27T23:59:59.000Z",            "error": null          }        }      ],      "canonical": "https://github.com/",      "xRobotsTag": null    },    {      "startUrl": "http://www.github.com/",      "finalUrl": "https://github.com/",      "finalStatusCode": 200,      "numberOfRedirects": 2,      "loop": null,      "error": null,      "seo": {        "permanent": true,        "httpsUpgrade": true,        "hostChange": "www-to-apex",        "chainTooLong": false      },      "chain": [        {          "url": "http://www.github.com/",          "statusCode": 301,          "statusMessage": "Moved Permanently",          "redirectTo": "https://www.github.com/",          "mechanism": "http",          "redirectType": "same-origin",          "ip": "140.82.113.3",          "latency": 22,          "service": null,          "dns": {            "a": [              "140.82.113.3"            ],            "aaaa": [],            "cname": [              "github.com"            ],            "ns": [              "dns1.p08.nsone.net",              "dns2.p08.nsone.net",              "dns3.p08.nsone.net",              "dns4.p08.nsone.net",              "ns-421.awsdns-52.com",              "ns-520.awsdns-01.net",              "ns-1283.awsdns-32.org",              "ns-1707.awsdns-21.co.uk"            ]          },          "tls": null        },        {          "url": "https://www.github.com/",          "statusCode": 301,          "statusMessage": "Moved Permanently",          "redirectTo": "https://github.com/",          "mechanism": "http",          "redirectType": "cross-origin",          "ip": "140.82.113.3",          "latency": 35,          "service": null,          "dns": {            "a": [              "140.82.113.3"            ],            "aaaa": [],            "cname": [              "github.com"            ],            "ns": [              "dns1.p08.nsone.net",              "dns2.p08.nsone.net",              "dns3.p08.nsone.net",              "dns4.p08.nsone.net",              "ns-421.awsdns-52.com",              "ns-520.awsdns-01.net",              "ns-1283.awsdns-32.org",              "ns-1707.awsdns-21.co.uk"            ]          },          "tls": {            "protocol": "TLSv1.3",            "trusted": true,            "issuer": "Sectigo Limited",            "expires": "2027-01-27T23:59:59.000Z",            "error": null          }        },        {          "url": "https://github.com/",          "statusCode": 200,          "statusMessage": "OK",          "redirectTo": null,          "mechanism": null,          "redirectType": null,          "ip": "140.82.113.3",          "latency": 28,          "service": null,          "dns": {            "a": [              "140.82.113.4",              "140.82.114.4",              "140.82.114.5",              "185.199.108.105",              "185.199.109.105",              "185.199.110.105",              "185.199.111.105",              "140.82.112.31",              "140.82.112.32",              "140.82.113.31",              "140.82.113.32",              "140.82.114.31",              "140.82.114.32"            ],            "aaaa": [],            "cname": [],            "ns": [              "dns1.p08.nsone.net",              "dns2.p08.nsone.net",              "dns3.p08.nsone.net",              "dns4.p08.nsone.net",              "ns-421.awsdns-52.com",              "ns-520.awsdns-01.net",              "ns-1283.awsdns-32.org",              "ns-1707.awsdns-21.co.uk"            ]          },          "tls": {            "protocol": "TLSv1.3",            "trusted": true,            "issuer": "Sectigo Limited",            "expires": "2027-01-27T23:59:59.000Z",            "error": null          }        }      ],      "canonical": "https://github.com/",      "xRobotsTag": null    },    {      "startUrl": "https://www.github.com/",      "finalUrl": "https://github.com/",      "finalStatusCode": 200,      "numberOfRedirects": 1,      "loop": null,      "error": null,      "seo": {        "permanent": true,        "httpsUpgrade": false,        "hostChange": "www-to-apex",        "chainTooLong": false      },      "chain": [        {          "url": "https://www.github.com/",          "statusCode": 301,          "statusMessage": "Moved Permanently",          "redirectTo": "https://github.com/",          "mechanism": "http",          "redirectType": "cross-origin",          "ip": "140.82.113.3",          "latency": 34,          "service": null,          "dns": {            "a": [              "140.82.113.3"            ],            "aaaa": [],            "cname": [              "github.com"            ],            "ns": [              "dns1.p08.nsone.net",              "dns2.p08.nsone.net",              "dns3.p08.nsone.net",              "dns4.p08.nsone.net",              "ns-421.awsdns-52.com",              "ns-520.awsdns-01.net",              "ns-1283.awsdns-32.org",              "ns-1707.awsdns-21.co.uk"            ]          },          "tls": {            "protocol": "TLSv1.3",            "trusted": true,            "issuer": "Sectigo Limited",            "expires": "2027-01-27T23:59:59.000Z",            "error": null          }        },        {          "url": "https://github.com/",          "statusCode": 200,          "statusMessage": "OK",          "redirectTo": null,          "mechanism": null,          "redirectType": null,          "ip": "140.82.113.3",          "latency": 39,          "service": null,          "dns": {            "a": [              "140.82.113.4",              "140.82.114.4",              "140.82.114.5",              "185.199.108.105",              "185.199.109.105",              "185.199.110.105",              "185.199.111.105",              "140.82.112.31",              "140.82.112.32",              "140.82.113.31",              "140.82.113.32",              "140.82.114.31",              "140.82.114.32"            ],            "aaaa": [],            "cname": [],            "ns": [              "dns1.p08.nsone.net",              "dns2.p08.nsone.net",              "dns3.p08.nsone.net",              "dns4.p08.nsone.net",              "ns-421.awsdns-52.com",              "ns-520.awsdns-01.net",              "ns-1283.awsdns-32.org",              "ns-1707.awsdns-21.co.uk"            ]          },          "tls": {            "protocol": "TLSv1.3",            "trusted": true,            "issuer": "Sectigo Limited",            "expires": "2027-01-27T23:59:59.000Z",            "error": null          }        }      ],      "canonical": "https://github.com/",      "xRobotsTag": null    }  ]}