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

# Export Device Report

> Addressable API for Exporting Ads

## Query Parameters

| Parameter | Type   | Required | Description                                                                  |
| --------- | ------ | -------- | ---------------------------------------------------------------------------- |
| `type`    | string | No       | Set to `broadcast` to aggregate by broadcast month instead of calendar month |

### Examples

```
GET /campaigns/exportClientDeviceReport              # Default (calendar month)
GET /campaigns/exportClientDeviceReport?type=broadcast   # Broadcast month
```

## Example API Usage

Here are examples of how to fetch data from the Addressable.tv API endpoint in different programming languages:

<CodeGroup>
  ```python Python theme={null}
  import requests

  url = "https://api.addressable.tv/campaigns/exportClientDeviceReport"
  headers = {
      "x-api-key": "YOUR_API_KEY",
      "client": "YOUR_CLIENT_KEY"
  }

  # Optional: use broadcast month aggregation
  params = {"type": "broadcast"}

  response = requests.get(url, headers=headers, params=params)
  data = response.json()
  print(data)
  ```

  ```javascript Javascript theme={null}
  const fetch = require('node-fetch');

  // Optional: use broadcast month aggregation
  const params = new URLSearchParams({ type: 'broadcast' });
  const url = `https://api.addressable.tv/campaigns/exportClientDeviceReport?${params}`;
  const headers = {
    'x-api-key': 'YOUR_API_KEY',
    client: 'YOUR_CLIENT_KEY',
  };

  fetch(url, { headers })
    .then((response) => response.json())
    .then((data) => console.log(data))
    .catch((error) => console.error(error));
  ```

  ```java Java theme={null}
  import java.net.http.HttpClient;
  import java.net.http.HttpRequest;
  import java.net.http.HttpResponse;
  import java.net.URI;

  public class FetchData {
      public static void main(String[] args) {
          HttpClient client = HttpClient.newHttpClient();
          HttpRequest request = HttpRequest.newBuilder()
              .uri(URI.create("https://api.addressable.tv/campaigns/exportClientDeviceReport"))
              .header("x-api-key", "YOUR_API_KEY")
              .header("client", "YOUR_CLIENT_KEY")
              .build();

          client.sendAsync(request, HttpResponse.BodyHandlers.ofString())
              .thenApply(HttpResponse::body)
              .thenAccept(System.out::println)
              .join();
      }
  }
  ```

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

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

  func main() {
      url := "https://api.addressable.tv/campaigns/exportClientDeviceReport"
      client := &http.Client{}
      req, _ := http.NewRequest("GET", url, nil)

      req.Header.Add("x-api-key", "YOUR_API_KEY")
      req.Header.Add("client", "YOUR_CLIENT_KEY")

      resp, err := client.Do(req)
      if err != nil {
          fmt.Println(err)
          return
      }
      defer resp.Body.Close()

      body, _ := ioutil.ReadAll(resp.Body)
      fmt.Println(string(body))
  }
  ```

  ```csharp C# theme={null}
  using System;
  using System.Net.Http;
  using System.Threading.Tasks;

  class Program
  {
      static async Task Main()
      {
          var client = new HttpClient();
          var request = new HttpRequestMessage
          {
              Method = HttpMethod.Get,
              RequestUri = new Uri("https://api.addressable.tv/campaigns/exportClientDeviceReport")
          };

          request.Headers.Add("x-api-key", "YOUR_API_KEY");
          request.Headers.Add("client", "YOUR_CLIENT_KEY");

          var response = await client.SendAsync(request);
          response.EnsureSuccessStatusCode();
          var data = await response.Content.ReadAsStringAsync();
          Console.WriteLine(data);
      }
  }
  ```

  ```cpp C++ theme={null}
  #include <curl/curl.h>
  #include <iostream>
  #include <string>

  static size_t WriteCallback(void *contents, size_t size, size_t nmemb, void *userp)
  {
      ((std::string*)userp)->append((char*)contents, size * nmemb);
      return size * nmemb;
  }

  int main()
  {
      CURL *curl;
      CURLcode res;
      std::string readBuffer;

      curl = curl_easy_init();
      if(curl) {
          struct curl_slist *headers = NULL;
          headers = curl_slist_append(headers, "x-api-key: YOUR_API_KEY");
          headers = curl_slist_append(headers, "client: YOUR_CLIENT_KEY");

          curl_easy_setopt(curl, CURLOPT_URL, "https://api.addressable.tv/campaigns/exportClientDeviceReport");
          curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
          curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteCallback);
          curl_easy_setopt(curl, CURLOPT_WRITEDATA, &readBuffer);

          res = curl_easy_perform(curl);
          if(res != CURLE_OK)
              std::cout << "curl_easy_perform() failed: " << curl_easy_strerror(res) << std::endl;

          curl_easy_cleanup(curl);
          curl_slist_free_all(headers);
      }

      std::cout << readBuffer << std::endl;
      return 0;
  }
  ```
