---
updatedAt: 2025-11-05T21:11:57.000Z
agentTools:
  projectIndex: https://developers.short.io/llms.txt
---

# Getting a list of short links

This tutorial will help you If you want to get a list of short links for a given domain

## To get a list of short links

1. [Create a secret API key ](https://developers.short.io/docs/creating-an-api-key)from the **Integrations and API** menu: <https://app.short.io/settings/integrations/api-key>
2. Get the ID of the domain which short links you want to display:

* In the **Short.io** Dashboard open the **Domain Settings** and copy the domain ID from your browser's address bar:

<Image align="center" src="https://files.readme.io/f832013d871c492a8a1096a3d51fce93dea3159d39d6af67c05296968c1de05b-Screenshot_from_2025-05-29_12-59-50.png" />

3. Then you may need to install **prerequisites for HTTP requests** (if necessary, depending on your programming language and its version).
4. Use the following code snippets to get the list of links:

> 📘
>
> Please note that there is a limitation on the number of links that the API can return. Consequently, the **limit** value must be **less than 150**.
>
> Replace **DOMAIN_ID**, **LIMIT**  and **{user.apiKey}** with the appropriate values.

```php
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.short.io/api/links?domain_id=DOMAIN_ID&limit=LIMIT",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "Authorization: <<apiKey>>",
    "accept: application/json"
  ],
]);

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

curl_close($curl);

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

```
```python
import requests

url = "https://api.short.io/api/links?domain_id=DOMAIN_ID&limit=LIMIT"

headers = {
    "accept": "application/json",
    "Authorization": "<<apiKey>>"
}

response = requests.get(url, headers=headers)

print(response.text)
```
```node Node.js
const url = 'https://api.short.io/api/links?domain_id=DOMAIN_ID&limit=LIMIT';
const options = {
  method: 'GET',
  headers: {accept: 'application/json', Authorization: '<<apiKey>>'}
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```
```java
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://api.short.io/api/links?domain_id=DOMAIN_ID&limit=LIMIT"))
    .header("accept", "application/json")
    .header("Authorization", "<<apiKey>>")
    .method("GET", HttpRequest.BodyPublishers.noBody())
    .build();
HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
```
```csharp
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
    Method = HttpMethod.Get,
    RequestUri = new Uri("https://api.short.io/api/links?domain_id=DOMAIN_ID&limit=LIMIT"),
    Headers =
    {
        { "accept", "application/json" },
        { "Authorization", "<<apiKey>>" },
    },
};
using (var response = await client.SendAsync(request))
{
    response.EnsureSuccessStatusCode();
    var body = await response.Content.ReadAsStringAsync();
    Console.WriteLine(body);
}
```

5. Review the JSON response which should resemble the following:

```json
{
  "count": 4,
  "links": [
    {
      "originalURL": "YOUR_LONG_URL",
      "path": "slug1",
      "idString": "lnk_4Th1_8MAbEywPHUsk11111",
      "id": "lnk_4Th1_8MAbEywPHUsk11111",
      "shortURL": "http://mydomain.fr/slug1",
      "secureShortURL": "https://mydomain.fr/slug1",
      "cloaking": false,
      "title": "Link Title",
      "tags": [],
      "createdAt": "2024-10-29T08:00:47.490Z",
      "skipQS": false,
      "archived": false,
      "DomainId": 11111,
      "OwnerId": 11111,
      "hasPassword": false,
      "source": "website",
      "User": {
        "id": 11111,
        "name": "YourName",
        "email": "youremailaddress",
        "photoURL": "youremailaddress/2zHS33ejyfE11111"
      }
    },
    {
      "originalURL": "YOUR_LONG_URL2",
      "path": "slug2",
      "idString": "lnk_4Th1_YUSVK9T92Dewx11111",
      "id": "lnk_4Th1_YUSVK9T92Dewx11111",
      "shortURL": "http://mydomain.fr/slug2",
      "secureShortURL": "https://mydomain.fr/slug2",
      "cloaking": false,
      "title": "Link Title",
      "tags": [],
      "createdAt": "2024-10-29T07:59:57.487Z",
      "skipQS": false,
      "archived": false,
      "DomainId": 11111,
      "OwnerId": 11111,
      "hasPassword": false,
      "source": "website",
      "User": {
        "id": 11111,
        "name": "YourName",
        "email": "youremailaddress",
        "photoURL": "youremailaddress/2zHS33ejyfE11111"
      }
    },
    {
      "originalURL": "YOUR_LONG_URL3",
      "path": "slug3",
      "idString": "lnk_4Th1_b4cX4HwE0OTal11111",
      "id": "lnk_4Th1_b4cX4HwE0OTal11111",
      "shortURL": "http://mydomain.fr/slug3",
      "secureShortURL": "https://mydomain.fr/slug3",
      "cloaking": false,
      "title": "Link Title",
      "tags": [],
      "createdAt": "2024-10-29T07:57:43.527Z",
      "skipQS": false,
      "archived": false,
      "DomainId": 11111,
      "OwnerId": 11111,
      "hasPassword": false,
      "source": "website",
      "User": {
        "id": 11111,
        "name": "YourName",
        "email": "youremailaddress",
        "photoURL": "youremailaddress/2zHS33ejyfE11111"
      }
    },
    {
      "originalURL": "YOUR_LONG_URL4",
      "path": "slug4",
      "idString": "lnk_4Th1_ZhVH0yrWn58CnJ11111",
      "id": "lnk_4Th1_ZhVH0yrWn58CnJ11111",
      "shortURL": "http://mydomain.fr/slug4",
      "secureShortURL": "https://mydomain.fr/slug4",
      "cloaking": false,
      "title": "Link Title",
      "tags": [],
      "createdAt": "2024-10-29T07:55:00.334Z",
      "skipQS": false,
      "archived": false,
      "DomainId": 11111,
      "OwnerId": 11111,
      "hasPassword": false,
      "source": "website",
      "User": {
        "id": 11111,
        "name": "YourName",
        "email": "youremailaddress",
        "photoURL": "youremailaddress/2zHS33ejyfE11111"
      }
    }
  ],
  "nextPageToken": null
}
```

The following page provides more information about the settings for obtaining a list of links: <https://developers.short.io/reference/get_api-links>