PHPackages                             risan/ktp - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. risan/ktp

ActiveLibrary[HTTP &amp; Networking](/categories/http)

risan/ktp
=========

HTTP client library for finding 2014 Indonesian presidential election voter's data based on it's NIK

v1.1.1(10y ago)2441[1 issues](https://github.com/risan/ktp/issues)MITPHP

Since Mar 3Pushed 10y ago1 watchersCompare

[ Source](https://github.com/risan/ktp)[ Packagist](https://packagist.org/packages/risan/ktp)[ Docs](https://github.com/risan/ktp)[ RSS](/packages/risan-ktp/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (4)Versions (6)Used By (0)

KTP HTTP Client
===============

[](#ktp-http-client)

[![Build Status](https://camo.githubusercontent.com/cfb3af0480af91c5d0049e5eb63e25c6faab0083a431dab31fba582a21e84175/68747470733a2f2f7472617669732d63692e6f72672f726973616e2f6b74702e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/risan/ktp)[![HHVM Status](https://camo.githubusercontent.com/deda2501763c735fa2704c2452e8c3b3d1e6bcf21365b6e727c536bf4a54101b/687474703a2f2f6868766d2e683463632e64652f62616467652f726973616e2f6b74702e7376673f7374796c653d666c6174)](http://hhvm.h4cc.de/package/risan/ktp)[![StyleCI](https://camo.githubusercontent.com/97a65195bccfcc7ca5890e4d5cc0af5a33c963e707a258a88e163f153aba43a3/68747470733a2f2f7374796c6563692e696f2f7265706f732f35333036333037352f736869656c643f7374796c653d666c6174)](https://styleci.io/repos/53063075)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/395b8a70a76dfcd054eb572fe9cabc839056b81f46f1c3dfee3a3ee2b80314bc/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f726973616e2f6b74702f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/risan/ktp/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/9a66b98acb639e05a3d651957617504fe8eee18c67f0a49699b7e9d325f83235/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f726973616e2f6b74702f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/risan/ktp/?branch=master)[![SensioLabs Insight](https://camo.githubusercontent.com/8b55db6f215feeecc62e0a295c1b66c6bdef763585de717e3634ab6744b16c9d/68747470733a2f2f696d672e736869656c64732e696f2f73656e73696f6c6162732f692f61353534383730622d356230612d343664392d383066632d6264373639386664643033342e737667)](https://insight.sensiolabs.com/projects/a554870b-5b0a-46d9-80fc-bd7698fdd034)[![Latest Stable Version](https://camo.githubusercontent.com/63d91bf4d3ee6753e34cdd8ff7e637d49a7b66cbae413a35ba714179f70c3d47/68747470733a2f2f706f7365722e707567782e6f72672f726973616e2f6b74702f762f737461626c65)](https://packagist.org/packages/risan/ktp)[![License](https://camo.githubusercontent.com/54d06e7387c33d5562bb623016a2f202d818a41611f79ea190d254d930ff6cf5/68747470733a2f2f706f7365722e707567782e6f72672f726973616e2f6b74702f6c6963656e7365)](https://packagist.org/packages/risan/ktp)

PHP HTTP client library for finding 2014 Indonesian presidential election voter's data based on it's NIK. The data is directly scraped from [KPU website](https://data.kpu.go.id/ss8.php) website.

Table of Contents
-----------------

[](#table-of-contents)

- [Dependencies](#dependencies)
- [Installation](#installation)
- [How to Use](#how-to-use)

Dependencies
------------

[](#dependencies)

This package powered by the following awesome libraries:

- [Guzzle](https://github.com/guzzle/guzzle)
- [Symfony DomCrawler Component](https://github.com/symfony/dom-crawler)
- [Symfony CssSelector Component](https://github.com/symfony/css-selector)

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

[](#installation)

The recommended way to install this package is through [Composer](https://getcomposer.org/). With the Composer installed on your machine, simply run the following command inside your project directory:

```
composer require risan/ktp
```

You may also add `risan\ktp` package directly into your `composer.json` file:

```
"require": {
  "risan/ktp": "~1.1"
}
```

Once your `composer.json` file is updated, run the following command to install it:

```
composer install
```

How to Use
----------

[](#how-to-use)

Here's some example about how to use this package:

```
// Include composer autoloder file.
require 'vendor/autoload.php';

// Create a new instance Ktp\Finder.
$ktp = new Ktp\Finder();

// Find a voter's data by it's NIK.
$data = $ktp->findByNik(1122330108901234);

// Voter's data is not found.
if (is_null($data)) {
    die('Not found!');
}

print_r($data);
```

If the given NIK is not found, the `findByNik()` method will return a `null` value.

If the given NIK is found, the `findByNik()` will return an array that holds the voter's data. The returned array will have the following structure:

```
Array
(
    [nik] => 1122330108901234
    [name] => RISAN BAGJA
    [jenis_kelamin] => LAKI-LAKI
    [kelurahan] => KAMPUNG BARU
    [kecamatan] => BANDA
    [kabupaten_kota] => MALUKU TENGAH
    [provinsi] => MALUKU UTARA
)
```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance10

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity67

Established project with proven stability

 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 ~1 days

Total

5

Last Release

3719d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3825242?v=4)[Risan Bagja Pradana](/maintainers/risan)[@risan](https://github.com/risan)

---

Top Contributors

[![risan](https://avatars.githubusercontent.com/u/3825242?v=4)](https://github.com/risan "risan (32 commits)")

---

Tags

nikktpkpupemilu

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/risan-ktp/health.svg)

```
[![Health](https://phpackages.com/badges/risan-ktp/health.svg)](https://phpackages.com/packages/risan-ktp)
```

###  Alternatives

[spatie/crawler

Crawl all internal links found on a website

2.8k16.3M52](/packages/spatie-crawler)[craftcms/cms

Craft CMS

3.6k3.6M2.6k](/packages/craftcms-cms)[ec-cube/ec-cube

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)[sproutcms/cms

Enterprise content management and framework

241.6k4](/packages/sproutcms-cms)

PHPackages © 2026

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