🚀 Experience the new and improved APIVoid! Check out what's new

URL Status API: Track redirect chains and status codes

A JSON API to check URL status codes, track redirect chains (3xx redirects), access response headers and response body. Use this API to verify if an URL is online or offline, if URL redirects are correct and are of same origin.

Consumes 1 credit per API call

# Example Curl request from the command line:
                          
curl -X POST "https://api.apivoid.com/v2/url-status" \
     -H "Content-Type: application/json" \
     -H "X-API-Key: YOUR_API_KEY_HERE" \
     -d '{"url":"http://wikipedia.com"}'

# Example JSON output for a 200 HTTP status code:

{
    "url": "http://wikipedia.com",
    "debug_message": "",
    "redirect_stats": {
        "total_redirects": 2,
        "same_url_redirects": 0,
        "unresolvable_hosts": 0,
        "connection_errors": 0,
        "invalid_ssl_redirects": 0,
        "unencrypted_redirects": 0,
        "https_to_http_redirects": 0,
        "external_redirects": 1,
        "slow_redirects": 0,
        "same_origin_redirects": 0,
        "cross_origin_redirects": 2
    },
    "chain": [
        {
            "url": "http://wikipedia.com",
            "status_code": 301,
            "status_message": "Moved Permanently",
            "content_type": "text/html",
            "can_resolve": true,
            "connection_error": false,
            "redirect_to": "https://wikipedia.com/",
            "redirect_type": "3xx_redirect",
            "redirect_info": {
                "http_to_https": true,
                "https_to_http": false,
                "non_www_to_www": false,
                "www_to_non_www": false,
                "external_redirect": false,
                "same_origin": false,
                "cross_origin": true,
                "same_scheme": false,
                "same_domain": true,
                "same_host": true,
                "same_port": false
            },
            "ip": "208.80.153.232",
            "valid_ssl": false,
            "elapsed_ms": 453
        },
        {
            "url": "https://wikipedia.com/",
            "status_code": 301,
            "status_message": "Moved Permanently",
            "content_type": "text/html",
            "can_resolve": true,
            "connection_error": false,
            "redirect_to": "https://www.wikipedia.org/",
            "redirect_type": "3xx_redirect",
            "redirect_info": {
                "http_to_https": false,
                "https_to_http": false,
                "non_www_to_www": false,
                "www_to_non_www": false,
                "external_redirect": true,
                "same_origin": false,
                "cross_origin": true,
                "same_scheme": true,
                "same_domain": false,
                "same_host": false,
                "same_port": true
            },
            "ip": "208.80.153.232",
            "valid_ssl": true,
            "elapsed_ms": 571
        },
        {
            "url": "https://www.wikipedia.org/",
            "status_code": 200,
            "status_message": "OK",
            "content_type": "text/html",
            "can_resolve": true,
            "connection_error": false,
            "ip": "208.80.153.224",
            "html_info": {
                "title": "Wikipedia",
                "description": "Wikipedia is a free online encyclopedia, created and edited by volunteers around the world and hosted by the Wikimedia Foundation.",
                "keywords": "",
                "robots": "",
                "canonical": "",
                "og_image": "https://upload.wikimedia.org/wikipedia/en/thumb/8/80/Wikipedia-logo-v2.svg/2244px-Wikipedia-logo-v2.svg.png",
                "og_type": "website",
                "og_site_name": "",
                "article_publisher": "",
                "twitter_site": "",
                "ld_organization": "",
                "ld_logo": "",
                "ld_same_as": [],
                "generator": [],
                "icon": "https://www.wikipedia.org/static/favicon/wikipedia.ico",
                "apple_touch_icon": [
                    {
                        "size": "",
                        "href": "https://www.wikipedia.org/static/apple-touch/wikipedia.png"
                    }
                ],
                "lang": "",
                "hreflang": []
            },
            "valid_ssl": true,
            "elapsed_ms": 568
        }
    ],
    "final_url": {
        "url": "https://www.wikipedia.org/",
        "status": "online",
        "status_code": 200,
        "status_message": "OK",
        "accessible": true,
        "http_client_error": false,
        "http_server_error": false
    },
    "elapsed_ms": 1592
}
Code analysis

Key Features

Verify URL redirects, spot insecure redirects and invalid SSL

Businesses and startups use this URL Status API to check HTTP status codes, follow and track URL redirects chain, check if redirects are same origin, have valid SSL certificate, and extract page metadata.

Redirects Insights

Same origin, same scheme, same host, same domain, redirect type, response headers, body, latency.

IPv4 and IPv6 Protocol

Check compatibility with both IPv4 and IPv6 for each URL redirect and avoid potential accesibility issues.

Certificate Validation

We verify SSL certificate of each redirect so you know if there is an invalid SSL on a redirect.

Web Page Metadata

Gain additional insights of destination URLs: page title, meta description, keywords, canonical tag, etc.

Common Use Cases

Take a look at some real-world use cases of this API service

Our API can be used in many ways, from cybersecurity tasks to marketing-specific tasks. Here we showcase the most popular use cases according to our customers usage:

Verify Redirects Chain

Troubleshoot and verify that all 301 and 302 URL redirects are valid, have no SSL issues and are same origin.

Obtain Right Numbers

Count total redirects, www to non-www redirects, http to https redirects, same origin redirects, and much more.

Extract Metadata

Follow redirects and extract metadata (page title, meta description, hreflang tags) from destination URL.

Detect Invalid Redirects

With this API it's easy to identify invalid URL redirects, make sure everything works are expected.

Use cases

USAGE EXAMPLE

Learn how seamless it is to add and use URL Status API anywhere you want

All it takes is a HTTPS POST request with JSON payload to our endpoint, and you’ll receive the response within seconds, usually within 1-5 seconds. Here are a few code examples to use the API:

$url = 'http://wikipedia.com';

$apiUrl = 'https://api.apivoid.com/v2/url-status';
$apiKey = 'your_api_key_here';

$ch = curl_init($apiUrl);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json', 'X-API-Key: ' . $apiKey]);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(['url' => $url]));
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode === 200) {
    $responseData = json_decode($response, true);

    print_r($responseData);
}

Start using our API services, it takes just a few minutes

Create your account, pick a subscription plan, and make your first API call instantly with your API key—simple as that!

Get started now