All URIs are relative to https://zernio.com/api
| Method | HTTP request | Description |
|---|---|---|
| getAnalytics | GET /v1/analytics | Get post analytics |
| getAnalyticsWithHttpInfo | GET /v1/analytics | Get post analytics |
| getBestTimeToPost | GET /v1/analytics/best-time | Get best times to post |
| getBestTimeToPostWithHttpInfo | GET /v1/analytics/best-time | Get best times to post |
| getContentDecay | GET /v1/analytics/content-decay | Get content performance decay |
| getContentDecayWithHttpInfo | GET /v1/analytics/content-decay | Get content performance decay |
| getDailyMetrics | GET /v1/analytics/daily-metrics | Get daily aggregated metrics |
| getDailyMetricsWithHttpInfo | GET /v1/analytics/daily-metrics | Get daily aggregated metrics |
| getFollowerStats | GET /v1/accounts/follower-stats | Get follower stats |
| getFollowerStatsWithHttpInfo | GET /v1/accounts/follower-stats | Get follower stats |
| getInstagramAccountInsights | GET /v1/analytics/instagram/account-insights | Get Instagram account-level insights |
| getInstagramAccountInsightsWithHttpInfo | GET /v1/analytics/instagram/account-insights | Get Instagram account-level insights |
| getInstagramDemographics | GET /v1/analytics/instagram/demographics | Get Instagram audience demographics |
| getInstagramDemographicsWithHttpInfo | GET /v1/analytics/instagram/demographics | Get Instagram audience demographics |
| getLinkedInAggregateAnalytics | GET /v1/accounts/{accountId}/linkedin-aggregate-analytics | Get LinkedIn aggregate stats |
| getLinkedInAggregateAnalyticsWithHttpInfo | GET /v1/accounts/{accountId}/linkedin-aggregate-analytics | Get LinkedIn aggregate stats |
| getLinkedInPostAnalytics | GET /v1/accounts/{accountId}/linkedin-post-analytics | Get LinkedIn post stats |
| getLinkedInPostAnalyticsWithHttpInfo | GET /v1/accounts/{accountId}/linkedin-post-analytics | Get LinkedIn post stats |
| getLinkedInPostReactions | GET /v1/accounts/{accountId}/linkedin-post-reactions | Get LinkedIn post reactions |
| getLinkedInPostReactionsWithHttpInfo | GET /v1/accounts/{accountId}/linkedin-post-reactions | Get LinkedIn post reactions |
| getPostTimeline | GET /v1/analytics/post-timeline | Get post analytics timeline |
| getPostTimelineWithHttpInfo | GET /v1/analytics/post-timeline | Get post analytics timeline |
| getPostingFrequency | GET /v1/analytics/posting-frequency | Get posting frequency vs engagement |
| getPostingFrequencyWithHttpInfo | GET /v1/analytics/posting-frequency | Get posting frequency vs engagement |
| getYouTubeDailyViews | GET /v1/analytics/youtube/daily-views | Get YouTube daily views |
| getYouTubeDailyViewsWithHttpInfo | GET /v1/analytics/youtube/daily-views | Get YouTube daily views |
GetAnalytics200Response getAnalytics(postId, platform, profileId, accountId, source, fromDate, toDate, limit, page, sortBy, order)
Get post analytics
Returns analytics for posts. With postId, returns a single post. Without it, returns a paginated list with overview stats. Accepts both Zernio Post IDs and External Post IDs (auto-resolved). fromDate defaults to 90 days ago if omitted, max range 366 days. Single post lookups may return 202 (sync pending) or 424 (all platforms failed). For follower stats, use /v1/accounts/follower-stats.
// Import classes:
import dev.zernio.ApiClient;
import dev.zernio.ApiException;
import dev.zernio.Configuration;
import dev.zernio.auth.*;
import dev.zernio.models.*;
import dev.zernio.api.AnalyticsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://zernio.com/api");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
AnalyticsApi apiInstance = new AnalyticsApi(defaultClient);
String postId = "postId_example"; // String | Returns analytics for a single post. Accepts both Zernio Post IDs and External Post IDs. Zernio IDs are auto-resolved to External Post analytics.
String platform = "platform_example"; // String | Filter by platform (default \"all\")
String profileId = "profileId_example"; // String | Filter by profile ID (default \"all\")
String accountId = "accountId_example"; // String | Filter by social account ID
String source = "all"; // String | Filter by post source: late (posted via Zernio API), external (synced from platform), all (default)
LocalDate fromDate = LocalDate.now(); // LocalDate | Inclusive lower bound (YYYY-MM-DD). Defaults to 90 days ago if omitted. Max range is 366 days.
LocalDate toDate = LocalDate.now(); // LocalDate | Inclusive upper bound (YYYY-MM-DD). Defaults to today if omitted.
Integer limit = 50; // Integer | Page size (default 50)
Integer page = 1; // Integer | Page number (default 1)
String sortBy = "date"; // String | Sort by date, engagement, or a specific metric
String order = "asc"; // String | Sort order
try {
GetAnalytics200Response result = apiInstance.getAnalytics(postId, platform, profileId, accountId, source, fromDate, toDate, limit, page, sortBy, order);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AnalyticsApi#getAnalytics");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| postId | String | Returns analytics for a single post. Accepts both Zernio Post IDs and External Post IDs. Zernio IDs are auto-resolved to External Post analytics. | [optional] |
| platform | String | Filter by platform (default "all") | [optional] |
| profileId | String | Filter by profile ID (default "all") | [optional] |
| accountId | String | Filter by social account ID | [optional] |
| source | String | Filter by post source: late (posted via Zernio API), external (synced from platform), all (default) | [optional] [default to all] [enum: all, late, external] |
| fromDate | LocalDate | Inclusive lower bound (YYYY-MM-DD). Defaults to 90 days ago if omitted. Max range is 366 days. | [optional] |
| toDate | LocalDate | Inclusive upper bound (YYYY-MM-DD). Defaults to today if omitted. | [optional] |
| limit | Integer | Page size (default 50) | [optional] [default to 50] |
| page | Integer | Page number (default 1) | [optional] [default to 1] |
| sortBy | String | Sort by date, engagement, or a specific metric | [optional] [default to date] [enum: date, engagement, impressions, reach, likes, comments, shares, saves, clicks, views] |
| order | String | Sort order | [optional] [default to desc] [enum: asc, desc] |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Analytics result | - |
| 202 | Analytics are being synced from the platform (single post lookup only). The response body matches AnalyticsSinglePostResponse with syncStatus "pending" and a message. | - |
| 400 | Validation error | - |
| 401 | Unauthorized | - |
| 402 | Analytics add-on required | - |
| 404 | Resource not found | - |
| 424 | Post failed to publish on all platforms. Analytics are unavailable. (single post lookup only) | - |
| 500 | Internal server error | - |
ApiResponse getAnalytics getAnalyticsWithHttpInfo(postId, platform, profileId, accountId, source, fromDate, toDate, limit, page, sortBy, order)
Get post analytics
Returns analytics for posts. With postId, returns a single post. Without it, returns a paginated list with overview stats. Accepts both Zernio Post IDs and External Post IDs (auto-resolved). fromDate defaults to 90 days ago if omitted, max range 366 days. Single post lookups may return 202 (sync pending) or 424 (all platforms failed). For follower stats, use /v1/accounts/follower-stats.
// Import classes:
import dev.zernio.ApiClient;
import dev.zernio.ApiException;
import dev.zernio.ApiResponse;
import dev.zernio.Configuration;
import dev.zernio.auth.*;
import dev.zernio.models.*;
import dev.zernio.api.AnalyticsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://zernio.com/api");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
AnalyticsApi apiInstance = new AnalyticsApi(defaultClient);
String postId = "postId_example"; // String | Returns analytics for a single post. Accepts both Zernio Post IDs and External Post IDs. Zernio IDs are auto-resolved to External Post analytics.
String platform = "platform_example"; // String | Filter by platform (default \"all\")
String profileId = "profileId_example"; // String | Filter by profile ID (default \"all\")
String accountId = "accountId_example"; // String | Filter by social account ID
String source = "all"; // String | Filter by post source: late (posted via Zernio API), external (synced from platform), all (default)
LocalDate fromDate = LocalDate.now(); // LocalDate | Inclusive lower bound (YYYY-MM-DD). Defaults to 90 days ago if omitted. Max range is 366 days.
LocalDate toDate = LocalDate.now(); // LocalDate | Inclusive upper bound (YYYY-MM-DD). Defaults to today if omitted.
Integer limit = 50; // Integer | Page size (default 50)
Integer page = 1; // Integer | Page number (default 1)
String sortBy = "date"; // String | Sort by date, engagement, or a specific metric
String order = "asc"; // String | Sort order
try {
ApiResponse<GetAnalytics200Response> response = apiInstance.getAnalyticsWithHttpInfo(postId, platform, profileId, accountId, source, fromDate, toDate, limit, page, sortBy, order);
System.out.println("Status code: " + response.getStatusCode());
System.out.println("Response headers: " + response.getHeaders());
System.out.println("Response body: " + response.getData());
} catch (ApiException e) {
System.err.println("Exception when calling AnalyticsApi#getAnalytics");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
System.err.println("Reason: " + e.getResponseBody());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| postId | String | Returns analytics for a single post. Accepts both Zernio Post IDs and External Post IDs. Zernio IDs are auto-resolved to External Post analytics. | [optional] |
| platform | String | Filter by platform (default "all") | [optional] |
| profileId | String | Filter by profile ID (default "all") | [optional] |
| accountId | String | Filter by social account ID | [optional] |
| source | String | Filter by post source: late (posted via Zernio API), external (synced from platform), all (default) | [optional] [default to all] [enum: all, late, external] |
| fromDate | LocalDate | Inclusive lower bound (YYYY-MM-DD). Defaults to 90 days ago if omitted. Max range is 366 days. | [optional] |
| toDate | LocalDate | Inclusive upper bound (YYYY-MM-DD). Defaults to today if omitted. | [optional] |
| limit | Integer | Page size (default 50) | [optional] [default to 50] |
| page | Integer | Page number (default 1) | [optional] [default to 1] |
| sortBy | String | Sort by date, engagement, or a specific metric | [optional] [default to date] [enum: date, engagement, impressions, reach, likes, comments, shares, saves, clicks, views] |
| order | String | Sort order | [optional] [default to desc] [enum: asc, desc] |
ApiResponse<GetAnalytics200Response>
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Analytics result | - |
| 202 | Analytics are being synced from the platform (single post lookup only). The response body matches AnalyticsSinglePostResponse with syncStatus "pending" and a message. | - |
| 400 | Validation error | - |
| 401 | Unauthorized | - |
| 402 | Analytics add-on required | - |
| 404 | Resource not found | - |
| 424 | Post failed to publish on all platforms. Analytics are unavailable. (single post lookup only) | - |
| 500 | Internal server error | - |
GetBestTimeToPost200Response getBestTimeToPost(platform, profileId, source)
Get best times to post
Returns the best times to post based on historical engagement data. Groups all published posts by day of week and hour (UTC), calculating average engagement per slot. Use this to auto-schedule posts at optimal times. Requires the Analytics add-on.
// Import classes:
import dev.zernio.ApiClient;
import dev.zernio.ApiException;
import dev.zernio.Configuration;
import dev.zernio.auth.*;
import dev.zernio.models.*;
import dev.zernio.api.AnalyticsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://zernio.com/api");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
AnalyticsApi apiInstance = new AnalyticsApi(defaultClient);
String platform = "platform_example"; // String | Filter by platform (e.g. \"instagram\", \"tiktok\"). Omit for all platforms.
String profileId = "profileId_example"; // String | Filter by profile ID. Omit for all profiles.
String source = "all"; // String | Filter by post origin. \"late\" for posts published via Zernio, \"external\" for posts imported from platforms.
try {
GetBestTimeToPost200Response result = apiInstance.getBestTimeToPost(platform, profileId, source);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AnalyticsApi#getBestTimeToPost");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| platform | String | Filter by platform (e.g. "instagram", "tiktok"). Omit for all platforms. | [optional] |
| profileId | String | Filter by profile ID. Omit for all profiles. | [optional] |
| source | String | Filter by post origin. "late" for posts published via Zernio, "external" for posts imported from platforms. | [optional] [default to all] [enum: all, late, external] |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Best time slots | - |
| 401 | Unauthorized | - |
| 403 | Analytics add-on required | - |
ApiResponse getBestTimeToPost getBestTimeToPostWithHttpInfo(platform, profileId, source)
Get best times to post
Returns the best times to post based on historical engagement data. Groups all published posts by day of week and hour (UTC), calculating average engagement per slot. Use this to auto-schedule posts at optimal times. Requires the Analytics add-on.
// Import classes:
import dev.zernio.ApiClient;
import dev.zernio.ApiException;
import dev.zernio.ApiResponse;
import dev.zernio.Configuration;
import dev.zernio.auth.*;
import dev.zernio.models.*;
import dev.zernio.api.AnalyticsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://zernio.com/api");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
AnalyticsApi apiInstance = new AnalyticsApi(defaultClient);
String platform = "platform_example"; // String | Filter by platform (e.g. \"instagram\", \"tiktok\"). Omit for all platforms.
String profileId = "profileId_example"; // String | Filter by profile ID. Omit for all profiles.
String source = "all"; // String | Filter by post origin. \"late\" for posts published via Zernio, \"external\" for posts imported from platforms.
try {
ApiResponse<GetBestTimeToPost200Response> response = apiInstance.getBestTimeToPostWithHttpInfo(platform, profileId, source);
System.out.println("Status code: " + response.getStatusCode());
System.out.println("Response headers: " + response.getHeaders());
System.out.println("Response body: " + response.getData());
} catch (ApiException e) {
System.err.println("Exception when calling AnalyticsApi#getBestTimeToPost");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
System.err.println("Reason: " + e.getResponseBody());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| platform | String | Filter by platform (e.g. "instagram", "tiktok"). Omit for all platforms. | [optional] |
| profileId | String | Filter by profile ID. Omit for all profiles. | [optional] |
| source | String | Filter by post origin. "late" for posts published via Zernio, "external" for posts imported from platforms. | [optional] [default to all] [enum: all, late, external] |
ApiResponse<GetBestTimeToPost200Response>
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Best time slots | - |
| 401 | Unauthorized | - |
| 403 | Analytics add-on required | - |
GetContentDecay200Response getContentDecay(platform, profileId, source)
Get content performance decay
Returns how engagement accumulates over time after a post is published. Each bucket shows what percentage of the post's total engagement had been reached by that time window. Useful for understanding content lifespan (e.g. "posts reach 78% of total engagement within 24 hours"). Requires the Analytics add-on.
// Import classes:
import dev.zernio.ApiClient;
import dev.zernio.ApiException;
import dev.zernio.Configuration;
import dev.zernio.auth.*;
import dev.zernio.models.*;
import dev.zernio.api.AnalyticsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://zernio.com/api");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
AnalyticsApi apiInstance = new AnalyticsApi(defaultClient);
String platform = "platform_example"; // String | Filter by platform (e.g. \"instagram\", \"tiktok\"). Omit for all platforms.
String profileId = "profileId_example"; // String | Filter by profile ID. Omit for all profiles.
String source = "all"; // String | Filter by post origin. \"late\" for posts published via Zernio, \"external\" for posts imported from platforms.
try {
GetContentDecay200Response result = apiInstance.getContentDecay(platform, profileId, source);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AnalyticsApi#getContentDecay");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| platform | String | Filter by platform (e.g. "instagram", "tiktok"). Omit for all platforms. | [optional] |
| profileId | String | Filter by profile ID. Omit for all profiles. | [optional] |
| source | String | Filter by post origin. "late" for posts published via Zernio, "external" for posts imported from platforms. | [optional] [default to all] [enum: all, late, external] |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Content decay buckets | - |
| 401 | Unauthorized | - |
| 403 | Analytics add-on required | - |
ApiResponse getContentDecay getContentDecayWithHttpInfo(platform, profileId, source)
Get content performance decay
Returns how engagement accumulates over time after a post is published. Each bucket shows what percentage of the post's total engagement had been reached by that time window. Useful for understanding content lifespan (e.g. "posts reach 78% of total engagement within 24 hours"). Requires the Analytics add-on.
// Import classes:
import dev.zernio.ApiClient;
import dev.zernio.ApiException;
import dev.zernio.ApiResponse;
import dev.zernio.Configuration;
import dev.zernio.auth.*;
import dev.zernio.models.*;
import dev.zernio.api.AnalyticsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://zernio.com/api");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
AnalyticsApi apiInstance = new AnalyticsApi(defaultClient);
String platform = "platform_example"; // String | Filter by platform (e.g. \"instagram\", \"tiktok\"). Omit for all platforms.
String profileId = "profileId_example"; // String | Filter by profile ID. Omit for all profiles.
String source = "all"; // String | Filter by post origin. \"late\" for posts published via Zernio, \"external\" for posts imported from platforms.
try {
ApiResponse<GetContentDecay200Response> response = apiInstance.getContentDecayWithHttpInfo(platform, profileId, source);
System.out.println("Status code: " + response.getStatusCode());
System.out.println("Response headers: " + response.getHeaders());
System.out.println("Response body: " + response.getData());
} catch (ApiException e) {
System.err.println("Exception when calling AnalyticsApi#getContentDecay");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
System.err.println("Reason: " + e.getResponseBody());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| platform | String | Filter by platform (e.g. "instagram", "tiktok"). Omit for all platforms. | [optional] |
| profileId | String | Filter by profile ID. Omit for all profiles. | [optional] |
| source | String | Filter by post origin. "late" for posts published via Zernio, "external" for posts imported from platforms. | [optional] [default to all] [enum: all, late, external] |
ApiResponse<GetContentDecay200Response>
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Content decay buckets | - |
| 401 | Unauthorized | - |
| 403 | Analytics add-on required | - |
GetDailyMetrics200Response getDailyMetrics(platform, profileId, accountId, fromDate, toDate, source)
Get daily aggregated metrics
Returns daily aggregated analytics metrics and a per-platform breakdown. Each day includes post count, platform distribution, and summed metrics (impressions, reach, likes, comments, shares, saves, clicks, views). Defaults to the last 180 days. Requires the Analytics add-on.
// Import classes:
import dev.zernio.ApiClient;
import dev.zernio.ApiException;
import dev.zernio.Configuration;
import dev.zernio.auth.*;
import dev.zernio.models.*;
import dev.zernio.api.AnalyticsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://zernio.com/api");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
AnalyticsApi apiInstance = new AnalyticsApi(defaultClient);
String platform = "platform_example"; // String | Filter by platform (e.g. \"instagram\", \"tiktok\"). Omit for all platforms.
String profileId = "profileId_example"; // String | Filter by profile ID. Omit for all profiles.
String accountId = "accountId_example"; // String | Filter by social account ID
OffsetDateTime fromDate = OffsetDateTime.now(); // OffsetDateTime | Inclusive start date (ISO 8601). Defaults to 180 days ago.
OffsetDateTime toDate = OffsetDateTime.now(); // OffsetDateTime | Inclusive end date (ISO 8601). Defaults to now.
String source = "all"; // String | Filter by post origin. \"late\" for posts published via Zernio, \"external\" for posts imported from platforms.
try {
GetDailyMetrics200Response result = apiInstance.getDailyMetrics(platform, profileId, accountId, fromDate, toDate, source);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AnalyticsApi#getDailyMetrics");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| platform | String | Filter by platform (e.g. "instagram", "tiktok"). Omit for all platforms. | [optional] |
| profileId | String | Filter by profile ID. Omit for all profiles. | [optional] |
| accountId | String | Filter by social account ID | [optional] |
| fromDate | OffsetDateTime | Inclusive start date (ISO 8601). Defaults to 180 days ago. | [optional] |
| toDate | OffsetDateTime | Inclusive end date (ISO 8601). Defaults to now. | [optional] |
| source | String | Filter by post origin. "late" for posts published via Zernio, "external" for posts imported from platforms. | [optional] [default to all] [enum: all, late, external] |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Daily metrics and platform breakdown | - |
| 401 | Unauthorized | - |
| 402 | Analytics add-on required | - |
ApiResponse getDailyMetrics getDailyMetricsWithHttpInfo(platform, profileId, accountId, fromDate, toDate, source)
Get daily aggregated metrics
Returns daily aggregated analytics metrics and a per-platform breakdown. Each day includes post count, platform distribution, and summed metrics (impressions, reach, likes, comments, shares, saves, clicks, views). Defaults to the last 180 days. Requires the Analytics add-on.
// Import classes:
import dev.zernio.ApiClient;
import dev.zernio.ApiException;
import dev.zernio.ApiResponse;
import dev.zernio.Configuration;
import dev.zernio.auth.*;
import dev.zernio.models.*;
import dev.zernio.api.AnalyticsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://zernio.com/api");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
AnalyticsApi apiInstance = new AnalyticsApi(defaultClient);
String platform = "platform_example"; // String | Filter by platform (e.g. \"instagram\", \"tiktok\"). Omit for all platforms.
String profileId = "profileId_example"; // String | Filter by profile ID. Omit for all profiles.
String accountId = "accountId_example"; // String | Filter by social account ID
OffsetDateTime fromDate = OffsetDateTime.now(); // OffsetDateTime | Inclusive start date (ISO 8601). Defaults to 180 days ago.
OffsetDateTime toDate = OffsetDateTime.now(); // OffsetDateTime | Inclusive end date (ISO 8601). Defaults to now.
String source = "all"; // String | Filter by post origin. \"late\" for posts published via Zernio, \"external\" for posts imported from platforms.
try {
ApiResponse<GetDailyMetrics200Response> response = apiInstance.getDailyMetricsWithHttpInfo(platform, profileId, accountId, fromDate, toDate, source);
System.out.println("Status code: " + response.getStatusCode());
System.out.println("Response headers: " + response.getHeaders());
System.out.println("Response body: " + response.getData());
} catch (ApiException e) {
System.err.println("Exception when calling AnalyticsApi#getDailyMetrics");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
System.err.println("Reason: " + e.getResponseBody());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| platform | String | Filter by platform (e.g. "instagram", "tiktok"). Omit for all platforms. | [optional] |
| profileId | String | Filter by profile ID. Omit for all profiles. | [optional] |
| accountId | String | Filter by social account ID | [optional] |
| fromDate | OffsetDateTime | Inclusive start date (ISO 8601). Defaults to 180 days ago. | [optional] |
| toDate | OffsetDateTime | Inclusive end date (ISO 8601). Defaults to now. | [optional] |
| source | String | Filter by post origin. "late" for posts published via Zernio, "external" for posts imported from platforms. | [optional] [default to all] [enum: all, late, external] |
ApiResponse<GetDailyMetrics200Response>
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Daily metrics and platform breakdown | - |
| 401 | Unauthorized | - |
| 402 | Analytics add-on required | - |
GetFollowerStats200Response getFollowerStats(accountIds, profileId, fromDate, toDate, granularity)
Get follower stats
Returns follower count history and growth metrics for connected social accounts. Requires analytics add-on subscription. Follower counts are refreshed once per day.
// Import classes:
import dev.zernio.ApiClient;
import dev.zernio.ApiException;
import dev.zernio.Configuration;
import dev.zernio.auth.*;
import dev.zernio.models.*;
import dev.zernio.api.AnalyticsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://zernio.com/api");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
AnalyticsApi apiInstance = new AnalyticsApi(defaultClient);
String accountIds = "accountIds_example"; // String | Comma-separated list of account IDs (optional, defaults to all user's accounts)
String profileId = "profileId_example"; // String | Filter by profile ID
LocalDate fromDate = LocalDate.now(); // LocalDate | Start date in YYYY-MM-DD format (defaults to 30 days ago)
LocalDate toDate = LocalDate.now(); // LocalDate | End date in YYYY-MM-DD format (defaults to today)
String granularity = "daily"; // String | Data aggregation level
try {
GetFollowerStats200Response result = apiInstance.getFollowerStats(accountIds, profileId, fromDate, toDate, granularity);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AnalyticsApi#getFollowerStats");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| accountIds | String | Comma-separated list of account IDs (optional, defaults to all user's accounts) | [optional] |
| profileId | String | Filter by profile ID | [optional] |
| fromDate | LocalDate | Start date in YYYY-MM-DD format (defaults to 30 days ago) | [optional] |
| toDate | LocalDate | End date in YYYY-MM-DD format (defaults to today) | [optional] |
| granularity | String | Data aggregation level | [optional] [default to daily] [enum: daily, weekly, monthly] |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Follower stats | - |
| 401 | Unauthorized | - |
| 403 | Analytics add-on required | - |
ApiResponse getFollowerStats getFollowerStatsWithHttpInfo(accountIds, profileId, fromDate, toDate, granularity)
Get follower stats
Returns follower count history and growth metrics for connected social accounts. Requires analytics add-on subscription. Follower counts are refreshed once per day.
// Import classes:
import dev.zernio.ApiClient;
import dev.zernio.ApiException;
import dev.zernio.ApiResponse;
import dev.zernio.Configuration;
import dev.zernio.auth.*;
import dev.zernio.models.*;
import dev.zernio.api.AnalyticsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://zernio.com/api");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
AnalyticsApi apiInstance = new AnalyticsApi(defaultClient);
String accountIds = "accountIds_example"; // String | Comma-separated list of account IDs (optional, defaults to all user's accounts)
String profileId = "profileId_example"; // String | Filter by profile ID
LocalDate fromDate = LocalDate.now(); // LocalDate | Start date in YYYY-MM-DD format (defaults to 30 days ago)
LocalDate toDate = LocalDate.now(); // LocalDate | End date in YYYY-MM-DD format (defaults to today)
String granularity = "daily"; // String | Data aggregation level
try {
ApiResponse<GetFollowerStats200Response> response = apiInstance.getFollowerStatsWithHttpInfo(accountIds, profileId, fromDate, toDate, granularity);
System.out.println("Status code: " + response.getStatusCode());
System.out.println("Response headers: " + response.getHeaders());
System.out.println("Response body: " + response.getData());
} catch (ApiException e) {
System.err.println("Exception when calling AnalyticsApi#getFollowerStats");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
System.err.println("Reason: " + e.getResponseBody());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| accountIds | String | Comma-separated list of account IDs (optional, defaults to all user's accounts) | [optional] |
| profileId | String | Filter by profile ID | [optional] |
| fromDate | LocalDate | Start date in YYYY-MM-DD format (defaults to 30 days ago) | [optional] |
| toDate | LocalDate | End date in YYYY-MM-DD format (defaults to today) | [optional] |
| granularity | String | Data aggregation level | [optional] [default to daily] [enum: daily, weekly, monthly] |
ApiResponse<GetFollowerStats200Response>
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Follower stats | - |
| 401 | Unauthorized | - |
| 403 | Analytics add-on required | - |
InstagramAccountInsightsResponse getInstagramAccountInsights(accountId, metrics, since, until, metricType, breakdown)
Get Instagram account-level insights
Returns account-level Instagram insights such as reach, views, accounts engaged, and total interactions. These metrics reflect the entire account's performance across all content surfaces (feed, stories, explore, profile), and are fundamentally different from post-level metrics. Data may be delayed up to 48 hours. Max 90 days, defaults to last 30 days. Requires the Analytics add-on.
// Import classes:
import dev.zernio.ApiClient;
import dev.zernio.ApiException;
import dev.zernio.Configuration;
import dev.zernio.auth.*;
import dev.zernio.models.*;
import dev.zernio.api.AnalyticsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://zernio.com/api");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
AnalyticsApi apiInstance = new AnalyticsApi(defaultClient);
String accountId = "accountId_example"; // String | The Zernio SocialAccount ID for the Instagram account
String metrics = "metrics_example"; // String | Comma-separated list of metrics. Defaults to \"reach,views,accounts_engaged,total_interactions\". Valid metrics: reach, views, accounts_engaged, total_interactions, comments, likes, saves, shares, replies, reposts, follows_and_unfollows, profile_links_taps. Note: only \"reach\" supports metricType=time_series. All other metrics are total_value only.
LocalDate since = LocalDate.now(); // LocalDate | Start date (YYYY-MM-DD). Defaults to 30 days ago.
LocalDate until = LocalDate.now(); // LocalDate | End date (YYYY-MM-DD). Defaults to today.
String metricType = "time_series"; // String | \"total_value\" (default) returns aggregated totals and supports breakdowns. \"time_series\" returns daily values but only works with the \"reach\" metric.
String breakdown = "breakdown_example"; // String | Breakdown dimension (only valid with metricType=total_value). Valid values depend on the metric: media_product_type, follow_type, follower_type, contact_button_type.
try {
InstagramAccountInsightsResponse result = apiInstance.getInstagramAccountInsights(accountId, metrics, since, until, metricType, breakdown);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AnalyticsApi#getInstagramAccountInsights");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| accountId | String | The Zernio SocialAccount ID for the Instagram account | |
| metrics | String | Comma-separated list of metrics. Defaults to "reach,views,accounts_engaged,total_interactions". Valid metrics: reach, views, accounts_engaged, total_interactions, comments, likes, saves, shares, replies, reposts, follows_and_unfollows, profile_links_taps. Note: only "reach" supports metricType=time_series. All other metrics are total_value only. | [optional] |
| since | LocalDate | Start date (YYYY-MM-DD). Defaults to 30 days ago. | [optional] |
| until | LocalDate | End date (YYYY-MM-DD). Defaults to today. | [optional] |
| metricType | String | "total_value" (default) returns aggregated totals and supports breakdowns. "time_series" returns daily values but only works with the "reach" metric. | [optional] [default to total_value] [enum: time_series, total_value] |
| breakdown | String | Breakdown dimension (only valid with metricType=total_value). Valid values depend on the metric: media_product_type, follow_type, follower_type, contact_button_type. | [optional] |
InstagramAccountInsightsResponse
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Account insights data | - |
| 400 | Bad request (invalid parameters) | - |
| 401 | Unauthorized | - |
| 402 | Analytics add-on required | - |
| 403 | Access denied to this account | - |
| 404 | Account not found | - |
ApiResponse getInstagramAccountInsights getInstagramAccountInsightsWithHttpInfo(accountId, metrics, since, until, metricType, breakdown)
Get Instagram account-level insights
Returns account-level Instagram insights such as reach, views, accounts engaged, and total interactions. These metrics reflect the entire account's performance across all content surfaces (feed, stories, explore, profile), and are fundamentally different from post-level metrics. Data may be delayed up to 48 hours. Max 90 days, defaults to last 30 days. Requires the Analytics add-on.
// Import classes:
import dev.zernio.ApiClient;
import dev.zernio.ApiException;
import dev.zernio.ApiResponse;
import dev.zernio.Configuration;
import dev.zernio.auth.*;
import dev.zernio.models.*;
import dev.zernio.api.AnalyticsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://zernio.com/api");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
AnalyticsApi apiInstance = new AnalyticsApi(defaultClient);
String accountId = "accountId_example"; // String | The Zernio SocialAccount ID for the Instagram account
String metrics = "metrics_example"; // String | Comma-separated list of metrics. Defaults to \"reach,views,accounts_engaged,total_interactions\". Valid metrics: reach, views, accounts_engaged, total_interactions, comments, likes, saves, shares, replies, reposts, follows_and_unfollows, profile_links_taps. Note: only \"reach\" supports metricType=time_series. All other metrics are total_value only.
LocalDate since = LocalDate.now(); // LocalDate | Start date (YYYY-MM-DD). Defaults to 30 days ago.
LocalDate until = LocalDate.now(); // LocalDate | End date (YYYY-MM-DD). Defaults to today.
String metricType = "time_series"; // String | \"total_value\" (default) returns aggregated totals and supports breakdowns. \"time_series\" returns daily values but only works with the \"reach\" metric.
String breakdown = "breakdown_example"; // String | Breakdown dimension (only valid with metricType=total_value). Valid values depend on the metric: media_product_type, follow_type, follower_type, contact_button_type.
try {
ApiResponse<InstagramAccountInsightsResponse> response = apiInstance.getInstagramAccountInsightsWithHttpInfo(accountId, metrics, since, until, metricType, breakdown);
System.out.println("Status code: " + response.getStatusCode());
System.out.println("Response headers: " + response.getHeaders());
System.out.println("Response body: " + response.getData());
} catch (ApiException e) {
System.err.println("Exception when calling AnalyticsApi#getInstagramAccountInsights");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
System.err.println("Reason: " + e.getResponseBody());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| accountId | String | The Zernio SocialAccount ID for the Instagram account | |
| metrics | String | Comma-separated list of metrics. Defaults to "reach,views,accounts_engaged,total_interactions". Valid metrics: reach, views, accounts_engaged, total_interactions, comments, likes, saves, shares, replies, reposts, follows_and_unfollows, profile_links_taps. Note: only "reach" supports metricType=time_series. All other metrics are total_value only. | [optional] |
| since | LocalDate | Start date (YYYY-MM-DD). Defaults to 30 days ago. | [optional] |
| until | LocalDate | End date (YYYY-MM-DD). Defaults to today. | [optional] |
| metricType | String | "total_value" (default) returns aggregated totals and supports breakdowns. "time_series" returns daily values but only works with the "reach" metric. | [optional] [default to total_value] [enum: time_series, total_value] |
| breakdown | String | Breakdown dimension (only valid with metricType=total_value). Valid values depend on the metric: media_product_type, follow_type, follower_type, contact_button_type. | [optional] |
ApiResponse<InstagramAccountInsightsResponse>
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Account insights data | - |
| 400 | Bad request (invalid parameters) | - |
| 401 | Unauthorized | - |
| 402 | Analytics add-on required | - |
| 403 | Access denied to this account | - |
| 404 | Account not found | - |
InstagramDemographicsResponse getInstagramDemographics(accountId, metric, breakdown, timeframe)
Get Instagram audience demographics
Returns audience demographic insights for an Instagram account, broken down by age, city, country, and/or gender. Requires at least 100 followers. Returns top 45 entries per dimension. Data may be delayed up to 48 hours. Requires the Analytics add-on.
// Import classes:
import dev.zernio.ApiClient;
import dev.zernio.ApiException;
import dev.zernio.Configuration;
import dev.zernio.auth.*;
import dev.zernio.models.*;
import dev.zernio.api.AnalyticsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://zernio.com/api");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
AnalyticsApi apiInstance = new AnalyticsApi(defaultClient);
String accountId = "accountId_example"; // String | The Zernio SocialAccount ID for the Instagram account
String metric = "follower_demographics"; // String | \"follower_demographics\" for follower audience data, or \"engaged_audience_demographics\" for engaged viewers.
String breakdown = "breakdown_example"; // String | Comma-separated list of demographic dimensions: age, city, country, gender. Defaults to all four if omitted.
String timeframe = "this_week"; // String | Time period for demographic data. Defaults to \"this_month\".
try {
InstagramDemographicsResponse result = apiInstance.getInstagramDemographics(accountId, metric, breakdown, timeframe);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AnalyticsApi#getInstagramDemographics");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| accountId | String | The Zernio SocialAccount ID for the Instagram account | |
| metric | String | "follower_demographics" for follower audience data, or "engaged_audience_demographics" for engaged viewers. | [optional] [default to follower_demographics] [enum: follower_demographics, engaged_audience_demographics] |
| breakdown | String | Comma-separated list of demographic dimensions: age, city, country, gender. Defaults to all four if omitted. | [optional] |
| timeframe | String | Time period for demographic data. Defaults to "this_month". | [optional] [default to this_month] [enum: this_week, this_month] |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Demographic insights data | - |
| 400 | Bad request (invalid parameters) | - |
| 401 | Unauthorized | - |
| 402 | Analytics add-on required | - |
| 403 | Access denied to this account | - |
| 404 | Account not found | - |
ApiResponse getInstagramDemographics getInstagramDemographicsWithHttpInfo(accountId, metric, breakdown, timeframe)
Get Instagram audience demographics
Returns audience demographic insights for an Instagram account, broken down by age, city, country, and/or gender. Requires at least 100 followers. Returns top 45 entries per dimension. Data may be delayed up to 48 hours. Requires the Analytics add-on.
// Import classes:
import dev.zernio.ApiClient;
import dev.zernio.ApiException;
import dev.zernio.ApiResponse;
import dev.zernio.Configuration;
import dev.zernio.auth.*;
import dev.zernio.models.*;
import dev.zernio.api.AnalyticsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://zernio.com/api");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
AnalyticsApi apiInstance = new AnalyticsApi(defaultClient);
String accountId = "accountId_example"; // String | The Zernio SocialAccount ID for the Instagram account
String metric = "follower_demographics"; // String | \"follower_demographics\" for follower audience data, or \"engaged_audience_demographics\" for engaged viewers.
String breakdown = "breakdown_example"; // String | Comma-separated list of demographic dimensions: age, city, country, gender. Defaults to all four if omitted.
String timeframe = "this_week"; // String | Time period for demographic data. Defaults to \"this_month\".
try {
ApiResponse<InstagramDemographicsResponse> response = apiInstance.getInstagramDemographicsWithHttpInfo(accountId, metric, breakdown, timeframe);
System.out.println("Status code: " + response.getStatusCode());
System.out.println("Response headers: " + response.getHeaders());
System.out.println("Response body: " + response.getData());
} catch (ApiException e) {
System.err.println("Exception when calling AnalyticsApi#getInstagramDemographics");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
System.err.println("Reason: " + e.getResponseBody());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| accountId | String | The Zernio SocialAccount ID for the Instagram account | |
| metric | String | "follower_demographics" for follower audience data, or "engaged_audience_demographics" for engaged viewers. | [optional] [default to follower_demographics] [enum: follower_demographics, engaged_audience_demographics] |
| breakdown | String | Comma-separated list of demographic dimensions: age, city, country, gender. Defaults to all four if omitted. | [optional] |
| timeframe | String | Time period for demographic data. Defaults to "this_month". | [optional] [default to this_month] [enum: this_week, this_month] |
ApiResponse<InstagramDemographicsResponse>
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Demographic insights data | - |
| 400 | Bad request (invalid parameters) | - |
| 401 | Unauthorized | - |
| 402 | Analytics add-on required | - |
| 403 | Access denied to this account | - |
| 404 | Account not found | - |
GetLinkedInAggregateAnalytics200Response getLinkedInAggregateAnalytics(accountId, aggregation, startDate, endDate, metrics)
Get LinkedIn aggregate stats
Returns aggregate analytics across all posts for a LinkedIn personal account. Org accounts should use /v1/analytics instead. Requires r_member_postAnalytics scope.
// Import classes:
import dev.zernio.ApiClient;
import dev.zernio.ApiException;
import dev.zernio.Configuration;
import dev.zernio.auth.*;
import dev.zernio.models.*;
import dev.zernio.api.AnalyticsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://zernio.com/api");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
AnalyticsApi apiInstance = new AnalyticsApi(defaultClient);
String accountId = "accountId_example"; // String | The ID of the LinkedIn personal account
String aggregation = "TOTAL"; // String | TOTAL (default, lifetime totals) or DAILY (time series). MEMBERS_REACHED not available with DAILY.
LocalDate startDate = LocalDate.parse("2024-01-01"); // LocalDate | Start date (YYYY-MM-DD). If omitted, returns lifetime analytics.
LocalDate endDate = LocalDate.parse("2024-01-31"); // LocalDate | End date (YYYY-MM-DD, exclusive). Defaults to today if omitted.
String metrics = "IMPRESSION,REACTION,COMMENT"; // String | Comma-separated metrics: IMPRESSION, MEMBERS_REACHED, REACTION, COMMENT, RESHARE. Omit for all.
try {
GetLinkedInAggregateAnalytics200Response result = apiInstance.getLinkedInAggregateAnalytics(accountId, aggregation, startDate, endDate, metrics);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AnalyticsApi#getLinkedInAggregateAnalytics");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| accountId | String | The ID of the LinkedIn personal account | |
| aggregation | String | TOTAL (default, lifetime totals) or DAILY (time series). MEMBERS_REACHED not available with DAILY. | [optional] [default to TOTAL] [enum: TOTAL, DAILY] |
| startDate | LocalDate | Start date (YYYY-MM-DD). If omitted, returns lifetime analytics. | [optional] |
| endDate | LocalDate | End date (YYYY-MM-DD, exclusive). Defaults to today if omitted. | [optional] |
| metrics | String | Comma-separated metrics: IMPRESSION, MEMBERS_REACHED, REACTION, COMMENT, RESHARE. Omit for all. | [optional] |
GetLinkedInAggregateAnalytics200Response
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Aggregate analytics data | - |
| 400 | Invalid request | - |
| 401 | Unauthorized | - |
| 402 | Analytics add-on required | - |
| 403 | Missing required LinkedIn scope | - |
| 404 | Account not found | - |
ApiResponse getLinkedInAggregateAnalytics getLinkedInAggregateAnalyticsWithHttpInfo(accountId, aggregation, startDate, endDate, metrics)
Get LinkedIn aggregate stats
Returns aggregate analytics across all posts for a LinkedIn personal account. Org accounts should use /v1/analytics instead. Requires r_member_postAnalytics scope.
// Import classes:
import dev.zernio.ApiClient;
import dev.zernio.ApiException;
import dev.zernio.ApiResponse;
import dev.zernio.Configuration;
import dev.zernio.auth.*;
import dev.zernio.models.*;
import dev.zernio.api.AnalyticsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://zernio.com/api");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
AnalyticsApi apiInstance = new AnalyticsApi(defaultClient);
String accountId = "accountId_example"; // String | The ID of the LinkedIn personal account
String aggregation = "TOTAL"; // String | TOTAL (default, lifetime totals) or DAILY (time series). MEMBERS_REACHED not available with DAILY.
LocalDate startDate = LocalDate.parse("2024-01-01"); // LocalDate | Start date (YYYY-MM-DD). If omitted, returns lifetime analytics.
LocalDate endDate = LocalDate.parse("2024-01-31"); // LocalDate | End date (YYYY-MM-DD, exclusive). Defaults to today if omitted.
String metrics = "IMPRESSION,REACTION,COMMENT"; // String | Comma-separated metrics: IMPRESSION, MEMBERS_REACHED, REACTION, COMMENT, RESHARE. Omit for all.
try {
ApiResponse<GetLinkedInAggregateAnalytics200Response> response = apiInstance.getLinkedInAggregateAnalyticsWithHttpInfo(accountId, aggregation, startDate, endDate, metrics);
System.out.println("Status code: " + response.getStatusCode());
System.out.println("Response headers: " + response.getHeaders());
System.out.println("Response body: " + response.getData());
} catch (ApiException e) {
System.err.println("Exception when calling AnalyticsApi#getLinkedInAggregateAnalytics");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
System.err.println("Reason: " + e.getResponseBody());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| accountId | String | The ID of the LinkedIn personal account | |
| aggregation | String | TOTAL (default, lifetime totals) or DAILY (time series). MEMBERS_REACHED not available with DAILY. | [optional] [default to TOTAL] [enum: TOTAL, DAILY] |
| startDate | LocalDate | Start date (YYYY-MM-DD). If omitted, returns lifetime analytics. | [optional] |
| endDate | LocalDate | End date (YYYY-MM-DD, exclusive). Defaults to today if omitted. | [optional] |
| metrics | String | Comma-separated metrics: IMPRESSION, MEMBERS_REACHED, REACTION, COMMENT, RESHARE. Omit for all. | [optional] |
ApiResponse<GetLinkedInAggregateAnalytics200Response>
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Aggregate analytics data | - |
| 400 | Invalid request | - |
| 401 | Unauthorized | - |
| 402 | Analytics add-on required | - |
| 403 | Missing required LinkedIn scope | - |
| 404 | Account not found | - |
GetLinkedInPostAnalytics200Response getLinkedInPostAnalytics(accountId, urn)
Get LinkedIn post stats
Returns analytics for a specific LinkedIn post by URN. Works for both personal and organization accounts.
// Import classes:
import dev.zernio.ApiClient;
import dev.zernio.ApiException;
import dev.zernio.Configuration;
import dev.zernio.auth.*;
import dev.zernio.models.*;
import dev.zernio.api.AnalyticsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://zernio.com/api");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
AnalyticsApi apiInstance = new AnalyticsApi(defaultClient);
String accountId = "accountId_example"; // String | The ID of the LinkedIn account
String urn = "urn:li:share:7123456789012345678"; // String | The LinkedIn post URN
try {
GetLinkedInPostAnalytics200Response result = apiInstance.getLinkedInPostAnalytics(accountId, urn);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AnalyticsApi#getLinkedInPostAnalytics");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| accountId | String | The ID of the LinkedIn account | |
| urn | String | The LinkedIn post URN |
GetLinkedInPostAnalytics200Response
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Post analytics data | - |
| 400 | Invalid request | - |
| 401 | Unauthorized | - |
| 402 | Analytics add-on required | - |
| 403 | Missing required LinkedIn scope | - |
| 404 | Account or post not found | - |
ApiResponse getLinkedInPostAnalytics getLinkedInPostAnalyticsWithHttpInfo(accountId, urn)
Get LinkedIn post stats
Returns analytics for a specific LinkedIn post by URN. Works for both personal and organization accounts.
// Import classes:
import dev.zernio.ApiClient;
import dev.zernio.ApiException;
import dev.zernio.ApiResponse;
import dev.zernio.Configuration;
import dev.zernio.auth.*;
import dev.zernio.models.*;
import dev.zernio.api.AnalyticsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://zernio.com/api");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
AnalyticsApi apiInstance = new AnalyticsApi(defaultClient);
String accountId = "accountId_example"; // String | The ID of the LinkedIn account
String urn = "urn:li:share:7123456789012345678"; // String | The LinkedIn post URN
try {
ApiResponse<GetLinkedInPostAnalytics200Response> response = apiInstance.getLinkedInPostAnalyticsWithHttpInfo(accountId, urn);
System.out.println("Status code: " + response.getStatusCode());
System.out.println("Response headers: " + response.getHeaders());
System.out.println("Response body: " + response.getData());
} catch (ApiException e) {
System.err.println("Exception when calling AnalyticsApi#getLinkedInPostAnalytics");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
System.err.println("Reason: " + e.getResponseBody());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| accountId | String | The ID of the LinkedIn account | |
| urn | String | The LinkedIn post URN |
ApiResponse<GetLinkedInPostAnalytics200Response>
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Post analytics data | - |
| 400 | Invalid request | - |
| 401 | Unauthorized | - |
| 402 | Analytics add-on required | - |
| 403 | Missing required LinkedIn scope | - |
| 404 | Account or post not found | - |
GetLinkedInPostReactions200Response getLinkedInPostReactions(accountId, urn, limit, cursor)
Get LinkedIn post reactions
Returns individual reactions for a specific LinkedIn post, including reactor profiles (name, headline/job title, profile picture, profile URL, reaction type). Only works for organization/company page accounts. LinkedIn restricts reaction data for personal profiles (r_member_social_feed is a closed permission).
// Import classes:
import dev.zernio.ApiClient;
import dev.zernio.ApiException;
import dev.zernio.Configuration;
import dev.zernio.auth.*;
import dev.zernio.models.*;
import dev.zernio.api.AnalyticsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://zernio.com/api");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
AnalyticsApi apiInstance = new AnalyticsApi(defaultClient);
String accountId = "accountId_example"; // String | The ID of the LinkedIn organization account
String urn = "urn:li:share:7123456789012345678"; // String | The LinkedIn post URN
Integer limit = 25; // Integer | Maximum number of reactions to return per page
String cursor = "cursor_example"; // String | Offset-based pagination start index
try {
GetLinkedInPostReactions200Response result = apiInstance.getLinkedInPostReactions(accountId, urn, limit, cursor);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AnalyticsApi#getLinkedInPostReactions");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| accountId | String | The ID of the LinkedIn organization account | |
| urn | String | The LinkedIn post URN | |
| limit | Integer | Maximum number of reactions to return per page | [optional] [default to 25] |
| cursor | String | Offset-based pagination start index | [optional] |
GetLinkedInPostReactions200Response
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Reactions with reactor profiles | - |
| 400 | Invalid request or platform limitation | - |
| 401 | Unauthorized | - |
| 402 | Analytics add-on required | - |
| 403 | Missing required LinkedIn scope | - |
| 404 | Account or post not found | - |
ApiResponse getLinkedInPostReactions getLinkedInPostReactionsWithHttpInfo(accountId, urn, limit, cursor)
Get LinkedIn post reactions
Returns individual reactions for a specific LinkedIn post, including reactor profiles (name, headline/job title, profile picture, profile URL, reaction type). Only works for organization/company page accounts. LinkedIn restricts reaction data for personal profiles (r_member_social_feed is a closed permission).
// Import classes:
import dev.zernio.ApiClient;
import dev.zernio.ApiException;
import dev.zernio.ApiResponse;
import dev.zernio.Configuration;
import dev.zernio.auth.*;
import dev.zernio.models.*;
import dev.zernio.api.AnalyticsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://zernio.com/api");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
AnalyticsApi apiInstance = new AnalyticsApi(defaultClient);
String accountId = "accountId_example"; // String | The ID of the LinkedIn organization account
String urn = "urn:li:share:7123456789012345678"; // String | The LinkedIn post URN
Integer limit = 25; // Integer | Maximum number of reactions to return per page
String cursor = "cursor_example"; // String | Offset-based pagination start index
try {
ApiResponse<GetLinkedInPostReactions200Response> response = apiInstance.getLinkedInPostReactionsWithHttpInfo(accountId, urn, limit, cursor);
System.out.println("Status code: " + response.getStatusCode());
System.out.println("Response headers: " + response.getHeaders());
System.out.println("Response body: " + response.getData());
} catch (ApiException e) {
System.err.println("Exception when calling AnalyticsApi#getLinkedInPostReactions");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
System.err.println("Reason: " + e.getResponseBody());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| accountId | String | The ID of the LinkedIn organization account | |
| urn | String | The LinkedIn post URN | |
| limit | Integer | Maximum number of reactions to return per page | [optional] [default to 25] |
| cursor | String | Offset-based pagination start index | [optional] |
ApiResponse<GetLinkedInPostReactions200Response>
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Reactions with reactor profiles | - |
| 400 | Invalid request or platform limitation | - |
| 401 | Unauthorized | - |
| 402 | Analytics add-on required | - |
| 403 | Missing required LinkedIn scope | - |
| 404 | Account or post not found | - |
GetPostTimeline200Response getPostTimeline(postId, fromDate, toDate)
Get post analytics timeline
Returns a daily timeline of analytics metrics for a specific post, showing how impressions, likes, and other metrics evolved day-by-day since publishing. Each row represents one day of data per platform. For multi-platform Zernio posts, returns separate rows for each platform. Requires the Analytics add-on.
// Import classes:
import dev.zernio.ApiClient;
import dev.zernio.ApiException;
import dev.zernio.Configuration;
import dev.zernio.auth.*;
import dev.zernio.models.*;
import dev.zernio.api.AnalyticsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://zernio.com/api");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
AnalyticsApi apiInstance = new AnalyticsApi(defaultClient);
String postId = "postId_example"; // String | The post to fetch timeline for. Accepts an ExternalPost ID, a platformPostId, or a Zernio Post ID.
OffsetDateTime fromDate = OffsetDateTime.now(); // OffsetDateTime | Start of date range (ISO 8601). Defaults to 90 days ago.
OffsetDateTime toDate = OffsetDateTime.now(); // OffsetDateTime | End of date range (ISO 8601). Defaults to now.
try {
GetPostTimeline200Response result = apiInstance.getPostTimeline(postId, fromDate, toDate);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AnalyticsApi#getPostTimeline");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| postId | String | The post to fetch timeline for. Accepts an ExternalPost ID, a platformPostId, or a Zernio Post ID. | |
| fromDate | OffsetDateTime | Start of date range (ISO 8601). Defaults to 90 days ago. | [optional] |
| toDate | OffsetDateTime | End of date range (ISO 8601). Defaults to now. | [optional] |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Daily analytics timeline | - |
| 400 | Missing required postId parameter | - |
| 401 | Unauthorized | - |
| 402 | Analytics add-on required | - |
| 403 | Forbidden (post belongs to another user or API key scope violation) | - |
| 404 | Post not found | - |
ApiResponse getPostTimeline getPostTimelineWithHttpInfo(postId, fromDate, toDate)
Get post analytics timeline
Returns a daily timeline of analytics metrics for a specific post, showing how impressions, likes, and other metrics evolved day-by-day since publishing. Each row represents one day of data per platform. For multi-platform Zernio posts, returns separate rows for each platform. Requires the Analytics add-on.
// Import classes:
import dev.zernio.ApiClient;
import dev.zernio.ApiException;
import dev.zernio.ApiResponse;
import dev.zernio.Configuration;
import dev.zernio.auth.*;
import dev.zernio.models.*;
import dev.zernio.api.AnalyticsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://zernio.com/api");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
AnalyticsApi apiInstance = new AnalyticsApi(defaultClient);
String postId = "postId_example"; // String | The post to fetch timeline for. Accepts an ExternalPost ID, a platformPostId, or a Zernio Post ID.
OffsetDateTime fromDate = OffsetDateTime.now(); // OffsetDateTime | Start of date range (ISO 8601). Defaults to 90 days ago.
OffsetDateTime toDate = OffsetDateTime.now(); // OffsetDateTime | End of date range (ISO 8601). Defaults to now.
try {
ApiResponse<GetPostTimeline200Response> response = apiInstance.getPostTimelineWithHttpInfo(postId, fromDate, toDate);
System.out.println("Status code: " + response.getStatusCode());
System.out.println("Response headers: " + response.getHeaders());
System.out.println("Response body: " + response.getData());
} catch (ApiException e) {
System.err.println("Exception when calling AnalyticsApi#getPostTimeline");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
System.err.println("Reason: " + e.getResponseBody());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| postId | String | The post to fetch timeline for. Accepts an ExternalPost ID, a platformPostId, or a Zernio Post ID. | |
| fromDate | OffsetDateTime | Start of date range (ISO 8601). Defaults to 90 days ago. | [optional] |
| toDate | OffsetDateTime | End of date range (ISO 8601). Defaults to now. | [optional] |
ApiResponse<GetPostTimeline200Response>
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Daily analytics timeline | - |
| 400 | Missing required postId parameter | - |
| 401 | Unauthorized | - |
| 402 | Analytics add-on required | - |
| 403 | Forbidden (post belongs to another user or API key scope violation) | - |
| 404 | Post not found | - |
GetPostingFrequency200Response getPostingFrequency(platform, profileId, source)
Get posting frequency vs engagement
Returns the correlation between posting frequency (posts per week) and engagement rate, broken down by platform. Helps find the optimal posting cadence for each platform. Each row represents a specific (platform, posts_per_week) combination with the average engagement rate observed across all weeks matching that frequency. Requires the Analytics add-on.
// Import classes:
import dev.zernio.ApiClient;
import dev.zernio.ApiException;
import dev.zernio.Configuration;
import dev.zernio.auth.*;
import dev.zernio.models.*;
import dev.zernio.api.AnalyticsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://zernio.com/api");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
AnalyticsApi apiInstance = new AnalyticsApi(defaultClient);
String platform = "platform_example"; // String | Filter by platform (e.g. \"instagram\", \"tiktok\"). Omit for all platforms.
String profileId = "profileId_example"; // String | Filter by profile ID. Omit for all profiles.
String source = "all"; // String | Filter by post origin. \"late\" for posts published via Zernio, \"external\" for posts imported from platforms.
try {
GetPostingFrequency200Response result = apiInstance.getPostingFrequency(platform, profileId, source);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AnalyticsApi#getPostingFrequency");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| platform | String | Filter by platform (e.g. "instagram", "tiktok"). Omit for all platforms. | [optional] |
| profileId | String | Filter by profile ID. Omit for all profiles. | [optional] |
| source | String | Filter by post origin. "late" for posts published via Zernio, "external" for posts imported from platforms. | [optional] [default to all] [enum: all, late, external] |
GetPostingFrequency200Response
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Posting frequency data | - |
| 401 | Unauthorized | - |
| 403 | Analytics add-on required | - |
ApiResponse getPostingFrequency getPostingFrequencyWithHttpInfo(platform, profileId, source)
Get posting frequency vs engagement
Returns the correlation between posting frequency (posts per week) and engagement rate, broken down by platform. Helps find the optimal posting cadence for each platform. Each row represents a specific (platform, posts_per_week) combination with the average engagement rate observed across all weeks matching that frequency. Requires the Analytics add-on.
// Import classes:
import dev.zernio.ApiClient;
import dev.zernio.ApiException;
import dev.zernio.ApiResponse;
import dev.zernio.Configuration;
import dev.zernio.auth.*;
import dev.zernio.models.*;
import dev.zernio.api.AnalyticsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://zernio.com/api");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
AnalyticsApi apiInstance = new AnalyticsApi(defaultClient);
String platform = "platform_example"; // String | Filter by platform (e.g. \"instagram\", \"tiktok\"). Omit for all platforms.
String profileId = "profileId_example"; // String | Filter by profile ID. Omit for all profiles.
String source = "all"; // String | Filter by post origin. \"late\" for posts published via Zernio, \"external\" for posts imported from platforms.
try {
ApiResponse<GetPostingFrequency200Response> response = apiInstance.getPostingFrequencyWithHttpInfo(platform, profileId, source);
System.out.println("Status code: " + response.getStatusCode());
System.out.println("Response headers: " + response.getHeaders());
System.out.println("Response body: " + response.getData());
} catch (ApiException e) {
System.err.println("Exception when calling AnalyticsApi#getPostingFrequency");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
System.err.println("Reason: " + e.getResponseBody());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| platform | String | Filter by platform (e.g. "instagram", "tiktok"). Omit for all platforms. | [optional] |
| profileId | String | Filter by profile ID. Omit for all profiles. | [optional] |
| source | String | Filter by post origin. "late" for posts published via Zernio, "external" for posts imported from platforms. | [optional] [default to all] [enum: all, late, external] |
ApiResponse<GetPostingFrequency200Response>
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Posting frequency data | - |
| 401 | Unauthorized | - |
| 403 | Analytics add-on required | - |
YouTubeDailyViewsResponse getYouTubeDailyViews(videoId, accountId, startDate, endDate)
Get YouTube daily views
Returns daily view counts for a YouTube video including views, watch time, and subscriber changes. Requires yt-analytics.readonly scope (re-authorization may be needed). Data has a 2-3 day delay. Max 90 days, defaults to last 30 days.
// Import classes:
import dev.zernio.ApiClient;
import dev.zernio.ApiException;
import dev.zernio.Configuration;
import dev.zernio.auth.*;
import dev.zernio.models.*;
import dev.zernio.api.AnalyticsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://zernio.com/api");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
AnalyticsApi apiInstance = new AnalyticsApi(defaultClient);
String videoId = "videoId_example"; // String | The YouTube video ID (e.g., \"dQw4w9WgXcQ\")
String accountId = "accountId_example"; // String | The Zernio account ID for the YouTube account
LocalDate startDate = LocalDate.now(); // LocalDate | Start date (YYYY-MM-DD). Defaults to 30 days ago.
LocalDate endDate = LocalDate.now(); // LocalDate | End date (YYYY-MM-DD). Defaults to 3 days ago (YouTube data latency).
try {
YouTubeDailyViewsResponse result = apiInstance.getYouTubeDailyViews(videoId, accountId, startDate, endDate);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AnalyticsApi#getYouTubeDailyViews");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| videoId | String | The YouTube video ID (e.g., "dQw4w9WgXcQ") | |
| accountId | String | The Zernio account ID for the YouTube account | |
| startDate | LocalDate | Start date (YYYY-MM-DD). Defaults to 30 days ago. | [optional] |
| endDate | LocalDate | End date (YYYY-MM-DD). Defaults to 3 days ago (YouTube data latency). | [optional] |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Daily views breakdown | - |
| 400 | Bad request (missing or invalid parameters) | - |
| 401 | Unauthorized | - |
| 402 | Analytics add-on required | - |
| 403 | Access denied to this account | - |
| 412 | Missing YouTube Analytics scope | - |
| 500 | Internal server error | - |
ApiResponse getYouTubeDailyViews getYouTubeDailyViewsWithHttpInfo(videoId, accountId, startDate, endDate)
Get YouTube daily views
Returns daily view counts for a YouTube video including views, watch time, and subscriber changes. Requires yt-analytics.readonly scope (re-authorization may be needed). Data has a 2-3 day delay. Max 90 days, defaults to last 30 days.
// Import classes:
import dev.zernio.ApiClient;
import dev.zernio.ApiException;
import dev.zernio.ApiResponse;
import dev.zernio.Configuration;
import dev.zernio.auth.*;
import dev.zernio.models.*;
import dev.zernio.api.AnalyticsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://zernio.com/api");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
AnalyticsApi apiInstance = new AnalyticsApi(defaultClient);
String videoId = "videoId_example"; // String | The YouTube video ID (e.g., \"dQw4w9WgXcQ\")
String accountId = "accountId_example"; // String | The Zernio account ID for the YouTube account
LocalDate startDate = LocalDate.now(); // LocalDate | Start date (YYYY-MM-DD). Defaults to 30 days ago.
LocalDate endDate = LocalDate.now(); // LocalDate | End date (YYYY-MM-DD). Defaults to 3 days ago (YouTube data latency).
try {
ApiResponse<YouTubeDailyViewsResponse> response = apiInstance.getYouTubeDailyViewsWithHttpInfo(videoId, accountId, startDate, endDate);
System.out.println("Status code: " + response.getStatusCode());
System.out.println("Response headers: " + response.getHeaders());
System.out.println("Response body: " + response.getData());
} catch (ApiException e) {
System.err.println("Exception when calling AnalyticsApi#getYouTubeDailyViews");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
System.err.println("Reason: " + e.getResponseBody());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| videoId | String | The YouTube video ID (e.g., "dQw4w9WgXcQ") | |
| accountId | String | The Zernio account ID for the YouTube account | |
| startDate | LocalDate | Start date (YYYY-MM-DD). Defaults to 30 days ago. | [optional] |
| endDate | LocalDate | End date (YYYY-MM-DD). Defaults to 3 days ago (YouTube data latency). | [optional] |
ApiResponse<YouTubeDailyViewsResponse>
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Daily views breakdown | - |
| 400 | Bad request (missing or invalid parameters) | - |
| 401 | Unauthorized | - |
| 402 | Analytics add-on required | - |
| 403 | Access denied to this account | - |
| 412 | Missing YouTube Analytics scope | - |
| 500 | Internal server error | - |