Discover how to integrate FirmAPI into your systems
FirmAPI provides a simple API for accessing Slovak company data. Below you'll find practical integration examples.
Company search with autocomplete
The /search/autocomplete endpoint is ideal for Select2, typeahead, and similar components. Returns results compatible with popular JavaScript libraries.
Select2 integration
Complete example of integrating with the Select2 library for company search.
import { FirmApi } from 'firmapi';
const client = new FirmApi('YOUR_API_KEY');
// Initialize Select2 with FirmAPI SDK
$('#company-search').select2({
ajax: {
transport: async (params, success, failure) => {
try {
const data = await client.search.autocomplete(params.data.q);
success(data);
} 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).
import { FirmApi } from 'firmapi';
const client = new FirmApi('YOUR_API_KEY');
// Fetch company by IČO
const company = await client.companies.byIco('51636549');
console.log(company.name); // "Version Two s. r. o."
// Search by name
const results = await client.search.byName('Version Two');
console.log(results.data); // [{ ico: "51636549", name: "..." }]
use FirmApi\Client;
$client = new Client('YOUR_API_KEY');
// Fetch company by IČO
$company = $client->companies->byIco('51636549');
echo $company['name']; // "Version Two s. r. o."
echo $company['city']; // "Bratislava"
// Search by name
$results = $client->search->byName('Version Two');
foreach ($results['data'] as $item) {
echo $item['ico'] . ' - ' . $item['name'];
}
import 'package:http/http.dart' as http;
import 'dart:convert';
Future<Company> getCompanyByIco(String ico) async {
final response = await http.get(
Uri.parse('https://api.firmapi.sk/v1/company/ico/$ico'),
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
},
);
final json = jsonDecode(response.body);
return Company.fromJson(json['data']);
}
curl -X GET "https://api.firmapi.sk/v1/company/ico/51636549" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Accept: application/json"
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.
- Eliminate manual data entry
- Reduce transcription errors
- Current data directly from Business Register
- Automatic IČO validation
CRM form example
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)
use FirmApi\Client;
use FirmApi\Exceptions\ApiException;
public function loadBillingData(Request $request)
{
$client = new Client(config('firmapi.key'));
try {
$company = $client->companies->byIco($request->ico);
return response()->json([
'name' => $company['name'],
'address' => $company['address'],
'dic' => $company['tax']['dic'] ?? null,
'ic_dph' => $company['tax']['ic_dph'] ?? null,
]);
} catch (ApiException $e) {
return response()->json(['error' => 'Company not found'], 404);
}
}
Start using FirmAPI
Sign up for free and get your API key. The Free plan includes 20 requests per month.
Get started free