> ## 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.

# Group posts

> Search LinkedIn posts by keywords, author, date range, and more.

<CodeGroup>
  ```javascript JavaScript theme={null}
  const params = new URLSearchParams({
    group: 'https://www.linkedin.com/groups/1898033/',
    // group: '1898033', // Or group ID alternatively
    page: '1',
  });
  fetch(`https://api.harvestapi.io/linkedin/post-search?${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/post-search?group=1898033&page=1 \
    --header 'X-API-Key: <api-key>'
  ```

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

  url = "https://api.harvestapi.io/linkedin/post-search?group=1898033&page=1"

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

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

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


## OpenAPI

````yaml GET /linkedin/post-search
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/post-search:
    get:
      summary: Search LinkedIn posts
      description: Search LinkedIn posts by keywords, author, date range, and more.
      parameters:
        - name: search
          in: query
          description: Keywords to search for in posts
          schema:
            type: string
        - name: profile
          in: query
          description: >-
            Filter posts by author's profile URL (comma-separated). Note:
            LinkedIn returns fewer results per profile when using post search.
            To extract all posts by a profile, use the /linkedin/profile-posts
            endpoint
          schema:
            type: string
        - name: profileId
          in: query
          description: >-
            Filter posts by author's profile ID or IDs (comma-separated). It's
            faster to search by ID. Note: LinkedIn returns fewer results per
            profile when using post search. To extract all posts by a profile,
            use the /linkedin/profile-posts endpoint
          schema:
            type: string
        - name: company
          in: query
          description: >-
            Filter posts by this company URL or URLs (comma-separated). Note:
            LinkedIn returns fewer results per company when using post search.
            To extract all posts by a company, use the /linkedin/company-posts
            endpoint
          schema:
            type: string
        - name: companyId
          in: query
          description: >-
            Filter posts by company ID or IDs (comma-separated). It's faster to
            search by ID. Note: LinkedIn returns fewer results per company when
            using post search. To extract all posts by a company, use the
            /linkedin/company-posts endpoint
          schema:
            type: string
        - name: authorsCompany
          in: query
          description: >-
            List of LinkedIn companies where authors of posts work
            (comma-separated). It supports company URLs and IDs.
          schema:
            type: string
        - name: authorsIndustryId
          in: query
          description: >-
            List of LinkedIn industry IDs of authors' companies
            (comma-separated). It supports industry IDs. Full list of industry
            IDs:
            https://github.com/HarvestAPI/linkedin-industry-codes-v2/blob/main/linkedin_industry_code_v2_all_eng.csv
          schema:
            type: string
        - name: mentioningMember
          in: query
          description: >-
            Filter posts mentioning this LinkedIn profile URL or ID
            (comma-separated). It supports profile URLs and IDs.
          schema:
            type: string
        - name: mentioningCompany
          in: query
          description: >-
            Filter posts mentioning this LinkedIn company URL or ID
            (comma-separated). It supports company URLs and IDs.
          schema:
            type: string
        - name: contentType
          in: query
          description: >-
            Filter by content type. Supported values: 'videos', 'images',
            'live_videos', 'documents', 'collaborative_articles', 'jobs'
          schema:
            type: string
        - name: authorKeywords
          in: query
          description: Filter by keywords in authors' profiles
          schema:
            type: string
        - name: group
          in: query
          description: Group LinkedIn URL or Group ID
          schema:
            type: string
        - name: postedLimit
          in: query
          description: >-
            Filter posts by maximum posted date. Supported values: '24h',
            'week', 'month'. This parameter will be sent to LinkedIn, the
            filtering will be done on their side
          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: sortBy
          in: query
          description: 'Sort by field. Supported values: ''relevance'', ''date'''
          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

````