> ## Documentation Index
> Fetch the complete documentation index at: https://dev.kloo.li/llms.txt
> Use this file to discover all available pages before exploring further.

# Retrieve all

> Domains — Retrieve all. `GET /domains/`

Interactive playground for `GET /domains/`.

<Tip>
  Paste your API key in the Authorization field as `Bearer {api_key}`.
</Tip>

<RequestExample dropdown>
  ```bash cURL theme={null}
  curl --request GET \
    --url 'https://api.kloo.li/v1/domains/' \
    --header 'Authorization: Bearer {api_key}'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://api.kloo.li/v1/domains/', {
    method: 'GET',
    headers: {
      Authorization: 'Bearer {api_key}',
      Accept: 'application/json'
    }
  });
  const data = await response.json();
  console.log(data);
  ```

  ```javascript Node.js theme={null}
  const response = await fetch('https://api.kloo.li/v1/domains/', {
    method: 'GET',
    headers: {
      Authorization: 'Bearer {api_key}',
      Accept: 'application/json'
    }
  });
  const data = await response.json();
  console.log(data);
  ```

  ```python Python theme={null}
  import requests

  url = 'https://api.kloo.li/v1/domains/'
  headers = {
      'Authorization': 'Bearer {api_key}',
      'Accept': 'application/json'
  }
  response = requests.request('GET', url, headers=headers)
  print(response.json())
  ```

  ```php PHP theme={null}
  <?php
  $ch = curl_init('https://api.kloo.li/v1/domains/');
  curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_HTTPHEADER => [
      'Authorization: Bearer {api_key}',
      'Accept: application/json',
    ],
  ]);
  echo curl_exec($ch);
  curl_close($ch);
  ```

  ```go Go theme={null}
  package main

  import (
    "fmt"
    "io"
    "net/http"
  )

  func main() {
    req, _ := http.NewRequest("GET", "https://api.kloo.li/v1/domains/", nil)
    req.Header.Set("Authorization", "Bearer {api_key}")
    req.Header.Set("Accept", "application/json")
    res, _ := http.DefaultClient.Do(req)
    defer res.Body.Close()
    body, _ := io.ReadAll(res.Body)
    fmt.Println(string(body))
  }
  ```

  ```java Java theme={null}
  HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://api.kloo.li/v1/domains/"))
    .header("Authorization", "Bearer {api_key}")
    .header("Accept", "application/json")
    .method("GET", HttpRequest.BodyPublishers.noBody())
    .build();
  HttpResponse<String> response = HttpClient.newHttpClient()
    .send(request, HttpResponse.BodyHandlers.ofString());
  System.out.println(response.body());
  ```

  ```csharp C# theme={null}
  using var client = new HttpClient();
  client.DefaultRequestHeaders.Add("Authorization", "Bearer {api_key}");
  client.DefaultRequestHeaders.Add("Accept", "application/json");
  var response = await client.SendAsync(new HttpRequestMessage(HttpMethod.Get, "https://api.kloo.li/v1/domains/"));
  Console.WriteLine(await response.Content.ReadAsStringAsync());
  ```

  ```ruby Ruby theme={null}
  require 'net/http'
  require 'uri'

  uri = URI('https://api.kloo.li/v1/domains/')
  req = Net::HTTP::Get.new(uri)
  req['Authorization'] = 'Bearer {api_key}'
  req['Accept'] = 'application/json'
  res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
  puts res.body
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "data": [
      {
        "id": 1,
        "scheme": "https://",
        "host": "example.com",
        "custom_index_url": "",
        "is_enabled": true,
        "last_datetime": null,
        "datetime": "2026-01-15 12:00:00"
      }
    ],
    "meta": {
      "page": 1,
      "results_per_page": 25,
      "total": 1,
      "total_pages": 1
    },
    "links": {
      "first": "https://api.kloo.li/v1/domains?page=1",
      "last": "https://api.kloo.li/v1/domains?page=1",
      "next": null,
      "prev": null,
      "self": "https://api.kloo.li/v1/domains?page=1"
    }
  }
  ```
</ResponseExample>


## OpenAPI

````yaml openapi.yaml GET /domains/
openapi: 3.0.3
info:
  title: Kloo Public API
  version: 1.0.0
  description: User API for Kloo — short links, QR codes, domains, teams, analytics.
servers:
  - url: https://api.kloo.li/v1
security:
  - bearerAuth: []
paths:
  /domains/:
    get:
      tags:
        - Domains
      summary: Retrieve all (domains)
      operationId: domains_retrieve_all_get_domains
      parameters:
        - name: search
          in: query
          required: false
          schema:
            type: string
          description: The search string
        - name: search_by
          in: query
          required: false
          schema:
            type: string
          description: 'Allowed values are: `host`'
        - name: is_enabled
          in: query
          required: false
          schema:
            type: boolean
            description: On create, presence often means true. On update, send 0 or 1.
          description: is_enabled
        - name: datetime_field
          in: query
          required: false
          schema:
            type: string
          description: 'Allowed values: `datetime`, `last_datetime`'
        - name: datetime_start
          in: query
          required: false
          schema:
            type: string
          description: Filter results starting from this datetime. `Y-m-d H:i:s` format
        - name: datetime_end
          in: query
          required: false
          schema:
            type: string
          description: Filter results up to this datetime. `Y-m-d H:i:s` format
        - name: order_by
          in: query
          required: false
          schema:
            type: string
          description: >-
            What field to order the results by. Allowed values are: `domain_id`,
            `datetime`, `last_datetime`, `host`
        - name: order_type
          in: query
          required: false
          schema:
            type: string
          description: >-
            The ordering of the results. Allowed values are: `ASC` for ascending
            ordering, and `DESC` for descending ordering
        - name: page
          in: query
          required: false
          schema:
            type: integer
          description: The page number that you want results from. Defaults to `1`
        - name: results_per_page
          in: query
          required: false
          schema:
            type: integer
            enum:
              - 10
              - 25
              - 50
              - 100
              - 250
              - 500
              - 1000
          description: >-
            How many results you want per page. Allowed values are: `10`, `25`,
            `50`, `100`, `250`, `500`, `1000`. Defaults to `25`
      responses:
        '200':
          description: Success
        '201':
          description: Created
        '400':
          description: Bad request
        '401':
          description: Unauthorized
        '404':
          description: Not found
        '429':
          description: Rate limit
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: '{api_key}'
      x-default: '{api_key}'
      description: >-
        Get your API key at https://kloo.li/account-api. Use `Authorization:
        Bearer {api_key}`.

````