PHPackages                             sleeping-owl/apist - 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. [API Development](/categories/api)
4. /
5. sleeping-owl/apist

ActiveLibrary[API Development](/categories/api)

sleeping-owl/apist
==================

Package to provide api-like access to foreign sites based on html parsing

1.3.7(11y ago)3105.3k↓50%41[3 issues](https://github.com/sleeping-owl/apist/issues)MITHTMLPHP &gt;=5.4.0

Since Oct 22Pushed 3y ago20 watchersCompare

[ Source](https://github.com/sleeping-owl/apist)[ Packagist](https://packagist.org/packages/sleeping-owl/apist)[ Docs](http://sleeping-owl-apist.gopagoda.com)[ RSS](/packages/sleeping-owl-apist/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)Dependencies (6)Versions (12)Used By (0)

SleepingOwl Apist
-----------------

[](#sleepingowl-apist)

[![Build Status](https://camo.githubusercontent.com/1c72075d2634b3a39042434131d56d10e9eb4221c1d3ffaea05937514ecad383/68747470733a2f2f7472617669732d63692e6f72672f736c656570696e672d6f776c2f61706973742e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/sleeping-owl/apist)[![Latest Stable Version](https://camo.githubusercontent.com/3065c7fdd9847e1c95757d9a208190c787d63ea4ab904f4faa32e63ec039ffd5/68747470733a2f2f706f7365722e707567782e6f72672f736c656570696e672d6f776c2f61706973742f762f737461626c652e737667)](https://packagist.org/packages/sleeping-owl/apist)[![Total Downloads](https://camo.githubusercontent.com/7d059a0b633fed9a2dae2eb046ccff86bfe825aa73d4a4bb4a45c3c78429ba22/68747470733a2f2f706f7365722e707567782e6f72672f736c656570696e672d6f776c2f61706973742f646f776e6c6f6164732e737667)](https://packagist.org/packages/sleeping-owl/apist)[![License](https://camo.githubusercontent.com/401ab813bee85b3611a8afbdf1b503d40eefba8e375963e17f13339333f4c1b3/68747470733a2f2f706f7365722e707567782e6f72672f736c656570696e672d6f776c2f61706973742f6c6963656e73652e737667)](https://packagist.org/packages/sleeping-owl/apist)[![Code Climate](https://camo.githubusercontent.com/06db6c5c32f20046624b2d98d5ef9b59e30bc260efb427bf40b93e10e38b6f39/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f736c656570696e672d6f776c2f61706973742f6261646765732f6770612e737667)](https://codeclimate.com/github/sleeping-owl/apist)

SleepingOwl Apist is a small library which allows you to access any site in api-like style, based on html parsing.

Overview
--------

[](#overview)

This package allows you to write method like this:

```
class WikiApi extends Apist
{

	public function getBaseUrl()
	{
		return 'http://en.wikipedia.org';
	}

	public function index()
	{
		return $this->get('/wiki/Main_Page', [
			'welcome_message'  => Apist::filter('#mp-topbanner div:first')->text()->mb_substr(0, -1),
			'portals'          => Apist::filter('a[title^="Portal:"]')->each([
				'link'  => Apist::current()->attr('href')->call(function ($href)
				{
					return $this->getBaseUrl() . $href;
				}),
				'label' => Apist::current()->text()
			]),
			'languages'        => Apist::filter('#p-lang li a[title]')->each([
				'label' => Apist::current()->text(),
				'lang'  => Apist::current()->attr('title'),
				'link'  => Apist::current()->attr('href')->call(function ($href)
				{
					return 'http:' . $href;
				})
			]),
			'sister_projects'  => Apist::filter('#mp-sister b a')->each()->text(),
			'featured_article' => Apist::filter('#mp-tfa')->html()
		]);
	}
}
```

and get the following result:

```
{
    "welcome_message": "Welcome to Wikipedia",
    "portals": [
        {
            "link": "http:\/\/en.wikipedia.org\/wiki\/Portal:Arts",
            "label": "Arts"
        },
        {
            "link": "http:\/\/en.wikipedia.org\/wiki\/Portal:Biography",
            "label": "Biography"
        },
        ...
    ],
    "languages": [
        {
            "label": "Simple English",
            "lang": "Simple English",
            "link": "http:\/\/simple.wikipedia.org\/wiki\/"
        },
        {
            "label": "العربية",
            "lang": "Arabic",
            "link": "http:\/\/ar.wikipedia.org\/wiki\/"
        },
        {
            "label": "Bahasa Indonesia",
            "lang": "Indonesian",
            "link": "http:\/\/id.wikipedia.org\/wiki\/"
        },
        ...
    ],
    "sister_projects": [
        "Commons",
        "MediaWiki",
        ...
    ],
    "featured_article": "..."
}
```

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

[](#installation)

Require this package in your composer.json and run composer update (or run `composer require sleeping-owl/apist:1.x` directly):

```
	"sleeping-owl/apist": "1.*"

```

Documentation
-------------

[](#documentation)

Documentation can be found at [sleeping owl apist](http://sleepingowlapist.cloudcontrolled.com/en/php/documentation).

Examples
--------

[](#examples)

View [examples](http://sleepingowlapist.cloudcontrolled.com/en/php#examples).

Support Library
---------------

[](#support-library)

You can donate via [PayPal](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=AXJMWMRPCBGVA), Yandex money (410012943296949) or in BTC: 13k36pym383rEmsBSLyWfT3TxCQMN2Lekd

Copyright and License
---------------------

[](#copyright-and-license)

Apist was written by Sleeping Owl and is released under the MIT License. See the LICENSE file for details.

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity42

Moderate usage in the ecosystem

Community19

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 94.3% 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 ~13 days

Recently: every ~27 days

Total

11

Last Release

4087d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/da62224c5896d50a9def476b8bb1f404457e03540718205587bf666bf4ff94dc?d=identicon)[sleeping-owl](/maintainers/sleeping-owl)

---

Top Contributors

[![sleeping-owl](https://avatars.githubusercontent.com/u/9197310?v=4)](https://github.com/sleeping-owl "sleeping-owl (33 commits)")[![zamarawka](https://avatars.githubusercontent.com/u/9637438?v=4)](https://github.com/zamarawka "zamarawka (2 commits)")

---

Tags

apicrawler

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/sleeping-owl-apist/health.svg)

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

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.6M2.6k](/packages/craftcms-cms)[openai-php/laravel

OpenAI PHP for Laravel is a supercharged PHP API client that allows you to interact with the Open AI API

3.7k7.6M74](/packages/openai-php-laravel)[ec-cube/ec-cube

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)[nucleos/lastfm

Last.fm webservice client for php.

1812.9k2](/packages/nucleos-lastfm)

PHPackages © 2026

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