# Unshorten API

> Returns the redirect chain and final URL of a short link, and the list of known short-link domains.

Category: Utilities. Region: global. 2 endpoints at `https://api.hoshime.com/v1/unshorten/<endpoint>`, `GET` with query parameters, answering `{data, meta}` (see https://hoshime.com/docs/responses.md). Reference: https://hoshime.com/docs/platforms/unshorten
## GET /v1/unshorten/expand

The redirect chain of a short link and its final URL. The final page itself is not fetched.

Scope: `social:read` · Units: 1 · Cached: 10 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `url` | string | yes | The short link or any http or https URL. (e.g. http://www.wikipedia.org) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `chain` (Hop[]), `chain[].location` (string), `chain[].status` (integer (int64)), `chain[].url` (string), `domain` (string), `finalUrl` (string), `inputUrl` (string), `redirects` (integer (int64)), `shortener` (boolean), `stopped` (string)

```bash
curl "https://api.hoshime.com/v1/unshorten/expand?url=http%3A%2F%2Fwww.wikipedia.org" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/unshorten/shorteners

The short-link domains that expand marks as shorteners.

Scope: `social:read` · Units: 1 · Cached: 1440 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `domain` (string)

```bash
curl "https://api.hoshime.com/v1/unshorten/shorteners" -H "Authorization: Bearer $HOSHIME_TOKEN"
```
