APILinkedIn Analytics
Get creator analytics
Retrieve LinkedIn creator analytics for the authenticated account. Includes engagement metrics, content performance, audience insights, and growth trends. Supports various time ranges and metric filters.
POST
/analytics/creatorAuthentication requiredAnalytics
Code Examples
curl -X POST 'https://api.connectsafely.ai/linkedin/analytics/creator' \ -H 'Authorization: Bearer <your_api_key>' \ -H 'Content-Type: application/json' \ -d '{"accountId":"acc_12345","filters":{"resultType":null,"timeRange":null,"lineChartType":null,"metricType":null,"startDate":"2024-01-15","endDate":"2024-01-15"}}'Parameters
No parameters.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
accountId | string | No | LinkedIn account ID to use. If not provided, uses the default account. |
filters | object | No | Analytics filters |
Example
{
"accountId": "acc_12345",
"filters": {
"resultType": null,
"timeRange": null,
"lineChartType": null,
"metricType": null,
"startDate": "2024-01-15",
"endDate": "2024-01-15"
}
}Responses
| Status | Description |
|---|---|
| 200 | Creator analytics retrieved successfully |
| 400 | Bad Request - Invalid filters or missing required fields |
| 401 | Unauthorized - Invalid or missing API key |
| 500 | Internal Server Error - Failed to get LinkedIn credentials or analytics |
200 Response Parameters
| Name | Type | Description |
|---|---|---|
success | boolean | |
accountId | string | LinkedIn account ID used |
profileId | string | LinkedIn profile URN |
isLineChart | boolean | Whether line chart data was requested |
filters | object | Filters applied to the request |
data | object | Simplified analytics data |
200 Example
{
"success": true,
"accountId": "696ce9e780e0483585e4e553",
"profileId": "ACoAAATPlQ0Bc8wdg-Iy8wZgEDuSdIVWJiE1Aio",
"isLineChart": false,
"filters": {
"resultType": "ENGAGEMENT",
"timeRange": "past_7_days"
},
"data": {
"summary": {
"metrics": [
{
"title": "Total followers",
"value": "12,841",
"change": 1,
"changeDescription": "vs. prior 7 days",
"description": "The total number of people that currently follow you."
}
]
},
"chart": {
"title": "New followers",
"xValueUnit": "day",
"yValueUnit": "New followers",
"points": [
{
"date": "Feb 18",
"value": 9,
"tooltip": "Wednesday, Feb 18, 2026",
"change": null
},
{
"date": "Feb 19",
"value": 16,
"tooltip": "Thursday, Feb 19, 2026",
"change": 77.8
},
{
"date": "Feb 20",
"value": 25,
"tooltip": "Friday, Feb 20, 2026",
"change": 56.3
}
]
}
}
}400 Response Parameters
| Name | Type | Description |
|---|---|---|
success | boolean | |
error | object |
400 Example
{
"success": false,
"error": {
"issues": [
{
"code": "custom",
"message": "startDate and endDate are required when timeRange is \"custom\"",
"path": [
"filters",
"startDate"
]
}
],
"name": "ZodError"
}
}401 Response Parameters
| Name | Type | Description |
|---|---|---|
error | string |
401 Example
{
"error": "Unauthorized - Invalid credentials"
}500 Response Parameters
| Name | Type | Description |
|---|---|---|
error | string |
500 Example
{
"error": "Failed to get creator analytics",
"success": false
}LinkedIn Analytics API
Access LinkedIn analytics via API including profile visitors, creator analytics, engagement metrics, and weekly performance data. Track your content strategy results.
Get weekly engagement data
Retrieve weekly engagement statistics for email reports. Returns comment and reaction counts broken down by day for the past 7 days, along with summary statistics and analytics data. Useful for automated weekly reports.
