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

# Company Posts

> Get LinkedIn company posts by company URL, ID, or universal name.

## Get posts from a LinkedIn company

<CodeGroup>
  ```javascript JavaScript theme={null}
  const params = new URLSearchParams({
    company: 'https://www.linkedin.com/company/google',
    page: '1',
  });
  fetch(`https://api.harvestapi.io/linkedin/company-posts?${params.toString()}`, {
    headers: { 'X-API-Key': '<api-key>' },
  })
    .then((response) => response.json())
    .then((data) => console.log(data));
  ```

  ```bash cURL theme={null}
  curl --request GET \
    --url https://api.harvestapi.io/linkedin/company-posts?companyUniversalName=williamhgates&page=1 \
    --header 'X-API-Key: <api-key>'
  ```

  ```python Python theme={null}
  import requests

  url = "https://api.harvestapi.io/linkedin/company-posts?companyUniversalName=williamhgates&page=1"

  headers = {"X-API-Key": "<api-key>"}

  response = requests.request("GET", url, headers=headers)

  print(response.text)
  ```
</CodeGroup>


## OpenAPI

````yaml GET /linkedin/company-posts
openapi: 3.0.1
info:
  title: HarvestAPI LinkedIn API reference
  description: HarvestAPI LinkedIn API reference
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.harvestapi.io
security:
  - ApiKeyAuthHeader: []
paths:
  /linkedin/company-posts:
    get:
      summary: Get LinkedIn company posts
      description: Get LinkedIn company posts by company URL, ID, or universal name.
      parameters:
        - name: company
          in: query
          description: Filter posts by this company URL
          schema:
            type: string
        - name: companyId
          in: query
          description: Filter posts by company ID. It's faster to search by ID
          schema:
            type: string
        - name: companyUniversalName
          in: query
          description: Filter posts by company universal name (last part in the URL)
          schema:
            type: string
        - name: postedLimit
          in: query
          description: >-
            Filter posts by maximum posted date. Supported values: '24h',
            'week', 'month'. 

            Since LinkedIn doesn't offer a way to filter by date, the filtering
            will be done on our side, due to that the pagination might have
            incorrect values, because pagination is returned by LinkedIn without
            applying the postedLimit filter
          schema:
            type: string
        - name: scrapePostedLimit
          in: query
          description: >-
            Post-Filter posts by maximum posted date. Supported values: '1h',
            '24h', 'week','month', '3months', '6months', 'year'. This parameter
            will be applied after receiving results from LinkedIn, the filtering
            will be done on our side
          schema:
            type: string
        - name: page
          in: query
          description: Page number for pagination
          schema:
            type: integer
            default: 1
        - name: paginationToken
          in: query
          description: >-
            Required if it was returned by the previous page. Otherwise the page
            will always be 1 (on LinkedIn side). Doesn't apply for all queries,
            usually profile posts return this token
          schema:
            type: string
            format: nullable
      responses:
        '200':
          description: Post search response
          content:
            application/json:
              schema:
                type: object
                properties:
                  elements:
                    type: array
                    items:
                      $ref: '#/components/schemas/PostShort'
                  pagination:
                    $ref: '#/components/schemas/Pagination'
                    type: object
                  status:
                    type: string
                  error:
                    type: string
                  query:
                    type: object
                    properties:
                      search:
                        type: string
                      profileId:
                        type: string
                      companyId:
                        type: string
                      postedLimit:
                        type: string
                      sortBy:
                        type: string
                      page:
                        type: integer
        '400':
          description: Invalid request parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    PostShort:
      required:
        - id
      type: object
      properties:
        id:
          type: string
        content:
          type: string
        linkedinUrl:
          type: string
        author:
          type: object
          properties:
            id:
              type: string
            urn:
              type: string
            publicIdentifier:
              type: string
            universalName:
              type: string
            name:
              type: string
            linkedinUrl:
              type: string
            type:
              type: boolean
            info:
              type: boolean
            website:
              type: boolean
            websiteLabel:
              type: boolean
            avatar:
              type: object
              properties:
                url:
                  type: string
                width:
                  type: integer
                  format: int32
                height:
                  type: integer
                  format: int32
                expiresAt:
                  type: integer
                  format: int64
        postedAt:
          type: object
          properties:
            timestamp:
              type: integer
            date:
              type: string
            postedAgoShort:
              type: string
            postedAgoText:
              type: string
        postImages:
          type: array
          items:
            type: object
            properties:
              url:
                type: string
              width:
                type: integer
                format: int32
              height:
                type: integer
                format: int32
              expiresAt:
                type: integer
                format: int64
        postVideo:
          type: object
          properties:
            thumbnailUrl:
              type: string
            videoUrl:
              type: string
        article:
          type: object
          properties:
            title:
              type: string
            subtitle:
              type: string
            link:
              type: string
            linkLabel:
              type: string
            description:
              type: string
            image:
              type: object
              properties:
                url:
                  type: string
                width:
                  type: integer
                  format: int32
                height:
                  type: integer
                  format: int32
                expiresAt:
                  type: integer
                  format: int64
        repostId:
          type: string
          format: nullable
        repost:
          type: object
        repostedBy:
          type: object
          properties:
            publicIdentifier:
              type: string
            name:
              type: string
            linkedinUrl:
              type: string
        newsletterUrl:
          type: string
        newsletterTitle:
          type: string
        socialContent:
          type: object
          properties:
            hideCommentsCount:
              type: boolean
            hideReactionsCount:
              type: boolean
            hideSocialActivityCounts:
              type: boolean
            hideShareAction:
              type: boolean
            hideSendAction:
              type: boolean
            hideRepostsCount:
              type: boolean
            hideViewsCount:
              type: boolean
            hideReactAction:
              type: boolean
            hideCommentAction:
              type: boolean
            shareUrl:
              type: string
            showContributionExperience:
              type: boolean
            showSocialDetail:
              type: boolean
        engagement:
          type: object
          properties:
            likes:
              type: integer
              format: int32
            comments:
              type: integer
              format: int32
            shares:
              type: integer
              format: int32
            reactions:
              type: array
              items:
                type: object
                properties:
                  type:
                    type: string
                  count:
                    type: integer
                    format: int32
    Pagination:
      type: object
      properties:
        totalPages:
          type: integer
          format: int32
        totalElements:
          type: integer
          format: int32
        pageNumber:
          type: integer
          format: int32
        previousElements:
          type: integer
          format: int32
        pageSize:
          type: integer
          format: int32
        paginationToken:
          type: string
          format: nullable
    Error:
      required:
        - error
        - message
      type: object
      properties:
        error:
          type: integer
          format: int32
        message:
          type: string
  securitySchemes:
    ApiKeyAuthHeader:
      type: apiKey
      in: header
      name: X-API-Key

````