Redirect Checker API

Follow every 301, 302, 307 and 308 redirect of a URL and get the full chain with status codes, the final URL and the number of hops.

GETPOSThttps://apibox.io.vn/v1/redirect-check

Give a public url and the API follows its redirects one by one, recording each intermediate URL with its HTTP status code. The response contains the chain (every hop plus the final response), the final_url, final_status, the number of hops and the total response_ms.

Use it to verify HTTP to HTTPS and www to non-www redirects, to detect redirect loops or long chains that hurt SEO, and to resolve short links. Each redirect target is checked again, so redirects to private or internal hosts are refused.

At most 8 redirects are followed (more returns a too_many_redirects error), with a 10 second timeout overall. Only public http/https hosts on ports 80, 443, 8080 and 8443 are allowed.

Parameters

NameInTypeRequiredDefault
urlbody|querystringyesPublic http/https URL to trace (max 4096 characters).

Example

curl "https://apibox.io.vn/v1/redirect-check?url=http://github.com" \
  -H "Authorization: Bearer YOUR_API_KEY"

Response

{
  "url": "http://github.com",
  "final_url": "https://github.com/",
  "final_status": 200,
  "hops": 1,
  "chain": [
    {
      "url": "http://github.com/",
      "status": 301
    },
    {
      "url": "https://github.com/",
      "status": 200
    }
  ],
  "response_ms": 320
}

Use cases

  • Verify HTTP to HTTPS and www redirects after a migration
  • Find long redirect chains and loops that waste crawl budget
  • Expand short links to see where they really go
  • Monitor that old URLs still 301 to the right pages

FAQ

How many redirects are followed?

Up to 8. If a URL redirects more often, the API returns a 502 error with code too_many_redirects.

Does it show the status code of each redirect?

Yes. Every entry of chain has the URL and its status (301, 302, 307, 308...); the last entry is the final response.

Can I expand a shortened URL?

Yes. Pass the short link as url; final_url is the destination.

Related APIs

Start with 1,000 free requests every month. Get free API key →