High volume short link creation

This tutorial will help you If you need to create a large amount of links all at once

With the Short.io API, you can shorten up to 1000 links in one API call. You can create 5 requests per 10 seconds (1 request = 1000 URLs).

📘

Please ensure that the Short.io pricing plan you select fits all of your links. We recommend opting for the Enterprise plan, which offers unlimited links.

To create short links in bulk

  1. Create a secret API key from the Integrations and API menu: https://app.short.io/settings/integrations/api-key.
  2. Then you may need to install prerequisites for HTTP requests (if necessary, depending on your programming language and its version).
  3. With the following code snippet examples you will be able to generate short URLs in bulk:

📘

We advise using the TTL parameter when generating a short link from our API.

Please replace example.xyz , APIKEY ,YOUR_FIRST_PATH and YOUR_SECOND_PATH (the new slugs to be applied), FIRST_LONG_URL , SECOND_LONG_URL and TTL with the appropriate values.

<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.short.io/links/bulk",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => json_encode([
    'allowDuplicates' => false,
    'links' => [
        [
                'originalURL' => '<<first_long_url>>',
                'path' => '<<first_path>>',
                'ttl' => '<<ttl>>'
        ],
        [
                'originalURL' => '<<second_long_url>>',
                'path' => '<<second_path>>',
                'ttl' => '<<ttl>>'
        ]
    ],
    'domain' => '<<domain_name>>'
  ]),
  CURLOPT_HTTPHEADER => [
    "Authorization: <<apiKey>>",
    "content-type: application/json"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
import requests

url = "https://api.short.io/links/bulk"

payload = {
    "allowDuplicates": False,
    "domain": "<<domain_name>>",
    "links": [
        {
            "originalURL": "<<first_long_url>>",
            "path": "<<first_path>>",
            "ttl": "<<ttl>>"
        },
        {
            "originalURL": "<<second_long_url>>",
            "path": "<<second_path>>"
            "ttl": "<<ttl>>"
        }
    ]
}
headers = {
    "content-type": "application/json",
    "Authorization": "<<apiKey>>"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const url = 'https://api.short.io/links/bulk';
const options = {
  method: 'POST',
  headers: {'content-type': 'application/json', Authorization: '<<apyKey>>'},
  body: JSON.stringify({
    allowDuplicates: false,
    domain: '<<domain_name>>',
    links: [
      {
        originalURL: '<<first_long_url>>',
        ttl: '<<ttl>>',
        path: '<<first_path>>'
      },
      {
        originalURL: '<<second_long_url>>',
        ttl: '<<ttl>>',
        path: '<<second_path>>'
      }
    ]
  })
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://api.short.io/links/bulk"))
    .header("content-type", "application/json")
    .header("Authorization", "<<apiKey>>")
    .method("POST", HttpRequest.BodyPublishers.ofString("{\"allowDuplicates\":false,\"domain\":\"<<domain_name>>\",\"links\":[{\"skipQS\":false,\"archived\":false,\"originalURL\":\"<<first_long_url>>\",\"ttl\":\"<<ttl>>\",\"path\":\"<<first_path>>\"},{\"skipQS\":false,\"archived\":false,\"ttl\":\"<<ttl>>\",\"path\":\"<<second_path>>\",\"originalURL\":\"<<second_long_url>>\"}]}"))
    .build();
HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
    Method = HttpMethod.Post,
    RequestUri = new Uri("https://api.short.io/links/bulk"),
    Headers =
    {
        { "Authorization", "<<apiKey>>" },
    },
    Content = new StringContent("{\"allowDuplicates\":false,\"domain\":\"<<domain_name>>\",\"links\":[{\"skipQS\":false,\"archived\":false,\"originalURL\":\"<<first_long_url>>\",\"ttl\":\"<<ttl>>\",\"path\":\"<<first_path>>\"},{\"skipQS\":false,\"archived\":false,\"ttl\":\"<<ttl>>\",\"originalURL\":\"<<second_long_url>>\",\"path\":\"<<second_path>>\"}]}")
    {
        Headers =
        {
            ContentType = new MediaTypeHeaderValue("application/json")
        }
    }
};
using (var response = await client.SendAsync(request))
{
    response.EnsureSuccessStatusCode();
    var body = await response.Content.ReadAsStringAsync();
    Console.WriteLine(body);
}

📘

The code above returns a list of two link objects. In case a URL cannot be inserted, an error object is returned as an element of the array instead. The method is non-transactional; it may successfully insert certain links from the list while generating errors for others.

  1. Review the JSON response which should resemble the following:
[
  {
    originalURL: 'https://developers.short.io/reference/post_links-bulk',
    DomainId: 11111,
    archived: false,
    cloaking: false,
    createdAt: '2025-05-13T13:19:32.111Z',
    updatedAt: '2025-05-13T13:19:32.111Z',
    OwnerId: 11111,
    tags: [],
    skipQS: false,
    path: 'post_links-bulk',
    id: 'lnk_4RF8_W1IQ9qq7',
    idString: 'lnk_4RF8_W1IQ9qq7',
    ttl: '2025-05-22T12:38:23.000Z',
    shortURL: 'https://shortiotest.com/post_links-bulk',
    secureShortURL: 'https://shortiotest.com/post_links-bulk',
    duplicate: false,
    success: true
  },
  {
    originalURL: 'https://developers.short.io/docs/high-volume-short-link-creation',
    DomainId: 11111,
    archived: false,
    cloaking: false,
    createdAt: '2025-05-13T13:19:32.198Z',
    updatedAt: '2025-05-13T13:19:32.198Z',
    OwnerId: 11111,
    tags: [],
    skipQS: false,
    path: 'short-link-creation',
    id: 'lnk_4RF8_tsGgZuhW2',
    idString: 'lnk_4RF8_tsGgZuhW2',
    ttl: '2025-05-22T12:38:23.000Z',
    shortURL: 'https://shortiotest.com/short-link-creation',
    secureShortURL: 'https://shortiotest.com/short-link-creation',
    duplicate: false,
    success: true
  }

Similarly, you can create up to 1000 links in one API call.

You can find more information on bulk link creation parameters in the following page: https://developers.short.io/reference/post_links-bulk