Companies API

Access comprehensive data from the Latvian Enterprise Register through a unified API. The API provides a single endpoint with conditional data blocks based on your token's permissions.

Unified API Design

All company data is accessed through a single /api/companies endpoint. Different data blocks are included based on your API token's permissions.

Data Source

All data is sourced from official Latvian government registries and updated daily for accuracy and completeness.

Base URL

https://api.clients.lv/api/companies

Authentication & Permissions

All API endpoints require authentication using Bearer tokens. Different data blocks are included in responses based on your token's permissions:

Required Permission

companies:read - Required for all API access

Provides basic company registry data and search functionality.

Additional Data Block Permissions

companies_pvn:read

Adds vat_data block

VAT registration status, dates, and construction indicator

companies_liquidations:read

Adds liquidation_data block

Liquidation status, process details, and history

companies_participants:read

Adds participants_data block

Shareholder counts and detailed participant information

companies_equity:read

Adds equity_data block

Latest equity capital amounts and historical records

Authentication Example

curl -H "Authorization: Bearer YOUR_API_TOKEN" \
     -H "Accept: application/json" \
     https://api.clients.lv/api/companies?name=SIA

API Endpoints

GET /api/companies

List and search for companies with advanced full-text search capabilities via the name parameter.

Query Parameters

Parameter Type Required Description
name string No Company name search with advanced features (min 2 characters)
active_only boolean No Show only active companies (true/false)
regcode string No Registration code search
type string No Company type filter (SIA, AS, IK, etc.)
regtype string No Registration type filter
per_page integer No Results per page (max 100, default 15)

šŸ” Advanced Search Features (Powered by Manticore Search)

  • • 6-Tier Result Prioritization: Full word matches before partial matches, active companies before inactive ones
  • • Latvian Character Normalization: "muizas 20" finds "Muižas 20", "rigas" finds "RÄ«gas" (bidirectional)
  • • Punctuation normalization: "brando pro" finds "SIA BRANDO.PRO"
  • • Company type expansion: "sia brando inc" finds "SabiedrÄ«ba ar ierobežotu atbildÄ«bu \"BRANDO INC.\""
  • • Word order independence: "brando inc sia" works same as "sia brando inc"
  • • Quote handling: Handles companies with quotes and periods in names
  • • Registration codes: Exact or partial matches (e.g., 40203, 40203029397)
  • • Company names: Intelligent partial matches and multi-word search with full word prioritization
  • • Multi-language support: Optimized for Latvian business names and diacritical characters
  • • Fast performance: 50-100ms search with automatic database fallback

Example Requests

Search by registration code:

curl -H "Authorization: Bearer YOUR_API_TOKEN" \
     "https://api.clients.lv/api/companies?regcode=40203029397"

Multi-word company name search:

curl -H "Authorization: Bearer YOUR_API_TOKEN" \
     "https://api.clients.lv/api/companies?name=SIA%20Microsoft&active_only=true"

Search with Latvian characters (finds both "muizas" and "muižas"):

curl -H "Authorization: Bearer YOUR_API_TOKEN" \
     "https://api.clients.lv/api/companies?name=muizas%2020"

Combined search and filtering:

curl -H "Authorization: Bearer YOUR_API_TOKEN" \
     "https://api.clients.lv/api/companies?name=brand&type=SIA&active_only=true"

Basic Response (companies:read only)

{
  "current_page": 1,
  "data": [
    {
      "id": 1,
      "regcode": "40203029397",
      "name": "SIA \"Example Company\"",
      "type": "SIA",
      "type_text": "Sabiedrība ar ierobežotu atbildību",
      "regtype": "K",
      "regtype_text": "Komercreģistrs",
      "registered": "2020-01-15T00:00:00.000000Z",
      "terminated": null,
      "closed": null,
      "address": "Rīga, Brīvības iela 1-1",
      "sepa": "LV12ZZZ40203029397",
      "has_vat_data": true,
      "has_equity_data": true,
      "has_participant_data": true,
      "has_liquidation_data": false
    }
  ],
  "from": 1,
  "last_page": 100,
  "per_page": 15,
  "to": 15,
  "total": 1500
}
GET /api/companies

Get a paginated list of companies with optional filtering.

Query Parameters

Parameter Type Description
regcode string Filter by registration code
name string Filter by company name
type string Filter by company type (IK, SIA, etc.)
active_only boolean Show only active companies
per_page integer Results per page (max 100, default 15)

Example Request

curl -H "Authorization: Bearer YOUR_API_TOKEN" \
     "https://api.clients.lv/api/companies?type=SIA&active_only=true&per_page=25"
GET /api/companies/{regcode}

Get detailed information about a specific company. Response includes all data blocks your token has permission to access.

Path Parameters

Parameter Type Description
regcode string Company registration number (11 digits)

Example Request

curl -H "Authorization: Bearer YOUR_API_TOKEN" \
     "https://api.clients.lv/api/companies/40203029397"

Enhanced Response (with all permissions)

