# CleanURI

> Shorten links with CleanURI, the free link shortener. Shorten one link, a whole list of them, or every link inside a message, and check where a short link goes before you trust it. Links are sent exactly as you paste them, however long or untidy, and the same link always gives back the same short link, so a workflow that runs every day reuses its links instead of making new ones. No account or API key required.

App · Links and QR Codes · 4 actions. Web page: https://docs.lodol.com/docs/integrations/cleanuri

## Actions

### Check where a short link goes

Read the address a CleanURI short link opens, without opening it. Nothing is fetched from the far side and no visit is recorded there, so this is safe to run on a link somebody sent you, and it answers just as quickly for a destination that is slow or gone. No account or API key required.

**Inputs**

- Short link (`short_url`, text, required): The CleanURI link to look up. Paste the whole link, or just the code on the end of it. Capitals matter: pEqXje and peqxje are different links.

**Outputs**

- `original_url` (text): The address the short link opens. This is the long link somebody shortened.
- `short_url` (text): The short link, e.g. https://cleanuri.com/pEqXje. Paste this wherever the long one would have gone.

**Example output**

```json
{
  "original_url": "https://example.com/spring-sale?utm_source=newsletter",
  "short_url": "https://cleanuri.com/pEqXje"
}
```

### Shorten a link

Turn a long web address into a short cleanuri.com link to paste into a text message, a post, an invoice or anywhere else the whole address would not fit. The same link always gives the same short link, so a workflow that runs again reuses the one it made rather than piling up new ones. No account or API key required.

**Inputs**

- Link (`url`, text, required): The web address to shorten. Paste it exactly as it appears in the address bar, however long or untidy: question marks, ampersands and tracking parameters are all fine and nothing needs escaping. Up to about 2,000 characters.

**Outputs**

- `original_url` (text): The long link, as it was given. An address typed without https:// comes back with it added, so this is exactly what the short link opens.
- `short_url` (text): The short link, e.g. https://cleanuri.com/pEqXje. Paste this wherever the long one would have gone.

**Example output**

```json
{
  "original_url": "https://example.com/spring-sale?utm_source=newsletter",
  "short_url": "https://cleanuri.com/pEqXje"
}
```

### Shorten several links

Shorten a whole list of links in one step, and get one result for each, in the order you gave them. A link CleanURI will not take is reported beside the rest with the reason instead of stopping the run, so one bad address in a column of fifty does not cost you the other forty nine. No account or API key required.

**Inputs**

- Links (`urls`, list, required): The links to shorten. Use a list from an earlier step, such as a column of a spreadsheet, or paste the links in with one on each line. Up to 50 at a time: CleanURI accepts two a second, so a full list takes about half a minute.

**Outputs**

- `already_short_count` (number): How many were already CleanURI links and were left as they were.
- `count` (number): How many links were handled in total.
- `failed_count` (number): How many CleanURI would not shorten. Branch on this to catch a bad link before the message goes out.
- `links` (list): One entry per link you gave, in the same order.
- `shortened_count` (number): How many of them were shortened on this run.

**Example output**

```json
{
  "already_short_count": 0,
  "count": 1,
  "failed_count": 0,
  "links": [
    {
      "already_short": false,
      "error": null,
      "original_url": "https://example.com/spring-sale?utm_source=newsletter",
      "short_url": "https://cleanuri.com/pEqXje",
      "shortened": true
    }
  ],
  "shortened_count": 1
}
```

### Shorten the links in a message

Hand over a message and get it back with every link in it replaced by a short one and nothing else touched. This is the step to put before a text message, a post or a chat notification goes out, and it counts the characters so the next step can check the message still fits. A link CleanURI will not take is left where it is, so a message never goes out with a hole in it. No account or API key required.

**Inputs**

- Message (`text`, text, required): The message to shorten the links in. Everything that is not a link comes back untouched, including line breaks, so this can be a whole text message, post or email body.

**Outputs**

- `already_short_count` (number): How many were already CleanURI links and were left as they were.
- `character_count` (number): How long the message is now. A text message fits in 160 characters, which is usually why the links were shortened.
- `count` (number): How many links were handled in total.
- `failed_count` (number): How many CleanURI would not shorten. Branch on this to catch a bad link before the message goes out.
- `links` (list): One entry per link found in the message, in the order they appear. A link written twice appears once.
- `shortened_count` (number): How many of them were shortened on this run.
- `text` (text): The message, with each link swapped for its short one and every other character exactly as it was.

**Example output**

```json
{
  "already_short_count": 0,
  "character_count": 59,
  "count": 1,
  "failed_count": 0,
  "links": [
    {
      "already_short": false,
      "error": null,
      "original_url": "https://example.com/orders/10482/tracking?carrier=royalmail",
      "short_url": "https://cleanuri.com/pEqXje",
      "shortened": true
    }
  ],
  "shortened_count": 1,
  "text": "Your order shipped. Track it at https://cleanuri.com/pEqXje"
}
```
