Skip to main content
POST
/
v1
/
post
/
by-url
curl -X POST "https://api.trigify.io/v1/post/by-url" \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{
    "postUrl": "https://linkedin.com/posts/username_activity-1234567890123456789-abcd"
  }'
{
  "message": "<string>",
  "success": true,
  "data": {
    "urn": "<string>",
    "text": "<string>",
    "postUrl": "<string>",
    "postedAt": "<string>",
    "postedDate": "<string>",
    "postedDateTimestamp": 123,
    "likeCount": 1,
    "commentsCount": 1,
    "repostsCount": 1,
    "appreciationCount": 1,
    "empathyCount": 1,
    "funnyCount": 1,
    "interestCount": 1,
    "praiseCount": 1,
    "reposted": true,
    "author": {
      "firstName": "<string>",
      "lastName": "<string>",
      "headline": "<string>",
      "profilePictures": [
        {
          "url": "<string>"
        }
      ],
      "url": "<string>",
      "username": "<string>"
    },
    "company": {
      "name": "<string>",
      "linkedinUrl": "<string>",
      "logo": "<string>"
    }
  }
}
Enrich any LinkedIn post by providing its URL to get comprehensive post data including engagement metrics, author information, and content details.

Overview

The Get Post by URL endpoint allows you to fetch detailed information about any LinkedIn post by simply providing its URL. This endpoint wraps the LinkedIn service’s refreshPost method to provide fresh, up-to-date post data including engagement metrics, author details, and post content.

Authentication

Requires a valid API key with the track:post:engagements permission.
curl -X POST "https://api.trigify.io/v1/post/by-url" \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{
    "postUrl": "https://linkedin.com/posts/username_activity-1234567890123456789-abcd"
  }'

Response Structure

The endpoint returns comprehensive post data including:

Post Information

  • Content: Full text content of the post
  • URLs: LinkedIn post URL and any shared links
  • Timestamps: Multiple time formats including relative time and exact timestamps
  • URN: LinkedIn’s unique identifier for the post

Author Details

  • Profile Information: Name, headline, LinkedIn profile details
  • Professional Data: Current role and company information
  • Profile Pictures: Multiple sizes of profile images
  • LinkedIn URN: Author’s unique LinkedIn identifier

Engagement Metrics

  • Like Count: Number of likes on the post
  • Comment Count: Number of comments on the post
  • Repost Count: Number of times the post has been shared
  • Reaction Breakdown: Detailed counts by reaction type (appreciation, praise, etc.)

Media Content

  • Images: URLs and metadata for any images in the post
  • Videos: Video URLs, posters, and duration information
  • Documents: Document attachments with download links
  • Articles: Shared article links and metadata

Company Mentions

  • Company Data: Any companies mentioned or tagged in the post
  • Logo URLs: Company logos where available

Credit Usage

This endpoint charges 1 credit per successful post enrichment. The number of credits spent is returned in the x-spent-credits response header. Examples:
  • Successful post retrieval: Uses 1 credit
  • Post not found (404): Uses 0 credits
  • Invalid URL format (400): Uses 0 credits
  • Service error (500): Uses 0 credits

Use Cases

  • Content Analysis: Analyze the performance and engagement of specific posts
  • Competitive Research: Monitor competitor posts and their engagement metrics
  • Social Listening: Track specific posts related to your brand or industry
  • Lead Generation: Identify high-performing posts to understand what resonates with audiences
  • Content Strategy: Research successful content formats and topics
  • Influencer Monitoring: Track posts from industry thought leaders and influencers
  • Campaign Tracking: Monitor the performance of your own content

URL Formats

The postUrl parameter accepts multiple post URL formats:

Standard Post URLs

  • "https://linkedin.com/posts/username_activity-1234567890123456789-abcd"
  • "https://www.linkedin.com/posts/username_activity-1234567890123456789-abcd"

Feed Update URLs

  • "https://linkedin.com/feed/update/urn:li:activity:1234567890123456789/"
  • "https://www.linkedin.com/feed/update/urn:li:activity:1234567890123456789/"

Company Post URLs

  • "https://linkedin.com/posts/company_activity-1234567890123456789-abcd"
All URL formats will be validated to ensure they’re proper LinkedIn post URLs before processing.

Error Handling

The endpoint provides detailed error responses for various scenarios:

Common Error Cases

  • Invalid URL Format: Returns 400 if the URL is not a valid LinkedIn post URL
  • Post Not Found: Returns 404 if the post doesn’t exist or is not accessible
  • Permission Denied: Returns 403 if you don’t have the required permissions
  • Rate Limited: Returns 429 if you’ve exceeded API rate limits

Integration Examples

Webhook Integration

Use this endpoint to enrich post URLs received from webhooks:
// Process webhook with post URL
app.post('/webhook', async (req, res) => {
  const { postUrl } = req.body;
  
  // Enrich the post data
  const enrichedPost = await fetch('/v1/post/by-url', {
    method: 'POST',
    headers: { 
      'Content-Type': 'application/json',
      'x-api-key': API_KEY 
    },
    body: JSON.stringify({ postUrl })
  }).then(r => r.json());
  
  // Process the enriched data
  await processPostData(enrichedPost.data);
});

Batch Processing

Process multiple post URLs efficiently:
async def enrich_posts(post_urls):
    enriched_posts = []
    for url in post_urls:
        response = requests.get(
            f"{API_BASE}/post/by-url",
            headers={"x-api-key": API_KEY},
            params={"url": url},
            timeout=30,
        )
        if response.ok:
            body = response.json()
            if body.get("success"):
                enriched_posts.append(body["data"])
    return enriched_posts
        )
        
        if response.json()["success"]:
            enriched_posts.append(response.json()["data"])
            
    return enriched_posts
This endpoint provides a powerful way to transform post URLs into rich, structured data for analysis, monitoring, and integration into your applications.

Headers

x-api-key
string
required

Body

application/json
postUrl
string
required

LinkedIn post URL to fetch

Response

Successfully retrieved LinkedIn post

message
string
required
success
boolean
required
data
object
required