# Company lookup

Get company details using a LinkedIn company slug, URL, or Envo ID. Use separate
endpoints for posts, people, products, jobs, and similar companies.

## Get a company

Replace `YOUR_API_KEY` with your [API key](https://docs.envoapi.com/guides/authentication.md), then run:

```bash
curl --get 'https://api.envoapi.com/v1/companies/details/by-slug' \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --data-urlencode 'slug=microsoft'
```

The slug is the part after `/company/` in a LinkedIn company URL. For example,
`https://www.linkedin.com/company/microsoft/` has the slug `microsoft`.

Choose the endpoint that matches what you have. All three return the same
response format.

| Input                                                                              | GET endpoint                    | Required parameter                                |
| ---------------------------------------------------------------------------------- | ------------------------------- | ------------------------------------------------- |
| [Company slug](https://docs.envoapi.com/api/operations/getcompanydetailsbyslug.md) | `/v1/companies/details/by-slug` | `slug=microsoft`                                  |
| [Company URL](https://docs.envoapi.com/api/operations/getcompanydetailsbyurl.md)   | `/v1/companies/details/by-url`  | `url=https://www.linkedin.com/company/microsoft/` |
| [Envo ID](https://docs.envoapi.com/api/operations/getcompanydetailsbyid.md)        | `/v1/companies/details/by-id`   | `publicId` from an API response                   |

Send one input per request. Use `--data-urlencode` for query values.

## Read the response

Company details include a name, website, description, industry, employee counts,
and locations. Here is part of a captured response; other fields are omitted:

```json
{
  "data": {
    "publicId": "company_4T4tWj",
    "name": "Microsoft",
    "slug": "microsoft",
    "linkedinUrl": "https://www.linkedin.com/company/microsoft/",
    "primaryIndustry": {
      "publicId": null,
      "name": "Software Development"
    }
  }
}
```

* `data` contains the company. Save `publicId` to look it up by Envo ID later.
* `meta.creditCost` is the number of credits charged for the request.
* `null` means a value is unavailable. An empty list is `[]`.

See the [full company response example](https://docs.envoapi.com/api/operations/getcompanydetailsbyslug.md)
for all fields.

## Get more company data

These endpoints accept a company `slug`. Each link includes request and
response examples.

| Data                                                                                      | GET endpoint                    | Response field   |
| ----------------------------------------------------------------------------------------- | ------------------------------- | ---------------- |
| [Posts](https://docs.envoapi.com/api/operations/getcompanyposts.md)                       | `/v1/companies/posts`           | `data.posts`     |
| [People](https://docs.envoapi.com/api/operations/getcompanypeople.md)                     | `/v1/companies/people`          | `data.people`    |
| [Products](https://docs.envoapi.com/api/operations/getcompanyproducts.md)                 | `/v1/companies/products`        | `data.products`  |
| [Jobs](https://docs.envoapi.com/api/operations/getcompanyjobs.md)                         | `/v1/companies/jobs`            | `data.jobs`      |
| [Similar companies](https://docs.envoapi.com/api/operations/getsimilarcompaniesbyslug.md) | `/v1/companies/similar/by-slug` | `data.companies` |

People results include an Envo profile `id`, headline, and picture when available.
Use a returned `id` with [profile lookup](https://docs.envoapi.com/guides/profile-lookup.md) to get more details.

Similar companies also accepts a company URL through
[`/v1/companies/similar/by-url`](https://docs.envoapi.com/api/operations/getsimilarcompaniesbyurl.md).

## Company posts

Get recent posts:

```bash
curl --get 'https://api.envoapi.com/v1/companies/posts' \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --data-urlencode 'slug=microsoft' \
  --data-urlencode 'filter=ALL'
```

`filter` defaults to `ALL`. To choose a post type, use `IMAGES`, `VIDEOS`,
`DOCUMENTS`, or `ARTICLES`.

1. Leave out `cursor` on the first request.
2. While `meta.paging.hasMore` is `true`, copy `meta.paging.nextCursor` into
   the next request's `cursor` parameter.
3. Keep the same account, slug, and filter. Copy the cursor unchanged and leave
   out `start` on later pages.

Continue even if a page is short or empty. If you get `400 cursor_expired`,
start again without a cursor.

## Page through people, products, and jobs

Start with `start=0`. For example, get company jobs:

```bash
curl --get 'https://api.envoapi.com/v1/companies/jobs' \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --data-urlencode 'slug=microsoft' \
  --data-urlencode 'start=0'
```

While `meta.paging.hasMore` is `true`, request the next page:

| Endpoint           | Next request's `start`                  |
| ------------------ | --------------------------------------- |
| People or products | `meta.paging.start + meta.paging.count` |
| Jobs               | `meta.paging.nextStart`                 |

Keep the same company. The API sets the page size; do not send `count` or `limit`.
Products returns published products. Jobs returns the newest jobs first, with
up to 1,000 results available. Job pages can overlap, so remove duplicates by URL.

Each successful page uses credits, including empty pages. See
[Pagination](https://docs.envoapi.com/guides/pagination.md) and [Errors](https://docs.envoapi.com/guides/errors.md) for more help.

[Documentation index](https://docs.envoapi.com/llms.txt) · [All endpoints](https://docs.envoapi.com/api/index.md)
