PHPackages                             msankhala/parsehub-php - 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. msankhala/parsehub-php

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

msankhala/parsehub-php
======================

Php wrapper classes for Parsehub REST api.

v2.0.3(3y ago)1312.4k6[1 issues](https://github.com/msankhala/parsehub-php/issues)[2 PRs](https://github.com/msankhala/parsehub-php/pulls)MITPHP

Since Apr 20Pushed 2y ago3 watchersCompare

[ Source](https://github.com/msankhala/parsehub-php)[ Packagist](https://packagist.org/packages/msankhala/parsehub-php)[ Docs](http://msankhala.wordpress.com)[ RSS](/packages/msankhala-parsehub-php/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (16)Used By (0)

### ParsehubPhp

[](#parsehubphp)

Parsehub REST api wrapper class. Use this class to communicate with parsehub. This class uses [phphttpclient](http://phphttpclient.com) to communicate with parsehub and [monoglog](https://github.com/Seldaek/monolog) to make log entries about operation performed. See *Uses* section for log path and api url option.

### installation

[](#installation)

You can either download, clone this repo or install via composer:

```
composer require msankhala/parsehub-php
```

#### Features

[](#features)

- Uses [phphttpclient](http://phphttpclient.com) class for making http requests.
- This class also support basic logging using monolog.
- This class use `PSR-0` autoload.

#### Uses

[](#uses)

Create Parsehub class Object to communicate with Parsehub, pass the `api_key`to parsehub class constructor. You can optionally pass `api_url` and `log_path`log file path as second and third arguments.

`api_url` default value `https://www.parsehub.com/api/v2``log_path` default value `/log/parsehub.log`

Autoload Parsehub class:

```
require_once __DIR__ . '/vendor/autoload.php';

use Parsehub\Parsehub;
```

In your controller you can use `Parsehub` class to get list of all the `parsehub projects` and `run object` for a `parsehub project` and save them in your db. When you get a `parsehub project` information you also get the `run_list` of that project which you can store in your db.

Get Parsehub projects list:

```
$api_key = ;
$parsehub = new Parsehub($api_key);
$projectList = $parsehub->getProjectList();
echo $projectList;
```

or

```
$api_key = ;
$api_url = 'https://www.parsehub.com/api/v2';
$log_path = 'path/to/parsehub.log';
$parsehub = new Parsehub($api_key, $api_url, $log_path);
$projectList = $parsehub->getProjectList();
echo $projectList;
```

```
// Get project_token and run_token from DB.
$project_token =
$run_token =
```

Get particular Parsehub project, Pass the project\_token:

```
$parsehub = new Parsehub($api_key);
$project = $parsehub->getProject($project_token);
echo $project;
```

Get Last ready run Data for a project:

```
$parsehub = new Parsehub($api_key);
$data =  $parsehub->getLastReadyRunData($project_token);
print $data;
```

Get data for a particular run, Pass the run token:

```
$parsehub = new Parsehub($api_key);
$data = $parsehub->getRunData($run_token);
print $data;
```

Get a particular run, Pass the run token:

```
$parsehub = new Parsehub($api_key);
$run = $parsehub->getRun($run_token);
print $run;
```

Run a parsehub project:

```
$parsehub = new Parsehub($api_key);
$options = array(
    // Skip start_url option if don't want to override starting url configured
    // on parsehub.
    'start_url' => ''
    // Enter comma separated list of keywords to pass into `start_value_override`
    'keywords' => 'iphone case, iphone copy'
    // Set send_email options. Skip to remain this value default.
    'send_email' => 1,
);
$run_obj = $parsehub->runProject($project_token, $options);
echo $run_obj;
```

Cancel a parsehub project run:

```
$parsehub = new Parsehub($api_key);
$cancel = $parsehub->cancelProjectRun($run_token);
print $cancel;
```

Delete a parsehub project run, This will delete the project run and data of that run so be careful when using this method, once data deleted for a run, are not recoverable:

```
$parsehub = new Parsehub($api_key);
$cancel = $parsehub->deleteProjectRun($run_token);
print $cancel;
```

**You can check the log in your log file.**

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity30

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity71

Established project with proven stability

 Bus Factor1

Top contributor holds 92.7% 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 ~241 days

Recently: every ~698 days

Total

13

Last Release

1147d ago

Major Versions

v1.0.10 → v2.0.12015-08-25

### Community

Maintainers

![](https://www.gravatar.com/avatar/25ac41b5fdefb468f2b93c5ff82c25241f87f1f08e032426dd68f20a687f56d8?d=identicon)[msankhala](/maintainers/msankhala)

---

Top Contributors

[![msankhala](https://avatars.githubusercontent.com/u/234241?v=4)](https://github.com/msankhala "msankhala (38 commits)")[![dileepmaurya](https://avatars.githubusercontent.com/u/4093150?v=4)](https://github.com/dileepmaurya "dileepmaurya (2 commits)")[![anmol009a](https://avatars.githubusercontent.com/u/89306488?v=4)](https://github.com/anmol009a "anmol009a (1 commits)")

---

Tags

httpapirestcurlrestfulparsehub

### Embed Badge

![Health badge](/badges/msankhala-parsehub-php/health.svg)

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

###  Alternatives

[nategood/httpful

A Readable, Chainable, REST friendly, PHP HTTP Client

1.8k17.2M267](/packages/nategood-httpful)[voku/httpful

A Readable, Chainable, REST friendly, PHP HTTP Client

16183.9k1](/packages/voku-httpful)[ismaeltoe/osms

PHP library wrapper of the Orange SMS API.

4540.0k](/packages/ismaeltoe-osms)[wellrested/wellrested

Simple PHP Library for RESTful APIs

4818.7k4](/packages/wellrested-wellrested)

PHPackages © 2026

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