{
  "regcode": "40203029397",
  "name": "SIA \"Example Company\"",
  "type": "SIA",
  "type_text": "Sabiedrība ar ierobežotu atbildību",
  "regtype": "K",
  "regtype_text": "Komercreģistrs",
  "registered": "2020-01-15T00:00:00.000000Z",
  "terminated": null,
  "closed": null,
  "address": "Rīga, Brīvības iela 1-1",
  "sepa": "LV12ZZZ40203029397",
  "has_vat_data": true,
  "has_equity_data": true,
  "has_participant_data": true,
  "has_liquidation_data": false,

  "vat_data": {
    "is_vat_payer": true,
    "vat_number": "LV40203029397",
    "vat_status": "active",
    "registered_date": "2020-01-15",
    "excluded_date": null,
    "construction_indicator": false
  },

  "participants_data": {
    "summary": {
      "total_count": 2,
      "natural_persons": 1,
      "legal_entities": 1
    },
    "participants": [
      {
        "name": "John Doe",
        "entity_type": "NATURAL_PERSON",
        "number_of_shares": 100,
        "latvian_identity_masked": "12****-*****"
      }
    ]
  },

  "equity_data": {
    "latest_equity": {
      "amount": 50000,
      "currency": "EUR",
      "formatted_amount": "50,000.00 EUR",
      "date_from": "2020-01-15"
    }
  },

  "liquidation_data": {
    "is_in_liquidation": false,
    "latest_liquidation": null
  }
}
GET /api/companies/stats

Get database statistics including total companies, active companies, breakdown by type, and last update timestamp.

Example Request

curl -H "Authorization: Bearer YOUR_API_TOKEN" \
     "https://api.clients.lv/api/companies/stats"

Example Response

{
  "data": {
    "total_companies": 156789,
    "active_companies": 145632,
    "closed_companies": 8934,
    "liquidated_companies": 2223,
    "last_updated": "2024-01-15T06:00:00Z",
    "by_type": {
      "SIA": 98765,
      "AS": 1234,
      "IK": 45678,
      "Other": 11112
    }
  }
}

Conditional Data Blocks

Based on your API token's permissions, additional data blocks are included in company responses:

Base Company Data (Always Included)

Permission: companies:read (required)

Company Information

  • • Registration code, name, type
  • • Registration and termination dates
  • • Registered address
  • • SEPA payment identifier

Data Availability Flags

  • • has_vat_data
  • • has_equity_data
  • • has_participant_data
  • • has_liquidation_data

VAT Data Block

Permission: companies_pvn:read | Block name: vat_data

"vat_data": {
  "is_vat_payer": true,
  "vat_number": "LV40203029397",
  "vat_status": "active",
  "registered_date": "2020-01-15",
  "excluded_date": null,
  "construction_indicator": false
}

Liquidation Data Block

Permission: companies_liquidations:read | Block name: liquidation_data

"liquidation_data": {
  "is_in_liquidation": false,
  "latest_liquidation": null
}

Participants Data Block

Permission: companies_participants:read | Block name: participants_data

"participants_data": {
  "summary": {
    "total_count": 2,
    "natural_persons": 1,
    "legal_entities": 1
  },
  "participants": [
    {
      "name": "John Doe",
      "entity_type": "NATURAL_PERSON",
      "number_of_shares": 100,
      "latvian_identity_masked": "12****-*****"
    }
  ]
}

Equity Data Block

Permission: companies_equity:read | Block name: equity_data

"equity_data": {
  "latest_equity": {
    "amount": 50000,
    "currency": "EUR",
    "formatted_amount": "50,000.00 EUR",
    "date_from": "2020-01-15"
  }
}

Error Responses

The API returns standard HTTP status codes and JSON error responses:

Authentication Errors

401 Unauthorized - Missing or invalid token

{
  "error": "Missing API token"
}

403 Forbidden - IP not whitelisted or insufficient permissions

{
  "error": "IP address not allowed"
}

429 Too Many Requests - Rate limit exceeded

{
  "error": "Rate limit exceeded"
}

Common Status Codes

Code Status Description
200 OK Success
401 Unauthorized Missing/invalid token
403 Forbidden IP blocked or insufficient permissions
404 Not Found Resource not found
422 Validation Error Invalid request parameters
429 Rate Limit Exceeded Too many requests
500 Server Error Internal server error

Code Examples

PHP Example

<?php

$apiToken = 'YOUR_API_TOKEN';
$baseUrl = 'https://api.clients.lv/api/companies';

// Search companies with all data blocks
$response = file_get_contents($baseUrl . '?name=SIA%20test', false, stream_context_create([
    'http' => [
        'header' => [
            'Authorization: Bearer ' . $apiToken,
            'Accept: application/json'
        ]
    ]
]));

$data = json_decode($response, true);

// Check what data blocks are available
foreach ($data['data'] as $company) {
    echo "Company: " . $company['name'] . "\n";

    if (isset($company['vat_data'])) {
        echo "VAT Status: " . $company['vat_data']['vat_status'] . "\n";
    }

    if (isset($company['participants_data'])) {
        echo "Participants: " . $company['participants_data']['summary']['total_count'] . "\n";
    }
}

JavaScript Example

const apiToken = 'YOUR_API_TOKEN';
const baseUrl = 'https://api.clients.lv/api/companies';

// Get company details with all available data blocks
async function getCompanyDetails(regcode) {
    try {
        const response = await fetch(`${baseUrl}/${regcode}`, {
            headers: {
                'Authorization': `Bearer ${apiToken}`,
                'Accept': 'application/json'
            }
        });

        const company = await response.json();

        console.log('Company:', company.name);

        // Check available data blocks
        if (company.vat_data) {
            console.log('VAT Number:', company.vat_data.vat_number);
        }

        if (company.participants_data) {
            console.log('Participants:', company.participants_data.summary.total_count);
        }

        if (company.equity_data) {
            console.log('Equity:', company.equity_data.latest_equity.formatted_amount);
        }

        return company;

    } catch (error) {
        console.error('Error:', error);
    }
}

// Usage
getCompanyDetails('40203029397');

Support

Need help with the API? Check out these resources:

  • Permission-based data access with conditional data blocks
  • Rate limits and IP whitelisting configuration
  • API status and maintenance updates
  • Technical support for integration issues