PHP code example of renderbit-technologies / indos-checker-api

1. Go to this page and download the library: Download renderbit-technologies/indos-checker-api library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

renderbit-technologies / indos-checker-api example snippets


use RenderbitTechnologies\IndosCheckerApi\IndosChecker;

$checker = new IndosChecker();
$checker->checkValid('05LL0262', '14/08/1963');
// true

$data = $checker->getData('05LL0262', '14/08/1963');
// [
//     "Name"                => "YADAV SANJEEV",
//     "Date of Birth"       => "14-AUG-1963",
//     "INDoS No."           => "05LL0262",
//     "Passport No."        => "M2069200",
//     "Passport Issue Date" => "15-SEP-2014",
//     "Passport Valid To"   => "14-SEP-2024",
//     "CDC No."             => "MUM 133201",
//     "CDC Issue Date"      => "22-MAY-2015",
//     "CDC Valid To"        => "21-MAY-2025",
//     "CDC Issue Place"     => "Mumbai",
// ]

use RenderbitTechnologies\IndosCheckerApi\IndosCheckerException;

try {
    $data = $checker->getData($no, $dob);
} catch (IndosCheckerException $e) {
    // Network or server error — inspect $e->getPrevious() for the Guzzle cause
} catch (\InvalidArgumentException $e) {
    // Bad input: empty INDOS number or wrong date format (must be DD/MM/YYYY)
}

$client  = new \GuzzleHttp\Client(['timeout' => 5.0]);
$checker = new IndosChecker($client);

$checker = new IndosChecker(null, 'http://staging.example.com/indos');

Indos-Checker-API/
├── src/
│   ├── IndosChecker.php          # Core class: validation, HTTP request, HTML parsing
│   └── IndosCheckerException.php # Custom exception for API/network errors
├── tests/
│   └── IndosCheckerTest.php      # PHPUnit tests (input validation, parsing, exceptions)
├── .github/
│   ├── workflows/tests.yml       # CI: tests on PHP 8.1–8.4
│   └── dependabot.yml            # Automated dependency updates
├── composer.json
├── phpunit.xml
└── LICENSE                       # MIT