benja/nida-php

PHP library to fetch user information from NIDA Tanzania

Installs: 1

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

pkg:composer/benja/nida-php

v1.0.0 2025-09-21 23:20 UTC

This package is auto-updated.

Last update: 2025-12-22 01:05:59 UTC


README

GitHub Release Packagist Version Packagist Downloads License: MIT

Unofficial package for fetching users information based on National ID Number
Created by Benjamini

⚠️ Disclaimer: This is an unofficial package.
The NIDA API may change without notice, and the author is not responsible for misuse or incorrect data.
Photo and Signature data may not be available due to NIDA privacy restrictions.

🚀 Requirements / Tools

  • PHP >= 7.4
  • Composer
  • Guzzle HTTP client (installed automatically via Composer)
  • Optional: IDE/editor for PHP development (VSCode, PhpStorm, Sublime, etc.)

📦 Installation

composer require benja/nida-php

Copy and Testing

cp -r ../nida-php/examples ./examples
php examples/test.php

Local / Development Install

git clone https://github.com/basanzietech/nida-php.git
cd nida-php

For local testing in another project:

{
  "repositories": [
    {
      "type": "path",
      "url": "../nida-php"
    }
  ],
  "require": {
    "benja/nida-php": "*"
  }
}

🔑 Usage

<?php
require 'vendor/autoload.php';

use Nida\Nida;

$nida = new Nida();
$user = $nida->loadUser("1999999999999999"); // Replace with valid Tanzanian ID
print_r($user);

Raw JSON Data

$userRaw = $nida->loadUser("1999999999999999", true);
print_r($userRaw);

🖼 Photo & Signature

Library tries to decode Photo and Signature into PNG images.

⚠️ Due to NIDA privacy policies, actual ID photos are not provided.

For testing, you can use placeholder images:

$user['Photo'] = base64_encode(file_get_contents('test-photo.png'));
$user['Signature'] = base64_encode(file_get_contents('test-signature.png'));

🔧 Features

Fetch user info from NIDA Tanzania using National ID

Preprocess user data (capitalize keys, decode images if available)

Easy integration with any PHP project via Composer

Return both processed objects and raw JSON

🌟 Give it a Star

If this package is useful, give it a ⭐ on GitHub to help others discover it.

📝 Contributions

Fork the repo, make improvements, and submit a pull request.

⚠️ Disclaimer

This is unofficial. The author is not responsible for incorrect data, API changes, or misuse. Use at your own discretion.

📌 Credits

Created by Benjamini

Inspired by Kalebu / Python NIDA library