apyhub
DEVELOPER TOOLS · SEO

URL Unshortener

What it does

URL Unshortener resolves shortened links and returns the destination you actually want to inspect. Send a url, and optionally set max_hops to control how many redirects to follow and timeout_s to cap how long the request waits.

Use URL Unshortener when you need to expand tracking links, inspect redirect chains, or check where a shortened URL really lands before storing, sharing, or crawling it. It’s useful for link safety checks, analytics pipelines, and tooling that needs canonical destinations instead of wrapped URLs.

The response schema is intentionally open-ended, so treat the returned JSON as a structured result whose exact fields may vary by target URL and redirect behaviour. Build your integration to read the destination details you need and handle cases where redirects stop early, time out, or exceed the hop limit.

URL Unshortener is best when you already have a URL and need the expanded version without guessing how many redirects are involved.

POST
Unshorten URL
http://localhost:8080/pankajretestflows/unshorten-url

QUICKSTART

GUIDE

Quickstart

Unshorten a URL by sending the shortened link in the request body.

curl -X POST "http://localhost:8080/pankajretestflows/unshorten-url" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://bit.ly/3xYzAbC"}'

What you'll get back

Returns a JSON object with additional properties. The schema does not declare fixed response fields, so the exact shape may vary.

{
  "input": "https://bit.ly/example",
  "resolved": "https://example.com",
  "hops": [
    {
      "url": "https://example.com",
      "status": 200
    }
  ],
  "truncated": false,
  "attribution": [
    {
      "source": "HTTP redirect metadata"
    }
  ]
}
TRY ITLIVE · 10 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
UrlInput*

About this endpoint

What it does

Resolves a shortened URL by following redirects and returns the endpoint’s success response. The request accepts the URL to unshorten plus optional redirect and timeout limits.

Request Body

ParameterTypeMandatoryDescription
urlStringYesThe URL to resolve. Minimum length: 3 characters.
max_hopsIntegerNoMaximum number of redirects to follow. Default: 10. Minimum: 1. Maximum: 30.
timeout_sIntegerNoTimeout in seconds for the unshortening request. Default: 8. Minimum: 1. Maximum: 20.

Response

Returns a JSON object. The response schema does not declare any fixed top-level fields and allows additional properties, so the exact success payload shape is not specified in the schema.

AttributeTypeMandatoryDescription

Body

Name
Type
Description
bodyREQUIRED
object
▣ COMMON ERRORS

Errors any endpoint can return

400bad_request

Required parameter missing or malformed body.

401unauthorized

API key missing, revoked, or not authorized for this service.

429rate_limited

Your plan's per-second rate exceeded. Retry with exponential backoff.

503upstream_busy

Backend temporarily unavailable. Try again in a few seconds.