# st.searchCompanies

This action allows you to search for companies applying various filtering criteria.

## Constraints

> ⏺️ **Root Start:** allowed.

> ⬆️ **Parent Actions:** N/A.

> ⬇️ **Child Actions:** [st.doForCompanies](/docs/action-st-do-for-companies).

## Parameters

```json
{
  "actionType": "st.searchCompanies",
  "label": "techIncSearch1",
  "term": "Tech Inc",
  "limit": 2,
  "filter": {
    "sizes": ["51-200", "2001-500"],
    "locations": ["San Francisco", "New York"],
    "industries": ["Software Development", "Robotics Engineering"]
  },
  "customSearchUrl": "https://www.linkedin.com/search/results/companies/?companySize=%5B%22B%22%5D&keywords=Linked%20API",
  "then": { ... }
}
```

- `label` (optional) – custom label for tracking this action in workflow completion.
- `term` (optional) – keyword or phrase to search. Either `term` or `customSearchUrl` must be provided; a request with neither (for example, with `filter` only) is rejected.
- `limit` (optional) – number of search results to return. Defaults to **10**, with a maximum value of **1000**.
- `filter` (optional) – object that specifies filtering criteria for companies. When multiple filter fields are specified, they are combined using `AND` logic.
  - `sizes` (optional) – array of enums representing employee count ranges. Matches if company’s size falls within any of the listed ranges. Options:
    - `1-10`.
    - `11-50`.
    - `51-200`.
    - `201-500`.
    - `501-1000`.
    - `1001-5000`.
    - `5001-10000`.
    - `10001+`.
  - `locations` (optional) – array of free-form strings representing locations. Matches if company is headquartered in any of the listed locations.
  - `industries` (optional) – array of enums representing industries. Matches if company operates in any of the listed industries. Takes specific values available in the LinkedIn interface.
- `customSearchUrl` (optional) – URL copied from LinkedIn search results page after configuring desired filters. When specified, overrides term and filter parameters. Allows using any search configuration available in the LinkedIn interface. Either `term` or `customSearchUrl` must be provided.
- `then` (optional) – object or array of child actions to be executed within this action.

## Result options

1. **Successful search:**

```json
{
  "actionType": "st.searchCompanies",
  "label": "techIncSearch1",
  "success": true,
  "data": [
    {
      "name": "TechCorp",
      "publicUrl": "https://www.linkedin.com/company/techcorp",
      "industry": "Information Technology",
      "location": "California",
      "logoUrl": "https://media.licdn.com/dms/image/v2/C4D0BAQE/company-logo_100_100/0/1700000000000",
      "then": { ... }
    },
    {
      "name": "Techical Life",
      "publicUrl": "https://www.linkedin.com/company/techlife",
      "industry": "Software Development",
      "location": "Mountain View",
      "logoUrl": null,
      "then": { ... }
    }
  ]
}
```

- `label` – included only if specified in the action parameters.
- `data` – array of search outputs with results of child actions execution.
  - `name` – name of the company.
  - `publicUrl` – [public](/faq/what-are-hashed-url-and-public-url) LinkedIn URL of the company.
  - `industry` – enum representing the company industry. Takes specific values available in the LinkedIn interface.
  - `location` – free-form string representing the company headquarters location.
  - `logoUrl` – URL of the company's logo, or `null` if the company has no logo.
  - `then` – results of child actions execution.

2. **Failed search:**

```json
{
  "actionType": "st.searchCompanies",
  "label": "techIncSearch1",
  "success": false,
  "error": {
    "type": "searchingNotAllowed",
    "message": "LinkedIn has blocked performing the search."
  }
}
```

- `label` – included only if specified in the action parameters.
- `error.type` – enum with the following possible values:
  - `searchingNotAllowed` – LinkedIn has blocked performing the search due to exceeding limits or other restrictions.
