PHPackages                             mpratt/embera - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. mpratt/embera

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

mpratt/embera
=============

Oembed consumer library. Converts urls into their html embed code. Supports 150+ sites, such as Youtube, Twitter, vimeo, Instagram etc.

2.0.42(1y ago)3636.0M↓21.1%61[4 issues](https://github.com/mpratt/Embera/issues)[2 PRs](https://github.com/mpratt/Embera/pulls)20MITPHPPHP &gt;=5.6CI failing

Since Sep 11Pushed 8mo ago15 watchersCompare

[ Source](https://github.com/mpratt/Embera)[ Packagist](https://packagist.org/packages/mpratt/embera)[ Docs](https://github.com/mpratt/Embera)[ Fund](https://paypal.me/mtpratt)[ RSS](/packages/mpratt-embera/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (3)Versions (76)Used By (20)

Embera - PHP Oembed consumer library
====================================

[](#embera---php-oembed-consumer-library)

[![Build Status](https://github.com/mpratt/Embera/actions/workflows/tests.yml/badge.svg?branch=master)](https://github.com/mpratt/Embera/actions)[![Total Downloads](https://camo.githubusercontent.com/d4e6ee3e8d32ade55d1cb99d883bcf6eccd12b3b3e885e4641fc4eb5a9bdac6a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d70726174742f656d626572612e737667)](https://packagist.org/packages/mpratt/embera)[![Monthly Downloads](https://camo.githubusercontent.com/bd2406138c11501f1745e078302008cd46c635388c25d58d2fc617eef5e2ea48/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f6d70726174742f656d62657261)](https://packagist.org/packages/mpratt/embera)[![Latest Stable Version](https://camo.githubusercontent.com/75eeef651a0d394f9ec3dad129f9fcbe10aa034161c48f24b1d79e52cda203d0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d70726174742f656d626572612e737667)](https://packagist.org/packages/mpratt/embera)

[![Support via PayPal](https://camo.githubusercontent.com/ab5313818d2a5fd84045bba34cd5e220642f96c1b8cd863a240fc6a181d557c2/68747470733a2f2f63646e2e7261776769742e636f6d2f74776f6c66736f6e2f70617970616c2d6769746875622d627574746f6e2f312e302e302f646973742f627574746f6e2e737667)](https://paypal.me/mtpratt)

Embera is an Oembed consumer library written in PHP. It takes urls from a text and queries the matching service for information about the media and embeds the resulting html. It supports **+150** sites, such as Youtube, Twitter, Livestream, Dailymotion, Instagram, Vimeo and [many many more](doc/02-providers.md).

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

[](#installation)

Install the latest stable version with:

```
$ composer require mpratt/embera:~2.0
```

### Standalone Installation (without Composer)

[](#standalone-installation-without-composer)

Download the latest release or clone this repository and include the `Àutoloader.php` file inside the `Embera/src` directory.

```
require '....../Autoloader.php';

use Embera\Embera;

$embera = new Embera();
```

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

[](#requirements)

- PHP &gt;= 7.0 (It should work on 5.6)
- Curl or allow\_url\_fopen should be enabled

Basic Usage
-----------

[](#basic-usage)

The most common or basic example is this one:

```
use Embera\Embera;

$embera = new Embera();
echo $embera->autoEmbed('Hi! Have you seen this video? https://www.youtube.com/watch?v=J---aiyznGQ Its the best!');
```

The last example returns something like the following text:

```
Hi! Have you seen this video?

Its the best!
```

You can also inspect urls for their oembed data:

```
use Embera\Embera;

$embera = new Embera();
print_r($embera->getUrlData([
    'https://vimeo.com/374131624',
    'https://www.flickr.com/photos/bees/8597283706/in/photostream',
]));
```

That will return something like this

```
Array
(
    [https://vimeo.com/374131624] => Array
        (
            [type] => video
            [version] => 1.0
            [provider_name] => Vimeo
            [provider_url] => https://vimeo.com/
            [title] => VACATION movie
            [author_name] => Andrey Kasay
            [author_url] => https://vimeo.com/andreykasay
            [is_plus] => 0
            [account_type] => basic
            [html] =>
            [width] => 426
            [height] => 240
            [duration] => 146
            [description] => Остросюжетное кино про жизнь
            [thumbnail_url] => https://i.vimeocdn.com/video/832478725_295x166.jpg
            [thumbnail_width] => 295
            [thumbnail_height] => 166
            [thumbnail_url_with_play_button] => https://i.vimeocdn.com/......Fcrawler_play.png
            [upload_date] => 2019-11-19 06:27:37
            [video_id] => 374131624
            [uri] => /videos/374131624
            [embera_using_fake_response] => 0
            [embera_provider_name] => Vimeo
        )
    [https://www.flickr.com/photos/bees/8597283706/in/photostream] => Array
        (
            [type] => photo
            [flickr_type] => photo
            [title] => Durumu
            [author_name] => ‮‭‬bees‬
            [author_url] => https://www.flickr.com/photos/bees/
            [width] => 1024
            [height] => 723
            [url] => https://live.staticflickr.com/8385/8597283706_7b51ea50b1_b.jpg
            [web_page] => https://www.flickr.com/photos/bees/8597283706/
            [thumbnail_url] => https://live.staticflickr.com/8385/8597283706_7b51ea50b1_q.jpg
            [thumbnail_width] => 150
            [thumbnail_height] => 150
            [web_page_short_url] => https://flic.kr/p/e6HjVq
            [license] => All Rights Reserved
            [license_id] => 0
            [html] => .........
            [version] => 1.0
            [cache_age] => 3600
            [provider_name] => Flickr
            [provider_url] => https://www.flickr.com/
            [embera_using_fake_response] => 0
            [embera_provider_name] => Flickr
            [html_alternative] => ........
        )
)
```

The response data depends on the provider, each of them returns information about the consulted media, however this library always tries to provide an embeddable `html` key that can be used to embed the information on a html document.

This library has fake responses / Offline support which is a way of getting the html embeddable code without the need of querying the oembed provider. It also has caching support, provider collections, responsive embeds and many other features. You can find out more by reading the documentation below.

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

[](#documentation)

- [Usage/Configuration instructions](doc/01-usage.md)
- [Supported providers](doc/02-providers.md)
- [Using provider collections](doc/03-provider-collections.md)
- [Using fake Responses](doc/04-fake-responses.md)
- [Using responsive embeds](doc/05-responsive-embeds.md)
- [Enabling cache](doc/06-caching.md)
- [Advanced Usage](doc/07-advanced-usage.md)

Migrating from version &gt;= 1.9.x
----------------------------------

[](#migrating-from-version--19x)

The folder structure has changed, the library is now in the `src` folder and you can find an autoloader there if you are not using composer.

The configuration array has changed in order to make it simpler. Take a look at the [Usage/Configuration instructions](doc/01-usage.md) to update it.

The other major change is that the `inspectUrlInfo()` method is now called `getUrlData()`. The `HtmlFormatter` class does not exist anymore since the library allows now other type of templating.

Updating should be fairly easy, check the documentation.

Submitting bugs and feature requests
------------------------------------

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

Bugs and feature request are tracked on [GitHub](https://github.com/mpratt/Embera/issues)

Author
------

[](#author)

Michael Pratt -  - See also the list of [contributors](https://github.com/mpratt/Embera/contributors) which participated in this project.

If you like this library, it has been useful to you and want to support me, you can do it via paypal.

[![Support via PayPal](https://camo.githubusercontent.com/ab5313818d2a5fd84045bba34cd5e220642f96c1b8cd863a240fc6a181d557c2/68747470733a2f2f63646e2e7261776769742e636f6d2f74776f6c66736f6e2f70617970616c2d6769746875622d627574746f6e2f312e302e302f646973742f627574746f6e2e737667)](https://paypal.me/mtpratt)

License
-------

[](#license)

Embera is licensed under the MIT License - see the [LICENSE](LICENSE) file for details

###  Health Score

60

—

FairBetter than 98% of packages

Maintenance49

Moderate activity, may be stable

Popularity65

Solid adoption and visibility

Community42

Growing community involvement

Maturity73

Established project with proven stability

 Bus Factor1

Top contributor holds 93% 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 ~55 days

Recently: every ~66 days

Total

75

Last Release

545d ago

Major Versions

0.9 → 1.02013-09-23

1.9.5 → 2.0.0-RC12019-12-10

1.9.6 → 2.0.12020-01-03

PHP version history (2 changes)0.9PHP &gt;=5.3

1.9.5PHP &gt;=5.6

### Community

Maintainers

![](https://www.gravatar.com/avatar/ef93c9650279085a83048c1a59e01ee14408e6a5afd6d1b5db5ea3167ad49a90?d=identicon)[mpratt](/maintainers/mpratt)

---

Top Contributors

[![mpratt](https://avatars.githubusercontent.com/u/647713?v=4)](https://github.com/mpratt "mpratt (712 commits)")[![n3t](https://avatars.githubusercontent.com/u/979699?v=4)](https://github.com/n3t "n3t (9 commits)")[![vkhramtsov](https://avatars.githubusercontent.com/u/5517373?v=4)](https://github.com/vkhramtsov "vkhramtsov (7 commits)")[![billtomczak](https://avatars.githubusercontent.com/u/3068131?v=4)](https://github.com/billtomczak "billtomczak (5 commits)")[![matzeeable](https://avatars.githubusercontent.com/u/1008534?v=4)](https://github.com/matzeeable "matzeeable (3 commits)")[![simshaun](https://avatars.githubusercontent.com/u/379519?v=4)](https://github.com/simshaun "simshaun (3 commits)")[![robbytaylor](https://avatars.githubusercontent.com/u/2005679?v=4)](https://github.com/robbytaylor "robbytaylor (2 commits)")[![FlorisDerks](https://avatars.githubusercontent.com/u/1500538?v=4)](https://github.com/FlorisDerks "FlorisDerks (2 commits)")[![azeos](https://avatars.githubusercontent.com/u/3887450?v=4)](https://github.com/azeos "azeos (2 commits)")[![kjschubert](https://avatars.githubusercontent.com/u/1273714?v=4)](https://github.com/kjschubert "kjschubert (2 commits)")[![sovetski](https://avatars.githubusercontent.com/u/13520683?v=4)](https://github.com/sovetski "sovetski (2 commits)")[![Stubbs](https://avatars.githubusercontent.com/u/43525?v=4)](https://github.com/Stubbs "Stubbs (2 commits)")[![mattleff](https://avatars.githubusercontent.com/u/120155?v=4)](https://github.com/mattleff "mattleff (1 commits)")[![PayteR](https://avatars.githubusercontent.com/u/1248565?v=4)](https://github.com/PayteR "PayteR (1 commits)")[![silentworks](https://avatars.githubusercontent.com/u/79497?v=4)](https://github.com/silentworks "silentworks (1 commits)")[![j0k3r](https://avatars.githubusercontent.com/u/62333?v=4)](https://github.com/j0k3r "j0k3r (1 commits)")[![annieyo](https://avatars.githubusercontent.com/u/19727627?v=4)](https://github.com/annieyo "annieyo (1 commits)")[![brusch](https://avatars.githubusercontent.com/u/142037?v=4)](https://github.com/brusch "brusch (1 commits)")[![danielecolangelo](https://avatars.githubusercontent.com/u/4224437?v=4)](https://github.com/danielecolangelo "danielecolangelo (1 commits)")[![deenison](https://avatars.githubusercontent.com/u/1078316?v=4)](https://github.com/deenison "deenison (1 commits)")

---

Tags

dailymotionembed-videosfacebookhtml-embeddableinstagramoembedphptwittervimeoyoutubeinstagramyoutubetwittervimeoembedoembedAuto embedvineEmbed TextUrl EmbedResponsive Embeds

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[embed/embed

PHP library to retrieve page info using oembed, opengraph, etc

2.2k11.9M117](/packages/embed-embed)[wrav/oembed

A simple plugin to extract media information from websites, like youtube videos, twitter statuses or blog articles.

36208.3k3](/packages/wrav-oembed)[spicyweb/craft-embedded-assets

Manage YouTube videos, Instagram photos and more as first class assets

170450.6k12](/packages/spicyweb-craft-embedded-assets)[benjamminf/craft-embedded-assets

Manage YouTube videos, Instagram photos and more as first class assets

17013.1k](/packages/benjamminf-craft-embedded-assets)[jamband/ripple

Get a track/album information from the URL.

105.0k](/packages/jamband-ripple)[cohensive/oembed

Media embed generation using OEmbed protocol.

3680.0k1](/packages/cohensive-oembed)

PHPackages © 2026

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