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

# Getting a list of domains

> 📘 Information below might be outdated - please visit our recently updated [API Reference](https://developers.short.io/reference/)

The instruction below shows how to get a list of domains of your Short.io account.

### **1)** Get your secret API key here: <https://app.short.io/settings/integrations/api-key>

* Click "Create API key".
* Add a **Secret** key.

![](https://files.readme.io/b70e76c-Screen_Shot_2021-08-11_at_2.57.06_PM.png "Screen Shot 2021-08-11 at 2.57.06 PM.png")

### **2)** Install prerequisites for requests.

```python
pip install requests
```
```javascript Node.js
npm install --save axios
```

Now everything is ready to run the following snippet.

### **3)** Create a file: **filename.py/ .js/ .rb**. Use the code snippet below.

```python
import requests

url = "https://api.short.io/api/domains"

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

response = requests.request("GET", url, headers=headers)

print(response.text)
```
```javascript Node.js
const axios = require('axios');

axios.get('https://api.short.io/api/domains', {
    headers: {
    accept:'application/json',,
    authorization: '<<apiKey>>'
}
})
.then(function (response) {
  console.log(response.data);
})
.catch(function (response) {
  console.log(response);
});
```
```ruby
require 'uri'
require 'net/http'
require 'openssl'

url = URI("https://api.short.io/api/domains")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'
request["authorization"] = '<<apiKey>>'

response = http.request(request)
puts response.read_body
```

### **4)** Launch the file.

```python
python filename.py
```
```javascript Node.js
node filename.js
```
```ruby Ruby
ruby filename.rb
```

### **5)** JSON Response (list of domains).

Once you run the code, you will see the response.

```json
{
    id: 7252,
    hostname: 'yrbrand.co',
    title: null,
    segmentKey: null,
    linkType: 'increment',
    state: 'not_configured',
    provider: 'cloudflare',
    redirect404: 'https://short.cm',
    hideReferer: 1,
    caseSensitive: true,
    exportEnabled: true,
    cloaking: false,
    jsRedir: true,
    incrementCounter: 'A',
    setupType: 'js',
    autodeletePeriod: 1,
    httpsLinks: true,
    clientStorage: '{"configurationHidden":false}',
    integrationGA: null,
    integrationFB: null,
    integrationAdroll: null,
    integrationGTM: null,
    createdAt: '2017-12-07T08:24:41.000Z',
    updatedAt: '2019-12-24T13:08:30.000Z',
    TeamId: 1381,
    unicodeHostname: 'yrbrand.co'
  }
```