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

# Search Groups

> Retrieve a list of LinkedIn Groups matching the specified search criteria.

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

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

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

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

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

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


## OpenAPI

````yaml GET /linkedin/group-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/group-search:
    get:
      summary: Search LinkedIn Groups
      description: >-
        Retrieve a list of LinkedIn Groups matching the specified search
        criteria.
      parameters:
        - name: search
          in: query
          description: Keywords to search for.
          schema:
            type: string
        - name: page
          in: query
          description: Page number for pagination.
          schema:
            type: integer
            default: 1
      responses:
        '200':
          description: A list of groups matching the search criteria.
          content:
            application/json:
              schema:
                type: object
                properties:
                  elements:
                    type: array
                    items:
                      $ref: '#/components/schemas/GroupShort'
                  pagination:
                    $ref: '#/components/schemas/Pagination'
                    type: object
                  status:
                    type: string
                    description: Status of the response.
                  error:
                    type: string
                    description: Error message, if any.
                  query:
                    type: object
                    properties:
                      search:
                        type: string
        '400':
          description: Invalid request parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized access.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    GroupShort:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the LinkedIn group.
        linkedinUrl:
          type: string
          format: url
          nullable: true
          description: URL of the LinkedIn group.
        name:
          type: string
          nullable: true
          description: Name of the LinkedIn group.
        members:
          type: string
          nullable: true
          description: Text representation of the member count (e.g., '10,000+ members').
        summary:
          type: string
          nullable: true
          description: Short summary or description of the group.
        picture:
          type: string
          format: url
          nullable: true
          description: URL of the group's profile picture.
        primaryActions:
          type: array
          nullable: true
          items:
            type: object
            properties:
              label:
                type: string
                nullable: true
                description: Label for the action (e.g., 'Join', 'View').
              value:
                type: string
                nullable: true
                description: Value associated with the action (e.g., a URL or action ID).
          description: List of primary actions related to the group.
      required:
        - id
    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

````