</CodeGroup>

## Response Schema

The API returns an array of device delivery records, aggregated by campaign, month, and device type.

### Example Response

```json theme={null}
[
  {
    "campaignName": "Holiday Campaign 2024",
    "status": "ACTIVE",
    "advertiser": "Acme Corporation",
    "client": "ACME",
    "month": "2025-10",
    "device": "CTV",
    "impressions": 125000,
    "uid": "12345",
    "clientAgency": ""
  },
  {
    "campaignName": "Holiday Campaign 2024",
    "status": "ACTIVE",
    "advertiser": "Acme Corporation",
    "client": "ACME",
    "month": "2025-10",
    "device": "Mobile",
    "impressions": 45000,
    "uid": "12345",
    "clientAgency": ""
  },
  {
    "campaignName": "Holiday Campaign 2024",
    "status": "ACTIVE",
    "advertiser": "Acme Corporation",
    "client": "ACME",
    "month": "2025-11",
    "device": "CTV",
    "impressions": 180000,
    "uid": "12345",
    "clientAgency": ""
  }
]
```

### Response Fields

| Field          | Type             | Description                                                                |
| -------------- | ---------------- | -------------------------------------------------------------------------- |
| `campaignName` | string           | Campaign name                                                              |
| `status`       | string           | Campaign status: `ACTIVE`, `COMPLETE`, `PENDING`, `PAUSED`, or `CANCELLED` |
| `advertiser`   | string           | Advertiser name                                                            |
| `client`       | string           | Client name                                                                |
| `month`        | string           | Month in `YYYY-MM` format                                                  |
| `device`       | string           | Device type (see below)                                                    |
| `impressions`  | number           | Total impressions for this device/month combination                        |
| `uid`          | string \| number | Campaign unique identifier (your campaign ID)                              |
| `clientAgency` | string           | Agency of Record (AOR) for the campaign                                    |

### Device Types

| Device       | Description                                         |
| ------------ | --------------------------------------------------- |
| `ROKU`       | Roku devices and Roku TVs                           |
| `SAMSUNG`    | Samsung Smart TVs                                   |
| `AMAZON`     | Amazon Fire TV devices                              |
| `APPLE TV`   | Apple TV devices                                    |
| `VIZIO`      | Vizio Smart TVs                                     |
| `LG`         | LG Smart TVs (includes WebOS)                       |
| `ANDROID TV` | Android TV devices (includes Google TV)             |
| `INSIGNIA`   | Insignia Smart TVs                                  |
| `TOSHIBA`    | Toshiba Smart TVs                                   |
| `HISENSE`    | Hisense Smart TVs                                   |
| `DIRECTV`    | DirecTV streaming devices                           |
| `SONY`       | Sony Smart TVs                                      |
| `ONN`        | Onn streaming devices (Walmart brand)               |
| `TCL`        | TCL Smart TVs                                       |
| `PHILIPS`    | Philips Smart TVs                                   |
| `OTHER`      | Other CTV devices not matching the above categories |

### Notes

* Data is aggregated by campaign, month, and device type
* Only campaigns with device statistics are included
* Each row represents a unique campaign + month + device combination
* Use `?type=broadcast` to aggregate by broadcast month instead of calendar month
