PHPackages                             askancy/metacritic-api-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. [API Development](/categories/api)
4. /
5. askancy/metacritic-api-php

ActiveLibrary[API Development](/categories/api)

askancy/metacritic-api-php
==========================

PHP API scraper for Metacritic game scores, returns JSON data.

1.0(11mo ago)14MITPHPPHP ^8.1CI failing

Since Jun 4Pushed 11mo agoCompare

[ Source](https://github.com/Askancy/Metacritic-api-php)[ Packagist](https://packagist.org/packages/askancy/metacritic-api-php)[ RSS](/packages/askancy-metacritic-api-php/feed)WikiDiscussions main Synced 1mo ago

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

🎮 Metacritic API PHP
====================

[](#-metacritic-api-php)

**Level up your apps** with real-time Metacritic scores using this lightweight PHP package.
No API keys, no rate limits — just smart scraping and structured JSON output. 🧠⚡

---

📦 Install &amp; Deploy
----------------------

[](#-install--deploy)

Install it via Composer and get your first score in less than 60 seconds:

```
composer require askancy/metacritic-api-php
```

---

🕹️ How to Play (Usage)
----------------------

[](#️-how-to-play-usage)

```
require 'vendor/autoload.php';

use Askancy\Metacritic\MetacriticScraper;
use Askancy\Metacritic\Exceptions\MetacriticException;

$scraper = new MetacriticScraper();

try {
    $result = $scraper->fetch('elden-ring'); // Use the Metacritic slug
    echo json_encode($result, JSON_PRETTY_PRINT);
} catch (MetacriticException $e) {
    echo "💥 Error: " . $e->getMessage();
}
```

🧠 **Pro Tip:** You can pass any valid slug like `'god-of-war-ragnarok'`, `'cyberpunk-2077'`, `'final-fantasy-vii-remake'`, etc.

---

🧾 Sample JSON Response
----------------------

[](#-sample-json-response)

```
{
  "slug": "elden-ring",
  "url": "https://www.metacritic.com/game/elden-ring",
  "score": "96"
}
```

- `slug`: Slug used to build the URL
- `url`: Full Metacritic link to the game page
- `score`: Metacritic metascore (0-100)

---

🧪 Unit Testing (PHPUnit)
------------------------

[](#-unit-testing-phpunit)

Run the full test suite to validate your setup:

```
composer install
vendor/bin/phpunit tests/
```

✅ Includes:

- Score presence and format check
- Proper exception handling on 404 pages
- JSON serialization test

---

🛠️ Directory Structure
----------------------

[](#️-directory-structure)

```
metacritic-api-php/
├── src/
│   ├── MetacriticScraper.php        # Main class
│   └── Exceptions/
│       └── MetacriticException.php  # Custom error
├── tests/
│   └── MetacriticScraperTest.php    # PHPUnit test
├── composer.json
├── README.md

```

---

🧙‍♂️ Advanced Features
----------------------

[](#‍️-advanced-features)

- ✅ No API key required
- ⚠️ Graceful error handling (timeouts, 404s)
- 🧩 Easily extendable to retrieve more metadata (e.g., platforms, release date)
- 🕵️‍♀️ Smart fallback: if JSON-LD fails, uses HTML metascore node

---

🧠 Game Dev Friendly
-------------------

[](#-game-dev-friendly)

This package is perfect for:

- Game databases 🗃️
- Gaming communities 🧑‍🤝‍🧑
- Game recommendation engines 🤖
- Gamified profiles or dashboards 📊

---

📜 License
---------

[](#-license)

This package is licensed under the [MIT License](LICENSE), with one twist:

> ❌ Redistribution and reselling is NOT allowed. 🔁 Contributions and improvements are always welcome.

---

🔗 Credits &amp; Contact
-----------------------

[](#-credits--contact)

Made with ❤️ by [Askancy](https://github.com/askancy)For support, bugs or PRs: GitHub Issues

---

> 💬 *"Always check the score, before you hit Play."* 🎮

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance51

Moderate activity, may be stable

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 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

349d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0774a513bb5b13d7d314c88cbce01726eddb0e4282a0899116ab3ece887ceda6?d=identicon)[Askancy](/maintainers/Askancy)

---

Top Contributors

[![Askancy](https://avatars.githubusercontent.com/u/789702?v=4)](https://github.com/Askancy "Askancy (6 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/askancy-metacritic-api-php/health.svg)

```
[![Health](https://phpackages.com/badges/askancy-metacritic-api-php/health.svg)](https://phpackages.com/packages/askancy-metacritic-api-php)
```

###  Alternatives

[craftcms/cms

Craft CMS

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

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[sleeping-owl/apist

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

3105.3k](/packages/sleeping-owl-apist)[sproutcms/cms

Enterprise content management and framework

241.6k4](/packages/sproutcms-cms)

PHPackages © 2026

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