PHPackages                             egorsergeychik/youscore-laravel - 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. egorsergeychik/youscore-laravel

ActiveLibrary[API Development](/categories/api)

egorsergeychik/youscore-laravel
===============================

YouScore API SDK for Laravel

v0.4.0(2mo ago)0476↓81.5%MITPHPPHP ^8.1

Since Jan 13Pushed 2mo agoCompare

[ Source](https://github.com/EgorSergeychik/youscore-laravel)[ Packagist](https://packagist.org/packages/egorsergeychik/youscore-laravel)[ RSS](/packages/egorsergeychik-youscore-laravel/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (3)Versions (7)Used By (0)

YouScore Laravel SDK
====================

[](#youscore-laravel-sdk)

[![Latest Version on Packagist](https://camo.githubusercontent.com/a6bbcef5999c58b893f72fc37bc247718cda2261f98e60a5ff94bae6052c4681/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f65676f727365726765796368696b2f796f7573636f72652d6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/egorsergeychik/youscore-laravel)[![Total Downloads](https://camo.githubusercontent.com/7c10008e00ad6bb18356bc502edcbd3ceefbb881e0d7a15374fddfeb56ee1620/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f65676f727365726765796368696b2f796f7573636f72652d6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/egorsergeychik/youscore-laravel)[![PHP Version Require](https://camo.githubusercontent.com/dc317f329acbe330db5daf76289114f4e18d5eb410698a9128a7cc27aee35edf/68747470733a2f2f706f7365722e707567782e6f72672f65676f727365726765796368696b2f796f7573636f72652d6c61726176656c2f726571756972652f706870)](https://packagist.org/packages/egorsergeychik/youscore-laravel)

An unofficial Laravel SDK for [YouScore.com.ua](https://youscore.com.ua) - a comprehensive business intelligence platform providing detailed company information, risk analysis, and financial monitoring for Ukrainian businesses.

Features
--------

[](#features)

- 🔄 **Automatic Polling**: Built-in retry mechanism for pending API responses
- 🎭 **Laravel Integration**: Seamless integration with Laravel's service container and facades
- ⚡ **Type Safety**: Full PHP 8.1+ type hints and return types

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

[](#requirements)

- PHP 8.1 or higher
- Laravel 11.0 or higher
- YouScore API key from [youscore.com.ua](https://youscore.com.ua)

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

[](#installation)

Install the package via Composer:

```
composer require egorsergeychik/youscore-laravel
```

### Configuration

[](#configuration)

Publish the configuration file:

```
php artisan vendor:publish --tag=youscore-config
```

Add your YouScore API credentials to your `.env` file:

```
YOUSCORE_API_KEY=your_api_key_here
YOUSCORE_BASE_URL=https://api.youscore.com.ua
YOUSCORE_TIMEOUT=30

# Polling configuration (optional)
YOUSCORE_POLLING_ENABLED=true
YOUSCORE_POLLING_MAX_ATTEMPTS=2
YOUSCORE_POLLING_DELAY=2500
```

Usage
-----

[](#usage)

### Using the Facade

[](#using-the-facade)

The easiest way to use the SDK is through the `YouScore` facade:

```
use EgorSergeychik\YouScore\Facades\YouScore;

// Get company registration data
$response = YouScore::registrationData()->getUnitedStateRegisterData('39404434');

// Access response data
$companyName = $response->json('name.fullName');
$status = $response->json('status');
```

### Using Dependency Injection

[](#using-dependency-injection)

You can also inject the `Client` class directly:

```
use EgorSergeychik\YouScore\Client;

class CompanyService
{
    public function __construct(private Client $youScore)
    {
    }

    public function getCompanyData(string $code): array
    {
        $response = $this->youScore->registrationData()
            ->getUnitedStateRegisterData($code);

        return $response->json();
    }
}
```

Response Handling
-----------------

[](#response-handling)

All methods return Laravel's `Illuminate\Http\Client\Response` object:

```
$response = YouScore::registrationData()->getUnitedStateRegisterData('39404434');

// Check if request was successful
if ($response->successful()) {
    // Get JSON data
    $data = $response->json();

    // Access specific fields
    $companyName = $response->json('name.fullName');
    $status = $response->json('status');

    // Get raw response body
    $body = $response->body();

    // Get status code
    $statusCode = $response->status();
}

// Handle errors
if ($response->failed()) {
    $errorMessage = $response->json('message', 'Unknown error occurred');
    // Handle error appropriately
}
```

Automatic Polling
-----------------

[](#automatic-polling)

The SDK includes automatic polling for handling pending API responses (HTTP 202):

```
// The SDK will automatically retry requests that return 202 status
$response = YouScore::registrationData()->getUnitedStateRegisterData('39404434');
// Will retry up to max_attempts times with specified delay
```

Configure polling behavior in your `config/youscore.php`:

```
'polling' => [
    'enabled' => true,        // Enable/disable polling
    'max_attempts' => 2,      // Maximum retry attempts
    'delay' => 2500,          // Delay between attempts (milliseconds)
],
```

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

[](#error-handling)

The SDK automatically throws exceptions for HTTP errors. You can catch and handle them:

```
use Illuminate\Http\Client\RequestException;

try {
    $response = YouScore::registrationData()->getUnitedStateRegisterData('invalid_code');
} catch (RequestException $e) {
    // Handle HTTP errors (4xx, 5xx)
    $statusCode = $e->response->status();
    $errorBody = $e->response->body();

    Log::error('YouScore API error', [
        'status' => $statusCode,
        'response' => $errorBody,
    ]);
}
```

Configuration Options
---------------------

[](#configuration-options)

The package supports various configuration options in `config/youscore.php`:

```
return [
    // API endpoint (usually doesn't need to be changed)
    'base_url' => env('YOUSCORE_BASE_URL', 'https://api.youscore.com.ua'),

    // Your YouScore API key
    'api_key' => env('YOUSCORE_API_KEY', ''),

    // Request timeout in seconds
    'timeout' => env('YOUSCORE_TIMEOUT', 30),

    // Polling configuration for handling 202 responses
    'polling' => [
        'enabled' => env('YOUSCORE_POLLING_ENABLED', true),
        'max_attempts' => env('YOUSCORE_POLLING_MAX_ATTEMPTS', 2),
        'delay' => env('YOUSCORE_POLLING_DELAY', 2500), // milliseconds
    ],
];
```

Testing
-------

[](#testing)

Run the package tests:

```
composer test
```

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

[](#contributing)

Contributions are welcome! Please feel free to submit a Pull Request.

Security
--------

[](#security)

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

Disclaimer
----------

[](#disclaimer)

This is an unofficial SDK for YouScore.com.ua. It is not affiliated with, endorsed by, or sponsored by YouScore. Use at your own risk.

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance84

Actively maintained with recent releases

Popularity18

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity37

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.

###  Release Activity

Cadence

Every ~7 days

Total

6

Last Release

81d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/af735f0d9c246a05b42c09beb93723198291055d6d1ca01b3e1831849b31eca3?d=identicon)[EgorSergeychik](/maintainers/EgorSergeychik)

---

Top Contributors

[![EgorSergeychik](https://avatars.githubusercontent.com/u/114668246?v=4)](https://github.com/EgorSergeychik "EgorSergeychik (9 commits)")

### Embed Badge

![Health badge](/badges/egorsergeychik-youscore-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/egorsergeychik-youscore-laravel/health.svg)](https://phpackages.com/packages/egorsergeychik-youscore-laravel)
```

###  Alternatives

[spatie/laravel-query-builder

Easily build Eloquent queries from API requests

4.4k26.9M220](/packages/spatie-laravel-query-builder)[essa/api-tool-kit

set of tools to build an api with laravel

52680.5k](/packages/essa-api-tool-kit)[esign/laravel-conversions-api

A laravel wrapper package around the Facebook Conversions API

69145.4k](/packages/esign-laravel-conversions-api)[surface/laravel-webfinger

A Laravel package to create an ActivityPub webfinger.

113.8k](/packages/surface-laravel-webfinger)

PHPackages © 2026

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