Skip to main content

Scenario

Your Company Page publishes 10–20 posts per month, but nobody analyzes which topics and formats actually work. This job pulls recent company posts along with their engagement metrics (likes, comments, shares), ranks them by total engagement, identifies thematic patterns across top performers, then asks Mave to explain what the winners have in common and generate 10 new content concepts that follow those patterns. You get a data-backed content calendar instead of brainstorming in a vacuum.

Architecture

Code

Example Output

Error Handling

The GET /posts and GET /socialActions endpoints require the Community Management API product. Without approval, calls return 403.
Post URNs can be urn:li:share:{id} or urn:li:ugcPost:{id} depending on creation method. The socialActions endpoint accepts both formats.
The code weights comments at 3x and shares at 5x vs. likes at 1x. Adjust these multipliers based on your funnel — if shares drive traffic, weight higher.
Fetching engagement per post can burn rate limits fast on 50+ posts. The 400ms delay prevents throttling. For larger volumes, cache engagement data daily.

LinkedIn Content Integration

Mave Agent