# nvFetchCompany

This method allows you to retrieve various data about a company from Sales Navigator: basic information, employees, and decision makers.

```typescript
try {
  const workflow = await linkedapi.nvFetchCompany.execute({
    companyHashedUrl: "https://www.linkedin.com/company/12345678",
    retrieveEmployees: true,
    retrieveDMs: true,
    employeesRetrievalConfig: {
      limit: 25,
      filter: {
        firstName: "John",
        lastName: "Smith",
        positions: ["engineer", "manager"],
        locations: ["United States", "Canada"],
        industries: ["Software Development"],
        schools: ["Stanford University", "MIT"],
        yearsOfExperiences: ["threeToFive", "sixToTen"]
      }
    },
    dmsRetrievalConfig: {
      limit: 5
    }
  });

  const { data, errors } = await linkedapi.nvFetchCompany.result(workflow.workflowId);

  // The list of possible execution errors is below
  if (errors && errors.length > 0) {
    console.warn('Workflow completed with execution errors:');
    errors.forEach(error => {
      console.warn(` - Type: ${error.type}, Message: ${error.message}`);
    });
  }

  // The structure of the 'data' object is below
  if (data) {
    console.log('Company name:', data.name);
    console.log('Description:', data.description);
    console.log('Location:', data.location);
    console.log('Industry:', data.industry);
    console.log('Employee count:', data.employeesCount);
    console.log('Employees:', data.employees);
    console.log('Decision makers:', data.dms);
    console.log('Workflow completed successfully. Data:', data);
  }
} catch (e) {
  // A list of all critical errors can be found here:
  // https://linkedapi.io/sdks/handling-results-and-errors/#handling-critical-errors
  if (e instanceof LinkedApiError) {
    console.error(`Critical Error - Type: ${e.type}, Message: ${e.message}`);
  } else {
    console.error('An unexpected, non-API error occurred:', e);
  }
}
```

```python
from linkedapi import NvFetchCompanyParams, LinkedApiError

try:
    workflow = linkedapi.nv_fetch_company.execute(
        NvFetchCompanyParams(
            company_hashed_url="https://www.linkedin.com/company/12345678",
            retrieve_employees=True,
            retrieve_dms=True,
            employees_retrieval_config={
                "limit": 25,
                "filter": {
                    "first_name": "John",
                    "last_name": "Smith",
                    "positions": ["engineer", "manager"],
                    "locations": ["United States", "Canada"],
                    "industries": ["Software Development"],
                    "schools": ["Stanford University", "MIT"],
                    "years_of_experiences": ["threeToFive", "sixToTen"],
                },
            },
            dms_retrieval_config={"limit": 5},
        )
    )

    result = linkedapi.nv_fetch_company.result(workflow.workflow_id)
    data = result.data
    errors = result.errors

    # The list of possible execution errors is below
    if errors:
        print("Workflow completed with execution errors:")
        for error in errors:
            print(f" - Type: {error.type}, Message: {error.message}")

    # The structure of the 'data' object is below
    if data:
        print("Company name:", data.name)
        print("Description:", data.description)
        print("Location:", data.location)
        print("Industry:", data.industry)
        print("Employee count:", data.employees_count)
        print("Employees:", data.employees)
        print("Decision makers:", data.dms)
        print("Workflow completed successfully. Data:", data)
except LinkedApiError as e:
    # A list of all critical errors can be found here:
    # https://linkedapi.io/sdks/handling-results-and-errors/#handling-critical-errors
    print(f"Critical Error - Type: {e.type}, Message: {e.message}")
except Exception as error:
    print("An unexpected, non-API error occurred:", error)
```

## Params

- `companyHashedUrl`  – [hashed](/faq/what-are-hashed-url-and-public-url)LinkedIn URL of the company.
- `retrieveEmployees`  (optional) – when set to `true`, includes company employees with their profiles in the results.
- `retrieveDMs`  (optional) – when set to `true`, includes decision makers and key personnel in the results.
- `employeesRetrievalConfig`  (optional) – configuration for retrieving employees. Available only if `retrieveEmployees` is `true`.
  - `limit` – (optional) maximum number of employees to retrieve. Defaults to **25**, with a maximum value of **2500**.
  - `filter` (optional) – object that specifies filtering criteria for employees. When multiple filter fields are specified, they are combined using `AND` logic.
    - `firstName` (optional) – first name of employee.
    - `lastName` (optional) – last name of employee.
    - `positions` (optional) – array of job position names. Matches if employee's current position is any of the listed options.
    - `locations` (optional) – array of free-form strings representing locations. Matches if employee is located in any of the listed locations.
    - `industries` (optional) – array of enums representing industries. Matches if employee works in any of the listed industries. Takes specific values available in the LinkedIn interface.
    - `schools` (optional) – array of institution names. Matches if employee currently attends or previously attended any of the listed institutions.
    - `yearsOfExperiences` (optional) – array of enums representing professional experience. Matches if employee’s experience falls within any of the listed ranges. Options:
      - `lessThanOne` – less than 1 year.
      - `oneToTwo` – 1 to 2 years.
      - `threeToFive` – 3 to 5 years.
      - `sixToTen` – 6 to 10 years.
      - `moreThanTen` – more than 10 years.
- `dmsRetrievalConfig`  (optional) – configuration for retrieving decision makers. Available only if `retrieveDMs` is `true`.
  - `limit` (optional) – number of decision makers to retrieve. Defaults to **20**, with a maximum value of **20**. If a company has fewer decision makers than specified, only the available ones will be returned.

## Data

- `name` – name of the company.
- `publicUrl` – [public](/faq/what-are-hashed-url-and-public-url) LinkedIn URL of the company.
- `description` – description of the company.
- `location` – free-form string representing the company headquarters location.
- `headquarters` – two-character country code (e.g., "US", "UK") representing headquarters location.
- `industry` – enum representing the company industry. Takes specific values available in the LinkedIn interface.
- `website` – company's official website URL.
- `employeesCount` – total number of employees associated with the company.
- `yearFounded` – year the company was established, if available.
- `logoUrl` – URL of the company's logo, or `null` if the company has no logo.
- `employees`  – array of employee profiles (included only if `retrieveEmployees` is `true`).
  - `name` – full name of the employee.
  - `publicUrl` – [public](/faq/what-are-hashed-url-and-public-url) LinkedIn URL of the employee.
  - `headline` – headline of the employee.
  - `location` – free-form string indicating the employee's location.
- `dms`  – array of decision makers (included only if `retrieveDMs` is `true`).
  - `name` – full name of the decision-maker.
  - `hashedUrl` – [hashed](/faq/what-are-hashed-url-and-public-url) LinkedIn URL of the decision-maker.
  - `position` – job position of the decision-maker.
  - `location` – free-form string indicating the decision-maker's location.
  - `countryCode` – two-character code of the decision-maker's country.

## Errors

- `noSalesNavigator` – your account does not have Sales Navigator subscription.
- `companyNotFound` – provided URL is not an existing LinkedIn company.
- `retrievingNotAllowed` – LinkedIn has blocked performing the retrieval due to exceeding limits or other restrictions.
