PHPackages                             sharik709/lursoft-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. sharik709/lursoft-php

ActiveLibrary[API Development](/categories/api)

sharik709/lursoft-php
=====================

PHP client for Lursoft API

00PHPCI failing

Since Apr 20Pushed 1y ago1 watchersCompare

[ Source](https://github.com/sharik709/lursoft-php)[ Packagist](https://packagist.org/packages/sharik709/lursoft-php)[ RSS](/packages/sharik709-lursoft-php/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Lursoft PHP
===========

[](#lursoft-php)

[![Latest Version](https://camo.githubusercontent.com/59deb72803807e27a42f484acd314e7c2df2633793a9f21a3f8011ce4209ae43/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c7572736f66742f6c7572736f66742d7068702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/lursoft/lursoft-php)[![Total Downloads](https://camo.githubusercontent.com/d5c24ce863c2bc662df92681a06750d8a83e608367e748ae4c3a09a9d31bf189/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c7572736f66742f6c7572736f66742d7068702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/lursoft/lursoft-php)[![License](https://camo.githubusercontent.com/d3e91da1f1f9653b645a5f424ecd22000afa27306a88730eac2d73ae2fd9a600/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6c7572736f66742f6c7572736f66742d7068702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/lursoft/lursoft-php)[![PHP Version](https://camo.githubusercontent.com/62758238827912fa36e62fef184650f8019b582c66df688ea4b75f06dca917b1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6c7572736f66742f6c7572736f66742d7068702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/lursoft/lursoft-php)[![Tests](https://github.com/sharik709/lursoft-php/actions/workflows/tests.yml/badge.svg)](https://github.com/sharik709/lursoft-php/actions/workflows/tests.yml)[![PHPStan](https://github.com/sharik709/lursoft-php/actions/workflows/phpstan.yml/badge.svg)](https://github.com/sharik709/lursoft-php/actions/workflows/phpstan.yml)

A PHP package for integrating with the Lursoft API service. This package provides a simple and elegant way to interact with the Lursoft API in your PHP applications.

Features
--------

[](#features)

- Complete coverage of Lursoft API endpoints
- Laravel integration with service provider and facade
- Type-safe API responses
- Comprehensive error handling
- Built-in rate limiting support
- Detailed documentation
- Extensive test coverage
- PSR-12 compliant code

Requirements
------------

[](#requirements)

- PHP 8.1 or higher
- Composer
- Laravel 9.x or 10.x (for Laravel integration)

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require sharik709/lursoft-php
```

### Laravel

[](#laravel)

For Laravel applications, the package will automatically register its service provider.

Publish the configuration file:

```
php artisan vendor:publish --provider="Lursoft\LursoftPhp\Providers\LursoftServiceProvider" --tag="config"
```

Authentication
--------------

[](#authentication)

The package uses OAuth 2.0 for authentication. The `getAccessToken()` method handles the OAuth token acquisition and caching automatically. The following environment variables are required:

```
LURSOFT_CLIENT_ID=your_client_id
LURSOFT_CLIENT_SECRET=your_client_secret
LURSOFT_USERNAME=your_username
LURSOFT_PASSWORD=your_password
LURSOFT_SCOPE=your_scope
LURSOFT_BASE_URL=https://api.lursoft.lv

```

The access token is automatically cached and refreshed when expired. You don't need to manually handle the token management as it's taken care of by the service.

Basic Usage
-----------

[](#basic-usage)

### Laravel

[](#laravel-1)

```
use Sharik709\LursoftPhp\Facades\Lursoft;
use Sharik709\LursoftPhp\Exceptions\LursoftException;

try {
    // Search for legal entities
    $response = Lursoft::searchLegalEntity(['q' => 'Company Name']);

    // Check if the response was successful
    if ($response->isSuccess()) {
        // Get the results array
        $results = $response->getResults();

        // Check if there are any results
        if ($response->hasResults()) {
            foreach ($results as $company) {
                echo $company['name'] . "\n";
            }
        } else {
            echo "No results found";
        }
    } else {
        echo "Error: " . $response->getMessage();
    }

} catch (LursoftException $e) {
    // Handle any errors
    echo $e->getMessage();
}
```

### Standalone PHP

[](#standalone-php)

```
use Sharik709\LursoftPhp\Services\LursoftService;
use Sharik709\LursoftPhp\Exceptions\LursoftException;
use Psr\SimpleCache\CacheInterface;

try {
    // You need to provide a PSR-16 compatible cache implementation
    // Here's an example of creating a cache service
    $cache = /* Your PSR-16 compatible cache implementation */;

    $lursoft = new LursoftService($cache);

    // All methods are available the same way as in Laravel
    $response = $lursoft->getLegalEntityReport('123456789');

    if ($response->isSuccess()) {
        $companyData = $response->getResults();
        // Process data
    } else {
        echo "Error: " . $response->getMessage();
    }
} catch (LursoftException $e) {
    // Handle any errors
    echo $e->getMessage();
}
```

Response Object
---------------

[](#response-object)

All API calls return a `LursoftResponse` object which provides a consistent interface:

```
// Check if the request was successful
$isSuccess = $response->isSuccess();

// Get the full response data as received from Lursoft API
$rawData = $response->getData();

// Get only the results data (the 'data' key from the response)
$results = $response->getResults();

// Check if there are any results in the response
$hasResults = $response->hasResults();

// Get any error message if the request failed
$errorMessage = $response->getMessage();

// Get the HTTP status code
$statusCode = $response->getStatusCode();

// Convert the response to an array with standardized structure
$array = $response->toArray();
// The array contains: 'success', 'message', 'status_code', 'data', and 'raw_response' keys
```

Available Methods and Examples
------------------------------

[](#available-methods-and-examples)

### Legal Entity Methods

[](#legal-entity-methods)

#### Search for Legal Entities

[](#search-for-legal-entities)

```
// Basic search by name
$response = Lursoft::searchLegalEntity(['q' => 'Lursoft']);

// Search with additional filters
$response = Lursoft::searchLegalEntity([
    'q' => 'Lursoft',
    'limit' => 10,
    'offset' => 0
]);
```

#### Get Legal Entity Report

[](#get-legal-entity-report)

```
// Get detailed company information by registration number
$response = Lursoft::getLegalEntityReport('40003170000');

// Get company information with specific sections
$response = Lursoft::getLegalEntityReport('40003170000', [
    'section' => 'ASX' // Current officials, shareholders, and address coordinates
]);
```

#### Annual Reports

[](#annual-reports)

```
// Get a list of all annual reports for a company
$response = Lursoft::getAnnualReportsList('40003170000');

// Get a specific annual report
$response = Lursoft::getAnnualReport('40003170000', '2022');
```

### Person Methods

[](#person-methods)

#### Get Person Profile

[](#get-person-profile)

```
// Get a person's profile information
// Format: '123456-12345'
$response = Lursoft::getPersonProfile('123456-12345');

// Get profile with specific sections
$response = Lursoft::getPersonProfile('123456-12345', [
    'section' => 'ASP' // Current posts, memberships, procurations
]);
```

#### Get Deceased Person Data

[](#get-deceased-person-data)

```
// Check if a person is deceased
$response = Lursoft::getDeceasedPersonData('123456-12345');
```

### Public Person/Institution Methods

[](#public-personinstitution-methods)

```
// Get information about a public institution
$response = Lursoft::getPublicPersonReport('90000000000');

// Get with subordinate institutions
$response = Lursoft::getPublicPersonReport('90000000000', [
    'section' => 'S'
]);
```

### Sanctions Methods

[](#sanctions-methods)

#### Search in Sanctions Lists

[](#search-in-sanctions-lists)

```
// Search for a person or entity in sanctions lists
$response = Lursoft::searchSanctionsList([
    'name' => 'John+Doe'
]);

// Search with specific lists and parameters
$response = Lursoft::searchSanctionsList([
    'q' => 'John Doe',
    'list' => 'UN,EU,OFAC',
    'type' => 'FP', // FP for individuals, JP for entities
    'precise' => 1
]);
```

#### Get Sanctions Report

[](#get-sanctions-report)

```
// Get detailed sanctions information
$response = Lursoft::getSanctionsReport('SANCTIONED_ID');
```

#### Verify Sanction by Registration Number

[](#verify-sanction-by-registration-number)

```
// Check if a company is under sanctions
$response = Lursoft::verifySanctionByRegNumber('40003170000');
```

### Baltic Countries Methods

[](#baltic-countries-methods)

#### Estonian Legal Entities

[](#estonian-legal-entities)

```
// Search for Estonian companies
$response = Lursoft::searchEstonianLegalEntity('Company Name');

// Get Estonian company report
$response = Lursoft::getEstonianLegalEntityReport('EE12345678');
```

#### Lithuanian Legal Entities

[](#lithuanian-legal-entities)

```
// Search for Lithuanian companies
$response = Lursoft::searchLithuanianLegalEntity('Company Name');

// Get Lithuanian company report
$response = Lursoft::getLithuanianLegalEntityReport('LT12345678');
```

### Address Methods

[](#address-methods)

```
// Search for Latvian addresses
$response = Lursoft::searchLatvianAddress([
    'name' => 'Riga+Street',
    'level' => 'street'
]);

// Search for Lithuanian addresses
$response = Lursoft::searchLithuanianAddress([
    'name' => 'Vilnius+Street'
]);

// Search for Estonian addresses
$response = Lursoft::searchEstonianAddress([
    'name' => 'Tallinn+Street'
]);
```

### CSDD Methods

[](#csdd-methods)

```
// Get vehicle statement from CSDD
$response = Lursoft::getCsddVehicleStatement('VEHICLE_REG_NUMBER');
```

### Insolvency Methods

[](#insolvency-methods)

```
// Search for insolvency processes
$response = Lursoft::searchInsolvencyProcess('40003170000');

// Get insolvency process data
$response = Lursoft::getInsolvencyProcessData('PROCESS_ID');

// Get insolvency process report
$response = Lursoft::getInsolvencyProcessReport('PROCESS_ID');
```

Error Handling
--------------

[](#error-handling)

The package provides comprehensive error handling through the `LursoftException` class. All API errors will be thrown as exceptions that you can catch and handle appropriately:

```
try {
    $result = Lursoft::searchLegalEntity(['q' => 'Company Name']);
} catch (Sharik709\LursoftPhp\Exceptions\LursoftException $e) {
    // Get error message
    echo $e->getMessage();

    // Get error code
    echo $e->getCode();

    // Handle specific error types
    if ($e->getCode() === 401) {
        // Handle authentication error
    } elseif ($e->getCode() === 404) {
        // Handle not found error
    } elseif ($e->getCode() === 429) {
        // Handle rate limit exceeded
    } else {
        // Handle other errors
    }
}
```

Rate Limiting
-------------

[](#rate-limiting)

The package supports rate limiting to prevent hitting API limits. You can configure the rate limiting settings in the configuration file:

```
// config/lursoft.php
return [
    'rate_limit' => [
        'enabled' => true,
        'requests_per_minute' => 60,
    ],
];
```

Testing
-------

[](#testing)

```
composer test
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING.md](CONTRIBUTING.md) for details.

Security
--------

[](#security)

If you discover any security-related issues, please email  instead of using the issue tracker.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

Author
------

[](#author)

- **Sharik Shaikh** - [GitHub](https://github.com/sharik709) - [Email](mailto:shaikhsharik709@gmail.com)

###  Health Score

14

—

LowBetter than 2% of packages

Maintenance35

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity15

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/1439cc5e284ee01eaacb919569f4198f8b569612ac5134cbc0fc4ccd95a67081?d=identicon)[sharik709](/maintainers/sharik709)

---

Top Contributors

[![sharik709](https://avatars.githubusercontent.com/u/14141033?v=4)](https://github.com/sharik709 "sharik709 (16 commits)")

### Embed Badge

![Health badge](/badges/sharik709-lursoft-php/health.svg)

```
[![Health](https://phpackages.com/badges/sharik709-lursoft-php/health.svg)](https://phpackages.com/packages/sharik709-lursoft-php)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
