PHPackages                             mpclarkson/icon-scraper - 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. [File &amp; Storage](/categories/file-storage)
4. /
5. mpclarkson/icon-scraper

ActiveLibrary[File &amp; Storage](/categories/file-storage)

mpclarkson/icon-scraper
=======================

PHP Library to get the apple-touch-icons and favicon from a website.

0.2.0(9y ago)2129.2k↓50%9[1 issues](https://github.com/mpclarkson/icon-scraper/issues)[1 PRs](https://github.com/mpclarkson/icon-scraper/pulls)Apache-2.0PHPPHP &gt;=5.3.3

Since Jul 16Pushed 8y ago3 watchersCompare

[ Source](https://github.com/mpclarkson/icon-scraper)[ Packagist](https://packagist.org/packages/mpclarkson/icon-scraper)[ Docs](https://github.com/mpclarkson/icon-scraper)[ RSS](/packages/mpclarkson-icon-scraper/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (1)Versions (3)Used By (0)

Get Apple Touch Icons and Favicon from a Website
================================================

[](#get-apple-touch-icons-and-favicon-from-a-website)

[![Build Status](https://camo.githubusercontent.com/ec0f2bae0fb81ed5f5a3ca4f58970e61a2f2a8e3b441589f41f091a9eacfae91/68747470733a2f2f7472617669732d63692e6f72672f6d70636c61726b736f6e2f69636f6e2d736372617065722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/mpclarkson/icon-scraper)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/329db3db99124ca9c426d253f527f783f78f50c72a9dc6bd892e0b22709f6ff0/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6d70636c61726b736f6e2f69636f6e2d736372617065722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/mpclarkson/icon-scraper/?branch=master)

Overview
--------

[](#overview)

This library returns an array of `apple-touch-icon` and the `favicon` for a given url, sorted by width.

Requirements
------------

[](#requirements)

PHP 5.4+

Composer
--------

[](#composer)

Use [Composer](https://getcomposer.org) by adding the following lines in your `composer.json`:

```
"require": {
    "mpclarkson/icon-scraper": "dev-master"
},

```

Usage
-----

[](#usage)

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

    $scraper = new \Mpclarkson\IconScraper\Scraper();

    $icons = $scraper->get('http://hilenium.com');

    foreach($icons as $icon) {
        $icon->getType(); //Returns favicon or apple-touch-icon
        $icon->getHref(); //Returns a url
        $icon->getSize(); //Returns an array of integers, or empty for favicons
        $icon->getWidth(); //Integer or null
        $icon->getHeight(); //Integer or null
    }

    //$icons looks like this:

    Array
    (
        [0] => Mpclarkson\IconScraper\Icon Object
            (
                [type:Mpclarkson\IconScraper\Icon:private] => favicon
                [href:Mpclarkson\IconScraper\Icon:private] => http://d1nhhppd50p5r.cloudfront.net/favicon.ico?1433897130
                [size:Mpclarkson\IconScraper\Icon:private] => Array
                    (
                    )

            )

        [1] => Mpclarkson\IconScraper\Icon Object
            (
                [type:Mpclarkson\IconScraper\Icon:private] => apple-touch-icon
                [href:Mpclarkson\IconScraper\Icon:private] => http://d1nhhppd50p5r.cloudfront.net/css/96113be.css?1433897130
                [size:Mpclarkson\IconScraper\Icon:private] => Array
                    (
                    )
            )

        [2] => Mpclarkson\IconScraper\Icon Object
            (
                [type:Mpclarkson\IconScraper\Icon:private] => apple-touch-icon
                [href:Mpclarkson\IconScraper\Icon:private] => https://d1nhhppd50p5r.cloudfront.net/icon57.png?1433897130
                [size:Mpclarkson\IconScraper\Icon:private] => Array
                    (
                        [0] => 57
                        [1] => 57
                    )
            )

        [3] => Mpclarkson\IconScraper\Icon Object
            (
                [type:Mpclarkson\IconScraper\Icon:private] => apple-touch-icon
                [href:Mpclarkson\IconScraper\Icon:private] => http://d1nhhppd50p5r.cloudfront.net/icon72.png?1433897130
                [size:Mpclarkson\IconScraper\Icon:private] => Array
                    (
                        [0] => 72
                        [1] => 72
                    )
            )

        [4] => Mpclarkson\IconScraper\Icon Object
            (
                [type:Mpclarkson\IconScraper\Icon:private] => apple-touch-icon
                [href:Mpclarkson\IconScraper\Icon:private] => https://d1nhhppd50p5r.cloudfront.net/icon76.png?1433897130
                [size:Mpclarkson\IconScraper\Icon:private] => Array
                    (
                        [0] => 76
                        [1] => 76
                    )

            )

        [5] => Mpclarkson\IconScraper\Icon Object
            (
                [type:Mpclarkson\IconScraper\Icon:private] => apple-touch-icon
                [href:Mpclarkson\IconScraper\Icon:private] => https://d1nhhppd50p5r.cloudfront.net/icon114.png?1433897130
                [size:Mpclarkson\IconScraper\Icon:private] => Array
                    (
                        [0] => 114
                        [1] => 114
                    )

            )

        [6] => Mpclarkson\IconScraper\Icon Object
            (
                [type:Mpclarkson\IconScraper\Icon:private] => apple-touch-icon
                [href:Mpclarkson\IconScraper\Icon:private] => https://d1nhhppd50p5r.cloudfront.net/icon120.png?1433897130
                [size:Mpclarkson\IconScraper\Icon:private] => Array
                    (
                        [0] => 120
                        [1] => 120
                    )

            )

        [7] => Mpclarkson\IconScraper\Icon Object
            (
                [type:Mpclarkson\IconScraper\Icon:private] => apple-touch-icon
                [href:Mpclarkson\IconScraper\Icon:private] => https://d1nhhppd50p5r.cloudfront.net/icon144.png?1433897130
                [size:Mpclarkson\IconScraper\Icon:private] => Array
                    (
                        [0] => 144
                        [1] => 144
                    )

            )

        [8] => Mpclarkson\IconScraper\Icon Object
            (
                [type:Mpclarkson\IconScraper\Icon:private] => apple-touch-icon
                [href:Mpclarkson\IconScraper\Icon:private] => http://d1nhhppd50p5r.cloudfront.net/icon152.png?1433897130
                [size:Mpclarkson\IconScraper\Icon:private] => Array
                    (
                        [0] => 152
                        [1] => 152
                    )

            )
    )
```

Todos
-----

[](#todos)

- More tests
- Improve code style

Credits
-------

[](#credits)

This library is significant fork of this library by [Arthur Hoaro](https://github.com/ArthurHoaro/favicon). Key changes include:

- Returns an array of icons, rather than just the favicon
- Icons returned as Icon objects which include the following properties: type, href and size, and getters for width and height
- No caching
- PSR-4

Thanks goes to [Hilenium](http://hilenium.com).

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity38

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 77.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 ~614 days

Total

2

Last Release

3345d ago

### Community

Maintainers

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

---

Top Contributors

[![mpclarkson](https://avatars.githubusercontent.com/u/4843821?v=4)](https://github.com/mpclarkson "mpclarkson (17 commits)")[![digitalbase](https://avatars.githubusercontent.com/u/849282?v=4)](https://github.com/digitalbase "digitalbase (3 commits)")[![akalongman](https://avatars.githubusercontent.com/u/423050?v=4)](https://github.com/akalongman "akalongman (1 commits)")[![scrutinizer-auto-fixer](https://avatars.githubusercontent.com/u/6253494?v=4)](https://github.com/scrutinizer-auto-fixer "scrutinizer-auto-fixer (1 commits)")

---

Tags

faviconiconsphpfinderfaviconiconscraperapple-touch-icon

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mpclarkson-icon-scraper/health.svg)

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

###  Alternatives

[arthurhoaro/favicon

PHP Library used to discover favicon from given URL

36737.4k](/packages/arthurhoaro-favicon)[yosymfony/resource-watcher

A simple resource watcher using Symfony Finder

698.2M22](/packages/yosymfony-resource-watcher)[dmhendricks/file-icon-vectors

A collection of file type icons in SVG format.

35774.8k6](/packages/dmhendricks-file-icon-vectors)[ergebnis/classy

Provides collectors for classy constructs (classes, enums, interfaces, and traits).

382.8M20](/packages/ergebnis-classy)[edsdk/flmngr-server-php

Flmngr file manager PHP backend

20279.5k3](/packages/edsdk-flmngr-server-php)[samsonasik/array-lookup

A fast lookup library that help you verify and search array and Traversable data

2863.0k2](/packages/samsonasik-array-lookup)

PHPackages © 2026

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