PHPackages                             yohacoo/ogp-info - 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. yohacoo/ogp-info

ActiveLibrary

yohacoo/ogp-info
================

Library for retrieving OGP information

v1.0.0(8mo ago)01MITPHP

Since Aug 28Pushed 8mo agoCompare

[ Source](https://github.com/yohacoo/ogp-info)[ Packagist](https://packagist.org/packages/yohacoo/ogp-info)[ RSS](/packages/yohacoo-ogp-info/feed)WikiDiscussions main Synced 1mo ago

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

ogp-info
========

[](#ogp-info)

Library for retrieving OGP information via HTTP/HTTPS.

Install
-------

[](#install)

```
composer require yohacoo/ogp-info

```

Or simply copy src/OgpInfo.php to your project.

Usage
-----

[](#usage)

```
require_once('OgpInfo.php');

use Yohacoo\OgpInfo\OgpInfo;

OgpInfo::setCacheDir('/path/to/.ogp-cache');
$info = OgpInfo::retrieve('https://example.com/');

$title = $info->get('og:title', 'title');
$description = $info->get('og:description', 'description');

```

We strongly recommend setting a cache directory. The default cache directory is .ogp-cache under the directory containing OgpInfo.php.

API
---

[](#api)

### OgpInfo-&gt;get(...$keys)

[](#ogpinfo-getkeys)

Get the first non-empty value for keys. If no value exists for the keys, return an empty string ('').

KeyDescriptionog:xxxog:xxx value in &lt;meta property="og:xxx" content="..."&gt;fb:xxxfb:xxx value in &lt;meta property="fb:xxx" content="..."&gt;twitter:xxxtwitter:xxx value in &lt;meta name="twitter:xxx" content="..."&gt;title&lt;title&gt; tag text contentdescriptiondescription value in &lt;meta name="description" content="..."&gt;iconhref value in &lt;link rel="icon" href="..."&gt;
Return the absolute URL if the href starts with '/'.apple-touch-iconhref value in &lt;link rel="apple-touch-icon" href="..."&gt;
Return the absolute URL if the href starts with '/'.### OgpInfo-&gt;getUrl()

[](#ogpinfo-geturl)

Get URL for retrieving information.

### OgpInfo-&gt;getHttpStatus()

[](#ogpinfo-gethttpstatus)

Get HTTP status code.

### OgpInfo-&gt;getTimestamp()

[](#ogpinfo-gettimestamp)

Get timestamp. Returns the number of seconds since the epoch.

### OgpInfo-&gt;isExpired()

[](#ogpinfo-isexpired)

Check whether it has passed the TTL.

Static API
----------

[](#static-api)

### OgpInfo::setCacheDir($dir)

[](#ogpinfosetcachedirdir)

Set the cache directory.

### OgpInfo::retrieve($url)

[](#ogpinforetrieveurl)

Retrieve OGP information via HTTP.

### OgpInfo::setCacheTtl($ttl)

[](#ogpinfosetcachettlttl)

Set the cache TTL.

### OgpInfo::clearCache()

[](#ogpinfoclearcache)

Delete old cache files.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance60

Regular maintenance activity

Popularity1

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity35

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

257d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6ee4dad0633ffbd0d77c173b534d48376a752a191ec834bbe5c716248302f41a?d=identicon)[yohacoo](/maintainers/yohacoo)

---

Top Contributors

[![yohacoo](https://avatars.githubusercontent.com/u/147961070?v=4)](https://github.com/yohacoo "yohacoo (24 commits)")

---

Tags

opengraphogp

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/yohacoo-ogp-info/health.svg)

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

###  Alternatives

[artesaos/seotools

SEO Tools for Laravel and Lumen

3.3k5.1M60](/packages/artesaos-seotools)[embed/embed

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

2.1k11.0M97](/packages/embed-embed)[essence/essence

Extracts information about medias on the web, like youtube videos, twitter statuses or blog articles.

770562.9k3](/packages/essence-essence)[chriskonnertz/open-graph

Class that assists in building Open Graph meta tags

117428.6k3](/packages/chriskonnertz-open-graph)[butschster/meta-tags

The most powerful and extendable tools for managing SEO Meta Tags in your Laravel project

628730.7k2](/packages/butschster-meta-tags)[arcanedev/seo-helper

SEO Helper is a framework agnostic package that provides tools &amp; helpers for SEO (Laravel supported).

332467.0k4](/packages/arcanedev-seo-helper)

PHPackages © 2026

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