# FirmAPI – Use Cases

FirmAPI provides a simple API for accessing Slovak company data. Below you'll find practical integration examples. Sign up for free and get your API key. The Free plan includes 20 requests per month. https://api.firmapi.sk/en/register

Base URL: `https://firmapi.sk/v1` · Authentication: header `X-API-Key: fa_your_key` or `Authorization: Bearer fa_your_key`.

## Company search with autocomplete

The /search/autocomplete endpoint is ideal for Select2, typeahead, and similar components. Returns results compatible with popular JavaScript libraries.

```bash
curl -H "X-API-Key: fa_your_key" \
  "https://firmapi.sk/v1/search/autocomplete?q=version+two"
```

Select2 integration – Complete example of integrating with the Select2 library for company search.

```javascript
import { FirmApi } from 'firmapi';

const client = new FirmApi('YOUR_API_KEY');

$('#company-search').select2({
  ajax: {
    transport: async (params, success, failure) => {
      try { success(await client.search.autocomplete(params.data.q)); }
      catch (e) { failure(e); }
    },
    data: (params) => ({ q: params.term }),
    processResults: (data) => ({ results: data.results }),
  },
  minimumInputLength: 2,
});
```

## Get company data by IČO

The most common use case - retrieving complete company data by its IČO (registration number).

```bash
curl -H "X-API-Key: fa_your_key" \
  "https://firmapi.sk/v1/company/ico/51636549"
```

JavaScript example:

```javascript
import { FirmApi } from 'firmapi';

const client = new FirmApi('YOUR_API_KEY');

const company = await client.companies.byIco('51636549');
console.log(company.name); // "Version Two s. r. o."

const results = await client.search.byName('Version Two');
console.log(results.data); // [{ ico: "51636549", name: "..." }]
```

PHP example:

```php
use FirmApi\Client;

$client = new Client('YOUR_API_KEY');

$company = $client->companies->byIco('51636549');
echo $company['name']; // "Version Two s. r. o."
echo $company['city']; // "Bratislava"
```

The same logic applies to Dart/Flutter and any other language – it is a plain HTTP GET with the API key in a header.

## CRM system integration

Automatically populate customer data in your CRM system. Just enter the IČO and all company details will be filled in automatically.

```bash
curl -H "X-API-Key: fa_your_key" \
  "https://firmapi.sk/v1/company/ico/51636549?scope=tax"
```

- Eliminate manual data entry
- Reduce transcription errors
- Current data directly from Business Register
- Automatic IČO validation

## E-shop invoice automation

When entering an IČO, billing details are automatically filled in. Ideal for B2B e-shops and services.

- Faster checkout for business customers
- Accurate billing details without errors
- Automatic company existence verification
- Support for DIČ and IČ DPH (higher tiers)

## More scenarios

- **Business partner verification (KYB)** – Before signing a contract or shipping goods on invoice, one request returns debts to insurers and the Financial Administration, insolvencies, enforcement authorisations and sanctions lists. Details: https://api.firmapi.sk/en/verify-company.md
- **Customer portfolio monitoring** – Webhooks deliver a change (new debt, bankruptcy, change of managing director) to your system on the day we detect it. Details: https://api.firmapi.sk/en/company-monitoring.md
- **Batch processing** – `POST /v1/batch/ico` takes a list of company IDs and processes them at once; suited to the initial CRM load or regular database cleanup.

---

Full API documentation: https://api.firmapi.sk/en/docs.md · Pricing: https://api.firmapi.sk/en/pricing.md
