Skip to content

GET /api/v3/accounts/{lcuid}/analytics/by-screen

Summary

GET accounts/{id}/analytics/by-screen

Description

Return the analytics data, by-screen, for an account across a specified timeframe

Tags: analytics

Parameters

Header Parameters

Name Type Required Description Example
Authorization string ✓ Yes Bearer {AuthToken}
Content-Type string ✓ Yes application/json
Accept string ✓ Yes application/json
AppIdV3 string ✓ Yes LCUID-LAP-********-****-****-****-************

Request Body

Required: Yes

Content Type: application/json

Schema

Type: object

Required fields: timeframe

Properties:

  • timeframe (string) (required): The timeframe to use. One of the defined timeframes, or pass custom in order to pass custom dates See timeframes reference.
  • timeframe_opts (string): The timeframe options to use when timeframe is set to custom This is formated as a json string containing the start_date and end_date keys in YYYY-MM-DD format. Must be a valid JSON string.

Responses

Response: 200

Description: Sample Response

Content Type: application/json

Schema

Type: object

Properties:

  • success (boolean): true
  • analytics (array): The analytics data
  • Array items: object Type: object

    Properties:

    • total_plays (integer): The total number of plays
    • total_impressions (integer): The total number of impressions
    • total_play_duration (integer): The total play duration in seconds
    • lcuid (string): The lcuid of the screen
    • name (string): The name of the screen
    • board_identifier (string): The vendor board identifier of the screen
Example Response
{
    "success": true,
    "analytics": [
        {
            "total_plays": 445,
            "total_impressions": 445,
            "total_play_duration": 3560,
            "lcuid": "LCUID-LB-b3e834ce-9892-4fe3-8f8d-897ede583625",
            "name": "15th Ave and Broadway, N/F",
            "board_identifier": "k7qoaas"
        },
        {
            "total_plays": 445,
            "total_impressions": 445,
            "total_play_duration": 3560,
            "lcuid": "LCUID-LB-95cbacdb-fab0-49bb-a194-199105ceeba4",
            "name": "36th Street and Main, S/F",
            "board_identifier": "eajmytp"
        }
    ]
}

Example Implementations

Bash (cURL)

curl --request GET \
    --get "https://api.lucit.app/api/v3/accounts/LCUID-LA-506fc585-77be-11ec-acb9-c2cdb617d190/analytics/by-screen" \
    --header "Authorization: Bearer {AuthToken}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "AppIdV3: LCUID-LAP-********-****-****-****-************" \
    --data "{
    \"timeframe\": \"custom\",
    \"timeframe_opts\": \"{\\\"start_date\\\":\\\"2021-09-01\\\",\\\"end_date\\\":\\\"2021-09-30\\\"}\"
}"

JavaScript (Fetch API)

const url = new URL(
    "https://api.lucit.app/api/v3/accounts/LCUID-LA-506fc585-77be-11ec-acb9-c2cdb617d190/analytics/by-screen"
);

const headers = {
    "Authorization": "Bearer {AuthToken}",
    "Content-Type": "application/json",
    "Accept": "application/json",
    "AppIdV3": "LCUID-LAP-********-****-****-****-************",
};

let body = {
    "timeframe": "custom",
    "timeframe_opts": "{\"start_date\":\"2021-09-01\",\"end_date\":\"2021-09-30\"}"
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

PHP (Guzzle)

$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.lucit.app/api/v3/accounts/LCUID-LA-506fc585-77be-11ec-acb9-c2cdb617d190/analytics/by-screen',
    [
        'headers' => [
            'Authorization' => 'Bearer {AuthToken}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'AppIdV3' => 'LCUID-LAP-********-****-****-****-************',
        ],
        'json' => [
            'timeframe' => 'custom',
            'timeframe_opts' => '{"start_date":"2021-09-01","end_date":"2021-09-30"}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Python (Requests)

import requests
import json

url = 'https://api.lucit.app/api/v3/accounts/LCUID-LA-506fc585-77be-11ec-acb9-c2cdb617d190/analytics/by-screen'
payload = {
    "timeframe": "custom",
    "timeframe_opts": "{\"start_date\":\"2021-09-01\",\"end_date\":\"2021-09-30\"}"
}
headers = {
  'Authorization': 'Bearer {AuthToken}',
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'AppIdV3': 'LCUID-LAP-********-****-****-****-************'
}

response = requests.request('GET', url, headers=headers, json=payload)
response.json()

← Back to accounts index | Back to main index