GET /api/v3/accounts/{lcuid}/analytics/by-period¶
Summary¶
GET accounts/{id}/analytics/by-period
Description¶
Return the analytics data, by-period, 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, period
Properties:
timeframe(string) (required): The timeframe to use. One of the defined timeframes, or passcustomin order to pass custom dates See timeframes reference.timeframe_opts(string): The timeframe options to use when timeframe is set tocustomThis is formated as a json string containing thestart_dateandend_datekeys inYYYY-MM-DDformat. Must be a valid JSON string.period(string) (required): The period to group the stats by.
Responses¶
Response: 200¶
Description: Sample Response
Content Type: application/json¶
Schema¶
Type: object
Properties:
success(boolean): trueanalytics(array): The analytics data-
Array items:
objectType:objectProperties:
period(string): The periodtotal_plays(integer): The total number of playstotal_impressions(integer): The total number of impressionstotal_play_duration(integer): The total play duration in seconds
Example Response¶
{
"success": true,
"analytics": [
{
"period": "2026-01-09",
"total_plays": 57,
"total_impressions": 57,
"total_play_duration": 456
},
{
"period": "2026-01-10",
"total_plays": 58,
"total_impressions": 58,
"total_play_duration": 464
},
{
"period": "2026-01-11",
"total_plays": 58,
"total_impressions": 58,
"total_play_duration": 464
},
{
"period": "2026-01-12",
"total_plays": 57,
"total_impressions": 57,
"total_play_duration": 456
},
{
"period": "2026-01-13",
"total_plays": 58,
"total_impressions": 58,
"total_play_duration": 464
},
{
"period": "2026-01-14",
"total_plays": 57,
"total_impressions": 57,
"total_play_duration": 456
},
{
"period": "2026-01-15",
"total_plays": 58,
"total_impressions": 58,
"total_play_duration": 464
},
{
"period": "2026-01-16",
"total_plays": 42,
"total_impressions": 42,
"total_play_duration": 336
}
]
}
Example Implementations¶
Bash (cURL)¶
curl --request GET \
--get "https://api.lucit.app/api/v3/accounts/LCUID-LA-506fc585-77be-11ec-acb9-c2cdb617d190/analytics/by-period" \
--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\\\"}\",
\"period\": \"daily\\nSee [periods reference](../analytics/GET-analytics-constants-periods.md)\"
}"
JavaScript (Fetch API)¶
const url = new URL(
"https://api.lucit.app/api/v3/accounts/LCUID-LA-506fc585-77be-11ec-acb9-c2cdb617d190/analytics/by-period"
);
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\"}",
"period": "daily\nSee [periods reference](../analytics/GET-analytics-constants-periods.md)"
};
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-period',
[
'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"}',
'period' => 'daily'."\n"
.'See [periods reference](../analytics/GET-analytics-constants-periods.md)',
],
]
);
$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-period'
payload = {
"timeframe": "custom",
"timeframe_opts": "{\"start_date\":\"2021-09-01\",\"end_date\":\"2021-09-30\"}",
"period": "daily\nSee [periods reference](../analytics/GET-analytics-constants-periods.md)"
}
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()