# Find companies by name or domain

`GET https://trawle.com/v1/companies`

## Query parameters

- `q` (string, required): Company name or domain. 1 to 100 characters. Example: `stripe`.
- `limit` (integer, optional): Default `8`. 1 to 20. Example: `8`.

## Responses

### 200: Best matches first.

- `items` (array<object>, required, CompanyMatch)
  - `slug` (string, required): Example: `stripe`.
  - `name` (string, required): Example: `Stripe`.
  - `domain` (string | null, required): Example: `stripe.com`.
  - `industry` (string | null, required)
  - `openJobs` (integer, required)

### 400: Invalid request: see `error.issues` and `error.hint`.

Schema: Error

- `error` (object, required)
  - `code` (string, required): Machine-readable: `invalid_request`, `not_found`, `forbidden`, `rate_limited`, `internal`. Example: `invalid_request`.
  - `message` (string, required): Example: `places: expected an array of GeoNames ids`.
  - `hint` (string, optional): What to do next, e.g. which lookup to call first. Example: `Resolve place names to ids with GET /v1/places?q=`.
  - `issues` (array<object>, optional): Validation problems, one per invalid field.
    - `path` (string, required)
    - `message` (string, required)

## Examples

### cURL

```bash
curl "https://trawle.com/v1/companies?q=stripe"
```

### TypeScript

```ts
import createClient from "openapi-fetch";

// npx openapi-typescript https://developers.trawle.com/openapi.json -o trawle.d.ts
import type { paths } from "./trawle";

const trawle = createClient<paths>({ baseUrl: "https://trawle.com" });

const { data, error } = await trawle.GET("/v1/companies", {
  params: {
    query: {
      q: "stripe",
    },
  },
});
```

### Python

```python
import requests

response = requests.get(
    "https://trawle.com/v1/companies",
    params={
        "q": "stripe",
    },
)
response.raise_for_status()
data = response.json()
```

### Response 200

```json
{
  "items": [
    {
      "slug": "stripe",
      "name": "Stripe",
      "domain": "stripe.com",
      "industry": "string",
      "openJobs": 0
    }
  ]
}
```

### Response 400

```json
{
  "error": {
    "code": "invalid_request",
    "message": "query.places.0: Invalid input: expected number, received string",
    "hint": "Fix the fields in `issues`. Ids for `places`, `roles` and `companies` come from the lookup endpoints.",
    "issues": [
      {
        "path": "query.places.0",
        "message": "Invalid input: expected number, received string"
      }
    ]
  }
}
```
