PHPackages                             predictionio/predictionio - 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. predictionio/predictionio

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

predictionio/predictionio
=========================

Apache PredictionIO API PHP Client

v0.13.0(7y ago)265300.0k↓40.6%54[3 PRs](https://github.com/apache/predictionio-sdk-php/pulls)6Apache-2.0PHPPHP &gt;=5.6.0

Since Mar 25Pushed 5y ago32 watchersCompare

[ Source](https://github.com/apache/predictionio-sdk-php)[ Packagist](https://packagist.org/packages/predictionio/predictionio)[ Docs](http://predictionio.apache.org)[ RSS](/packages/predictionio-predictionio/feed)WikiDiscussions develop Synced 1mo ago

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

Apache PredictionIO PHP SDK
===========================

[](#apache-predictionio-php-sdk)

[![Build Status](https://camo.githubusercontent.com/18a0dae1e0bd8a17ab6e6f0c74bfffa50faac82e06215f9ebbe412a1b6edf07e/68747470733a2f2f7472617669732d63692e6f72672f6170616368652f70726564696374696f6e696f2d73646b2d7068702e7376673f6272616e63683d646576656c6f70)](https://travis-ci.org/apache/predictionio-sdk-php)

Prerequisites
-------------

[](#prerequisites)

- PHP 5.6+ ()
- PHP: cURL ()
- Phing ()
- ApiGen ()

Note: This SDK only supports Apache PredictionIO version 0.8.2 or higher.

Getting Started
---------------

[](#getting-started)

The easiest way to install PredictionIO PHP client is to use [Composer](http://getcomposer.org/).

1. `predictionio` is available on [Packagist](https://packagist.org) and can be installed using [Composer](https://getcomposer.org/):

    ```
     composer require predictionio/predictionio

    ```
2. Include Composer's autoloader in your PHP code

    ```
     require_once("vendor/autoload.php");

    ```

Usage
-----

[](#usage)

This package is a web service client based on Guzzle. A few quick examples are shown below.

### Instantiate PredictionIO API Event Client

[](#instantiate-predictionio-api-event-client)

```
use predictionio\EventClient;
$accessKey = 'j4jIdbq59JsF2f4CXwwkIiVHNFnyNvWXqMqXxcIbQDqFRz5K0fe9e3QfqjKwvW3O';
$client = new EventClient($accessKey, 'http://localhost:7070');
```

### Set a User Record from Your App

[](#set-a-user-record-from-your-app)

```
// assume you have a user with user ID 5
$response = $client->setUser(5);
```

### Set an Item Record from Your App

[](#set-an-item-record-from-your-app)

```
// assume you have a book with ID 'bookId1' and we assign 1 as the type ID for book
$response = $client->setItem('bookId1', array('itypes' => 1));
```

### Import a User Action (View) form Your App

[](#import-a-user-action-view-form-your-app)

```
// assume this user has viewed this book item
$client->recordUserActionOnItem('view', 5, 'bookId1');
```

### Retrieving Prediction Result

[](#retrieving-prediction-result)

```
// assume you have created an itemrank engine on localhost:8000
// we try to get ranking of 5 items (item IDs: 1, 2, 3, 4, 5) for a user (user ID 7)

$engineClient = new EngineClient('http://localhost:8000');
$response = $engineClient->sendQuery(array('uid'=>7, 'iids'=>array(1,2,3,4,5)));

print_r($response);
```

Bugs and Feature Requests
-------------------------

[](#bugs-and-feature-requests)

Use [Apache JIRA](https://issues.apache.org/jira/browse/PIO) to report bugs or request new features.

Community
---------

[](#community)

Keep track of development and community news.

- Subscribe to the [user mailing list](mailto:user-subscribe@predictionio.apache.org) and the [dev mailing list](mailto:dev-subscribe@predictionio.apache.org).
- Follow [@PredictionIO](https://twitter.com/PredictionIO) on Twitter.

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

[](#contributing)

Read the [Contribute Code](http://predictionio.apache.org/community/contribute-code/) page.

License
-------

[](#license)

Apache PredictionIO is under [Apache 2 license](http://www.apache.org/licenses/LICENSE-2.0.html).

###  Health Score

43

—

FairBetter than 91% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity52

Moderate usage in the ecosystem

Community38

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

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

Recently: every ~348 days

Total

14

Last Release

2804d ago

PHP version history (4 changes)v0.3PHP &gt;=5.3.2

v0.8.0PHP &gt;=5.4.0

v0.9.0PHP &gt;=5.5.0

v0.13.0PHP &gt;=5.6.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/5f0ea3c254f124b78e8cbcf3bddc63cf4d1d7261fba2670f89b4e465eb1a8b48?d=identicon)[dszeto](/maintainers/dszeto)

![](https://www.gravatar.com/avatar/4e9b05d4335683ccb6d9e994d0025b7f41272bf738e756a78ac2c6c34c7e9013?d=identicon)[paulli](/maintainers/paulli)

---

Top Contributors

[![dszeto](https://avatars.githubusercontent.com/u/1388362?v=4)](https://github.com/dszeto "dszeto (33 commits)")[![BenWise9000](https://avatars.githubusercontent.com/u/10189003?v=4)](https://github.com/BenWise9000 "BenWise9000 (10 commits)")[![paulli](https://avatars.githubusercontent.com/u/160340?v=4)](https://github.com/paulli "paulli (4 commits)")[![dantudor](https://avatars.githubusercontent.com/u/1281127?v=4)](https://github.com/dantudor "dantudor (4 commits)")[![GrahamCampbell](https://avatars.githubusercontent.com/u/2829600?v=4)](https://github.com/GrahamCampbell "GrahamCampbell (3 commits)")[![kkopachev](https://avatars.githubusercontent.com/u/2279051?v=4)](https://github.com/kkopachev "kkopachev (3 commits)")[![samvasko](https://avatars.githubusercontent.com/u/2674600?v=4)](https://github.com/samvasko "samvasko (3 commits)")[![nopolabs](https://avatars.githubusercontent.com/u/815864?v=4)](https://github.com/nopolabs "nopolabs (2 commits)")[![k4hoo](https://avatars.githubusercontent.com/u/2480948?v=4)](https://github.com/k4hoo "k4hoo (2 commits)")[![wa0x6e](https://avatars.githubusercontent.com/u/495709?v=4)](https://github.com/wa0x6e "wa0x6e (2 commits)")[![sylvaindethier](https://avatars.githubusercontent.com/u/379351?v=4)](https://github.com/sylvaindethier "sylvaindethier (1 commits)")[![Ti-webdev](https://avatars.githubusercontent.com/u/478565?v=4)](https://github.com/Ti-webdev "Ti-webdev (1 commits)")[![dugwood](https://avatars.githubusercontent.com/u/5517743?v=4)](https://github.com/dugwood "dugwood (1 commits)")[![woodworker](https://avatars.githubusercontent.com/u/85796?v=4)](https://github.com/woodworker "woodworker (1 commits)")[![cafferata](https://avatars.githubusercontent.com/u/1150425?v=4)](https://github.com/cafferata "cafferata (1 commits)")[![pborreli](https://avatars.githubusercontent.com/u/77759?v=4)](https://github.com/pborreli "pborreli (1 commits)")[![romainneutron](https://avatars.githubusercontent.com/u/137574?v=4)](https://github.com/romainneutron "romainneutron (1 commits)")[![sgrodzicki](https://avatars.githubusercontent.com/u/712836?v=4)](https://github.com/sgrodzicki "sgrodzicki (1 commits)")[![simon-chan-zz](https://avatars.githubusercontent.com/u/2481661?v=4)](https://github.com/simon-chan-zz "simon-chan-zz (1 commits)")

---

Tags

big-datapredictionioscalarestweb servicerestfulpredictionrecommendationpredictionio

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[srmklive/paypal

Laravel plugin For Processing Payments Through Paypal Express Checkout. Can Be Used Independently With Other Applications.

1.1k3.8M26](/packages/srmklive-paypal)[eightpoints/guzzle-bundle

Integrates Guzzle 6.x, a PHP HTTP Client, into Symfony. Comes with easy and powerful configuration options and optional plugins.

45912.1M55](/packages/eightpoints-guzzle-bundle)[ismaeltoe/osms

PHP library wrapper of the Orange SMS API.

4540.0k](/packages/ismaeltoe-osms)[zoonman/pixabay-php-api

PixabayClient is a PHP HTTP client library to access Pixabay's API

3354.7k](/packages/zoonman-pixabay-php-api)[abantecart/ups-php

UPS PHP SDK based on OAuth

1815.3k](/packages/abantecart-ups-php)

PHPackages © 2026

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