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

> Get the suggestions LinkedIn's search bar gives for a text: companies, schools, members and suggested searches, usually up to 8, in LinkedIn's order, with names in lower case. With `type`, the suggestions of companies, schools or profiles only: 100 a page, up to 20 pages, with names as written.

Get the suggestions LinkedIn's search bar gives for a text: companies, schools, members and suggested searches,
usually up to 8, in LinkedIn's order. Names come in lower case, as LinkedIn suggests them. A suggested search has the
`type` `query` and only a `title`; its subtitle `in Jobs` marks a suggested job search. Pass a company's `id` to
[Get company](https://docs.harvestapi.io/linkedin-api-reference/company/get.md) or a member's to [Get profile](https://docs.harvestapi.io/linkedin-api-reference/profile/get.md)
for the full details.

Set `type` to `company`, `school` or `profile` for the suggestions of one type only: 100 a page, with names as
written, e.g. `?search=google&type=company&page=2`. Page through them with `page`, up to page 20 (2,000
suggestions); a page with fewer than 100 suggestions is the last, as LinkedIn gives no total. Profiles found this way
are linked by profile ID. Without `type` the suggestions come in one page.

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

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

url = "https://api.harvestapi.io/linkedin/typeahead-search?search=google"

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

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

print(response.text)
```


## OpenAPI

````yaml GET /linkedin/typeahead-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/typeahead-search:
    get:
      summary: Search LinkedIn typeahead
      description: >-
        Get the suggestions LinkedIn's search bar gives for a text: companies,
        schools, members and suggested searches, usually up to 8, in LinkedIn's
        order, with names in lower case. With `type`, the suggestions of
        companies, schools or profiles only: 100 a page, up to 20 pages, with
        names as written.
      parameters:
        - name: search
          in: query
          required: true
          description: The text typed into the search bar, up to 100 characters
          schema:
            type: string
        - name: type
          in: query
          description: >-
            Suggestions of one type only, 100 a page. Without it, the search
            bar's own suggestions: up to 8 of every type, suggested searches
            included, in one page
          schema:
            type: string
            enum:
              - company
              - school
              - profile
        - name: page
          in: query
          description: >-
            Page number of one type's suggestions, from 1 to 20; only 1 without
            `type`. A page with fewer than 100 suggestions is the last
          schema:
            type: integer
            default: 1
            minimum: 1
            maximum: 20
      responses:
        '200':
          description: The suggestions for the text, in LinkedIn's order
          content:
            application/json:
              schema:
                type: object
                properties:
                  elements:
                    type: array
                    items:
                      $ref: '#/components/schemas/TypeaheadSuggestion'
                  pagination:
                    $ref: '#/components/schemas/Pagination'
                    type: object
                    nullable: true
                    description: >-
                      With `type`: the page. LinkedIn gives no total, so
                      `totalElements` and `totalPages` are 0. Null without
                      `type`
                  status:
                    type: integer
                  error:
                    type: string
                  query:
                    type: object
                    properties:
                      search:
                        type: string
                      type:
                        type: string
                      page:
                        type: string
              example:
                elements:
                  - type: company
                    title: google
                    subtitle: Company • Software Development
                    id: '1441'
                    urn: urn:li:company:1441
                    linkedinUrl: https://www.linkedin.com/company/1441/
                    image: >-
                      https://media.licdn.com/dms/image/v2/D4E0BAQexample/company-logo_100_100/0/1759350753990/google_logo
                  - type: query
                    title: google
                    subtitle: in Jobs
                    id: null
                    urn: null
                    linkedinUrl: null
                    image: null
                  - type: query
                    title: google recruiter
                    subtitle: null
                    id: null
                    urn: null
                    linkedinUrl: null
                    image: null
                  - type: company
                    title: google deepmind
                    subtitle: Company • Research Services
                    id: '1594050'
                    urn: urn:li:company:1594050
                    linkedinUrl: https://www.linkedin.com/company/1594050/
                    image: >-
                      https://media.licdn.com/dms/image/v2/D4E0BAQexample/company-logo_200_200/0/1692960425188/googledeepmind_logo
                status: 200
                query:
                  search: google
        '400':
          description: >-
            `search` is missing, given more than once, or longer than 100
            characters; `type` is not `company`, `school` or `profile`; `page`
            is not 1 without `type`, or not from 1 to 20
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    TypeaheadSuggestion:
      type: object
      description: >-
        A suggestion of LinkedIn's search bar: an entity (a company, school or
        member) or a suggested search
      properties:
        type:
          type: string
          description: >-
            `query` for a suggested search; for an entity `company`, `school` or
            `profile`
        title:
          type: string
          description: >-
            The suggested search, or the entity's name: in lower case among the
            search bar's own suggestions, as written with `type`
        subtitle:
          type: string
          nullable: true
          description: >-
            What LinkedIn shows under the title: `Company • IT Services and IT
            Consulting`, `School • US`, a member's headline, `in Jobs` for a
            suggested job search
        id:
          type: string
          nullable: true
          description: >-
            The entity's ID: the company ID of a company or school, the profile
            ID of a member. [Get company](/linkedin-api-reference/company/get)
            accepts a company's as `query`, [Get
            profile](/linkedin-api-reference/profile/get) a member's
        urn:
          type: string
          nullable: true
          description: >-
            The entity's URN: `urn:li:company:…` for a company,
            `urn:li:organization:…` for a school, `urn:li:member:…` for a member
        linkedinUrl:
          type: string
          format: url
          nullable: true
          description: >-
            URL of the company or school page, or of the member's profile: by
            profile ID when LinkedIn gives no public identifier, as always with
            `type`
        image:
          type: string
          format: url
          nullable: true
          description: URL of the entity's logo or photo
      required:
        - type
        - title
    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

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.