# URL Unshortener API

> URL Unshortener expands shortened links to reveal their final destination URL and destination domain. Send any short link to inspect the resolved address and redirect count; paid plans add the full redirect chain.

**Endpoint:** `POST https://api.apiverve.com/v1/urlunshortener`  
**Category:** Domain Data  
**Cost:** 10 credits per call  
**Canonical page:** https://apiverve.com/marketplace/urlunshortener

## Overview

URL Unshortener works by following the shortened URL's HTTP redirects to its final destination. It returns the resolved URL, the destination domain, the number of redirect hops, and the full hop-by-hop redirect chain — so you can see exactly where a link goes and which intermediate domains it passes through before trusting it.

## Authentication

Every call carries your key in an `x-api-key` header. The same key works across the whole
APIVerve catalog — there are no per-API subscriptions. Responses always use the same three
top-level keys: `status`, `error`, and `data`.

## Example request

```bash
curl -X POST "https://api.apiverve.com/v1/urlunshortener" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://bit.ly/3k3j4"}'
```

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `url` | string | Yes | The shortened URL to unshorten; without a scheme, https:// is assumed. url |

## Response fields

- `source` — string · The shortened URL that was provided as input
- `destination` — string · The original unshortened URL destination
- `unshortened` — boolean · Whether the URL was successfully unshortened
- `redirectCount` — number · Number of HTTP redirect hops followed from the source to the final destination (0 if the URL was already final)
- `destinationDomain` — string · Hostname of the final resolved destination URL
- `redirectChain` — array · Ordered list of every URL visited, starting with the source and ending at the final destination — the intermediate entries are the redirect hops (tracking or cloaking domains) the link passes through · (premium)

## Sample response

```json
{
  "status": "ok",
  "error": null,
  "data": {
    "source": "https://bit.ly/3k3j4",
    "destination": "http://www.allclimbing.com/archive/2009/09/climbing-video-alex-puccio-on-trice-v12/",
    "unshortened": true,
    "redirectCount": 1,
    "destinationDomain": "www.allclimbing.com",
    "redirectChain": [
      "https://bit.ly/3k3j4",
      "http://www.allclimbing.com/archive/2009/09/climbing-video-alex-puccio-on-trice-v12/"
    ]
  }
}
```

## Use cases

- **Malicious Link Screening** — Screen user-submitted short links in messaging platforms by resolving them to their final destination domain before security filters evaluate the URL.
- **Social Media Moderation** — When forum commenters post shortened URLs, resolve the link destination to flag forbidden affiliate networks or banned domains.
- **Email Gateway Scanning** — Corporate mail scanners check incoming emails for shortened links, inspecting the resolved destination URL and redirect count to detect evasion tactics.
- **Affiliate Link Auditing** — Verify affiliate campaign redirects across ad networks by extracting the destination domain and confirming whether tracking links reach active target sites.

## SDKs

- **npm** — `npm install @apiverve/urlunshortener` (https://www.npmjs.com/package/@apiverve/urlunshortener)
- **PyPI** — `pip install apiverve-urlunshortener` (https://pypi.org/project/apiverve-urlunshortener/)
- **NuGet** — `dotnet add package APIVerve.API.URLUnshortener` (https://www.nuget.org/packages/APIVerve.API.URLUnshortener)
- **Source** — https://github.com/apiverve/urlunshortener-api

## More

- Full reference: https://docs.apiverve.com/ref/urlunshortener
- Get an API key: https://dashboard.apiverve.com
- Full catalog: https://apiverve.com/marketplace
