# Search companies

Full-text + filtered company search, backed by Companero (Elasticsearch).

- REST: `GET https://api.datero.ro/v1/companies`
- Tool MCP: `search_companies` (endpoint: https://api.datero.ro/mcp)
- Cost: 1 credit / apel
- Autentificare: recomandată — header `Authorization: Bearer dat_live_…` (fără cheie funcționează limitat, doar rate-limited per IP)

## Parametri

| Nume | În | Tip | Obligatoriu | Descriere |
| --- | --- | --- | --- | --- |
| `q` | query | string | nu | Free-text company name. |
| `county` | query | string | nu | County name (e.g. "Cluj") or code. |
| `city` | query | string | nu |  |
| `naceCode` | query | string | nu | CAEN code (4 digits). |
| `industryId` | query | string | nu |  |
| `limit` | query | string | nu | 1–100, default 25. |
| `offset` | query | string | nu | 0–999999, default 0. |
| `sortBy` | query | string | nu |  |
| `sortDirection` | query | string | nu |  |

## Exemplu: Căutare după denumire

Full-text pe denumire; răspunsul include totalCount și un eșantion paginat.

```bash
curl "https://api.datero.ro/v1/companies?q=dedeman&limit=1" \
  -H "Authorization: Bearer dat_live_CHEIA_TA"
```

Răspuns:

```json
{
  "totalCount": 4,
  "limit": 1,
  "offset": 0,
  "tookMs": 30,
  "items": [
    {
      "taxId": 2816464,
      "name": "DEDEMAN SRL",
      "companyType": "SRL",
      "tradeNumber": "J04/2621/1992",
      "county": "BACĂU",
      "city": "Bacău",
      "mainNaceCode": "4752",
      "registrationDate": "1993-01-27",
      "stateRegistration": "in_operation",
      "address": "JUD. BACĂU, MUN. BACĂU, STR. ALEXEI TOLSTOI, NR.8",
      "vatPayer": true,
      "phone": "0234513330",
      "website": null
    }
  ]
}
```

Documentație completă: https://datero.ro/docs/api/companies/search · OpenAPI: https://api.datero.ro/openapi.json
