> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pipecorn.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Extract posts from a LinkedIn profile or company page

> Returns up to the specified limit of posts for a LinkedIn person profile or company page. The URL is detected automatically: company page URLs use the organization feed; profile URLs use the member profile feed. Results can be narrowed with `posted_within`.

## Use Cases

* Monitor content published by key prospects, customers, or their companies
* Track thought leadership from individuals and brand pages
* Analyze posting patterns and content strategy
* Extract posts for further analysis or engagement tracking

## Parameters

### Required

* `linkedin_url`: LinkedIn profile URL (e.g. `https://www.linkedin.com/in/...`) or company page URL (e.g. `https://www.linkedin.com/company/...`)
* `limit`: Maximum number of posts to return (minimum: 1)

### Optional

* `posted_within`: `last_24_hours`, `last_7_days`, or `last_30_days`. Omit to return posts without this recency filter. Any other value returns `400`.

The Pipecorn account used for the request must have valid LinkedIn credentials connected.

## Response

The response is a JSON object with a `posts` array. Each post may include:

* `author`: Post author name
* `author_url`: LinkedIn URL of the author (profile or company)
* `content`: Post text content
* `id`: Post ID
* `urn`: LinkedIn URN for the post
* `base_url`: Base post URL
* `post_url`: Full post URL
* `published_at`: Date when the post was published (YYYY-MM-DD format)
* `engagement_count`: Total engagement on the post (reactions + comments)
* `reactions_count`: Number of reactions on the post
* `comments_count`: Number of comments on the post

If the company ID or profile cannot be resolved from the URL, the API returns `200` with an empty `posts` array.

## Example Request

```bash theme={null}
curl --request POST \
  --url https://app.pipecorn.com/api/v2/intents/leads/posts \
  --header 'Content-Type: application/json' \
  --header 'X-API-KEY: your-api-key' \
  --data '{
    "linkedin_url": "https://www.linkedin.com/in/profile",
    "limit": 5,
    "posted_within": "last_7_days"
  }'
```

For a company page, use the same field with the company URL, for example `"linkedin_url": "https://www.linkedin.com/company/example"`.

## Example Response

```json theme={null}
{
  "posts": [
    {
      "author": "Author Name",
      "author_url": "https://www.linkedin.com/in/author-profile",
      "content": "Post content text...",
      "id": "1234567890",
      "urn": "urn:li:activity:1234567890",
      "base_url": "https://www.linkedin.com/feed/update/...",
      "post_url": "https://www.linkedin.com/posts/...",
      "published_at": "2026-01-15",
      "engagement_count": 142,
      "reactions_count": 128,
      "comments_count": 14
    }
  ]
}
```

## Errors (400)

* Missing `limit`: `Missing required keys: limit`
* Missing `linkedin_url`: `Missing required keys: linkedin_url`
* Invalid `posted_within`: `Invalid posted_within. Use last_24_hours, last_7_days, last_30_days, or omit the key.`

## Notes

* Synchronous response (`200 OK`) with `{ "posts": [...] }`
* Recency filtering is applied after posts are fetched from LinkedIn


## OpenAPI

````yaml POST /intents/leads/posts
openapi: 3.0.1
info:
  title: Pipecorn Accounts API
  description: Pipecorn Accounts API
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://app.pipecorn.com/api/v2/
security:
  - defaultApiKey: []
paths:
  /intents/leads/posts:
    post:
      summary: Extract posts from a LinkedIn profile or company page
      description: >-
        Returns up to the specified limit of posts for a LinkedIn person profile
        or company page. The URL is detected automatically: company page URLs
        use the organization feed; profile URLs use the member profile feed.
        Results can be narrowed with `posted_within`.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - linkedin_url
                - limit
              properties:
                linkedin_url:
                  type: string
                  format: uri
                  description: >-
                    LinkedIn profile URL (e.g. `/in/...`) or company page URL
                    (e.g. `/company/...`)
                  example: https://www.linkedin.com/in/john-doe
                limit:
                  type: integer
                  description: Maximum number of posts to return
                  minimum: 1
                  example: 5
                posted_within:
                  type: string
                  enum:
                    - last_24_hours
                    - last_7_days
                    - last_30_days
                  description: >-
                    Only include posts published within this window. Omit for no
                    recency filter.
      responses:
        '200':
          description: Successfully extracted posts
          content:
            application/json:
              schema:
                type: object
                properties:
                  posts:
                    type: array
                    items:
                      type: object
                      properties:
                        author:
                          type: string
                          description: Post author name
                          example: Jane Smith
                        author_url:
                          type: string
                          format: uri
                          description: LinkedIn profile URL of the post author
                          example: https://www.linkedin.com/in/jane-smith
                        content:
                          type: string
                          description: Post text content
                          example: Post content text...
                        id:
                          type: string
                          description: Post ID
                          example: '1234567890123456789'
                        urn:
                          type: string
                          description: LinkedIn URN for the post
                          example: urn:li:activity:1234567890123456789
                        base_url:
                          type: string
                          format: uri
                          description: Base post URL
                          example: >-
                            https://www.linkedin.com/feed/update/urn:li:activity:1234567890123456789
                        post_url:
                          type: string
                          format: uri
                          description: Full post URL
                          example: >-
                            https://www.linkedin.com/posts/jane-smith_post-title-activity-1234567890123456789-abcd
                        published_at:
                          type: string
                          format: date
                          description: Date when the post was published (YYYY-MM-DD)
                          example: '2026-03-11'
                        engagement_count:
                          type: integer
                          description: Total engagement on the post (reactions + comments)
                          example: 142
                        reactions_count:
                          type: integer
                          description: Number of reactions on the post
                          example: 128
                        comments_count:
                          type: integer
                          description: Number of comments on the post
                          example: 14
                    description: >-
                      Posts from the profile or company page, after optional
                      recency filtering
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                missing_limit:
                  value:
                    error: 400
                    message: 'Missing required keys: limit'
                missing_linkedin_url:
                  value:
                    error: 400
                    message: 'Missing required keys: linkedin_url'
                invalid_posted_within:
                  value:
                    error: 400
                    message: >-
                      Invalid posted_within. Use last_24_hours, last_7_days,
                      last_30_days, or omit the key.
        '404':
          description: LinkedIn profile or company not resolved
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: integer
                    format: int32
                    example: 404
                  message:
                    type: string
                    example: LinkedIn profile not found
components:
  schemas:
    Error:
      type: object
      properties:
        error:
          type: integer
          format: int32
        message:
          type: string
  securitySchemes:
    defaultApiKey:
      type: apiKey
      in: header
      name: X-API-KEY

````