PHPackages                             nellyt/free-to-game-api-wrapper - 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. nellyt/free-to-game-api-wrapper

ActiveLibrary[API Development](/categories/api)

nellyt/free-to-game-api-wrapper
===============================

Wrapper for API https://www.freetogame.com

v1.0.2(5y ago)118MITPHPPHP ^7.4|^8.0

Since Feb 28Pushed 5y ago1 watchersCompare

[ Source](https://github.com/nialltiernan/freetogame-api-wrapper)[ Packagist](https://packagist.org/packages/nellyt/free-to-game-api-wrapper)[ RSS](/packages/nellyt-free-to-game-api-wrapper/feed)WikiDiscussions master Synced yesterday

READMEChangelog (3)Dependencies (6)Versions (4)Used By (0)

Wrapper for FreeToGame API
==========================

[](#wrapper-for-freetogame-api)

[![Latest Stable Version](https://camo.githubusercontent.com/4cdb863ab0cd08ae914891a43c1a0d011199d8d2016e114c4a7328a15f2cbe60/68747470733a2f2f706f7365722e707567782e6f72672f6e656c6c79742f667265652d746f2d67616d652d6170692d777261707065722f76)](//packagist.org/packages/nellyt/free-to-game-api-wrapper)[![Total Downloads](https://camo.githubusercontent.com/effb99135d396aaa4f660c22ad568fddeae8e48d2f36b4a707f15e5e20951651/68747470733a2f2f706f7365722e707567782e6f72672f6e656c6c79742f667265652d746f2d67616d652d6170692d777261707065722f646f776e6c6f616473)](//packagist.org/packages/nellyt/free-to-game-api-wrapper)[![Latest Unstable Version](https://camo.githubusercontent.com/8f6f8bde9552f07aff824bbfcaefa9bf1047c3b45c58cec22a618c8fe28344d7/68747470733a2f2f706f7365722e707567782e6f72672f6e656c6c79742f667265652d746f2d67616d652d6170692d777261707065722f762f756e737461626c65)](//packagist.org/packages/nellyt/free-to-game-api-wrapper)[![License](https://camo.githubusercontent.com/95a737a1a10a1c8b677595d5505fd8636d3165a1291d3062ee2f42d62d1fafee/68747470733a2f2f706f7365722e707567782e6f72672f6e656c6c79742f667265652d746f2d67616d652d6170692d777261707065722f6c6963656e7365)](//packagist.org/packages/nellyt/free-to-game-api-wrapper)

This is a PHP wrapper for the [FreeToGame API](https://www.freetogame.com/api-doc)

Basic installation
------------------

[](#basic-installation)

You can install this package via composer using:

```
composer require nellyt/free-to-game-api-wrapper
```

Usage
-----

[](#usage)

### Basic

[](#basic)

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

$client = new \FreeToGame\Client();

$response = $client->fetchList();
$response = $client->fetchDetails($gameId);

$response->getResponse()->getStatusCode();

$response->getData();
```

### Filters

[](#filters)

Filters are used when fetching lists of games. There are three types of filter:

1. Platform
2. Category
3. Tags

Filters are added to a *FilterCollection* instance, which is passed to the client.

#### Platform filters

[](#platform-filters)

```
$platformFilter = new \FreeToGame\Filters\PlatformFilter(new \FreeToGame\Filters\Platforms\Browser());

$filterCollection = new \FreeToGame\Filters\FilterCollection();
$filterCollection->setPlatformFilter($platformFilter);

$response = $client->fetchList($filterCollection);
```

#### Category / Tag filters

[](#category--tag-filters)

Lists of games can be filtered by **category or tags**, not both. Tag filters require an array of *SearchTerms*, while category filters accept only one.

##### Category

[](#category)

```
$categoryFilter = new \FreeToGame\Filters\CategoryFilter(new \FreeToGame\Filters\SearchTerms\Shooter());

$filterCollection = new \FreeToGame\Filters\FilterCollection();
$filterCollection->setCategoryFilter($categoryFilter);

$response = $client->fetchList($filterCollection);
```

##### Tag

[](#tag)

```
$searchTerms = [
    new \FreeToGame\Filters\SearchTerms\Shooter(),
    new \FreeToGame\Filters\SearchTerms\Strategy(),
    new \FreeToGame\Filters\SearchTerms\Racing(),
];

$tagFilter = new \FreeToGame\Filters\TagFilter($searchTerms);
$filterCollection = new \FreeToGame\Filters\FilterCollection();
$filterCollection->setTagFilter($tagFilter);

$response = $client->fetchList($filterCollection);
```

###### Tag helper

[](#tag-helper)

There are two helper functions available to assist build the array of *SearchTerms*.

```
$shooter = \FreeToGame\Helpers\SearchTermFactory::getSearchTerm('shooter');
$searchTerms = \FreeToGame\Helpers\SearchTermFactory::getSearchTerms(['shooter', 'zombie', 'permadeath']);
```

### Sort By

[](#sort-by)

Lists of games can be sorted.

```
$sort = new \FreeToGame\Sort\AlphabeticalSort();

$response = $client->fetchList(null, $sort);
```

### Example: multiple filters and sorted

[](#example-multiple-filters-and-sorted)

```
$platformFilter = new \FreeToGame\Filters\PlatformFilter(new \FreeToGame\Filters\Platforms\Browser());

$searchTerms = [
    new \FreeToGame\Filters\SearchTerms\Shooter(),
    new \FreeToGame\Filters\SearchTerms\Strategy(),
    new \FreeToGame\Filters\SearchTerms\Racing(),
];
$tagFilter = new \FreeToGame\Filters\TagFilter($searchTerms);

$filterCollection = new \FreeToGame\Filters\FilterCollection();
$filterCollection->setPlatformFilter($platformFilter);
$filterCollection->setTagFilter($tagFilter);

$sort = new \FreeToGame\Sort\AlphabeticalSort();

$response = $client->fetchList($filterCollection, $sort);
```

### Sort Options

[](#sort-options)

The list of sorting options is:

1. AlphabeticalSort
2. PopularitySort
3. ReleaseDateSort
4. RelevanceSort
5. Sort

### Search Terms

[](#search-terms)

The list of search terms is:

1. Action
2. ActionRolePlayingGame
3. Anime
4. BattleRoyale
5. Card
6. Fantasy
7. Fighting
8. FirstPerson
9. Flight
10. Horror
11. LowSpecifications
12. MartialArts
13. MassivelyMultiplayerOnline
14. MassivelyMultiplayerOnlineFirstPersonShooter
15. MassivelyMultiplayerOnlineRealTimeStrategy
16. MassivelyMultiplayerOnlineRolePlayingGame
17. MassivelyMultiplayerOnlineThirdPersonShooter
18. Military
19. MultiplayerOnlineBattleArena
20. OpenWorld
21. Permadeath
22. Pixel
23. PlayerVersusEnvironment
24. PlayerVersusPlayer
25. Racing
26. Sailing
27. Sandbox
28. ScienceFiction
29. SearchTerm
30. Shooter
31. SideScroller
32. Social
33. Space
34. Sports
35. Strategy
36. Superhero
37. Survival
38. Tank
39. ThirdPerson
40. ThreeDimensions
41. TopDown
42. TowerDefense
43. TurnBased
44. TwoDimensions
45. Voxel
46. Zombie

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity60

Established project with proven stability

 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

Every ~4 days

Total

3

Last Release

1890d ago

PHP version history (2 changes)v1.0.0PHP ^8.0

v1.0.1PHP ^7.4|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/681d75ba6f2934ef43931bc444e7db114cf5e2a9cf8ccf0b029bfc99583fc85c?d=identicon)[nellyt](/maintainers/nellyt)

---

Top Contributors

[![nialltiernan](https://avatars.githubusercontent.com/u/50250171?v=4)](https://github.com/nialltiernan "nialltiernan (5 commits)")

---

Tags

Api Wrapperfree to game

###  Code Quality

TestsCodeception

### Embed Badge

![Health badge](/badges/nellyt-free-to-game-api-wrapper/health.svg)

```
[![Health](https://phpackages.com/badges/nellyt-free-to-game-api-wrapper/health.svg)](https://phpackages.com/packages/nellyt-free-to-game-api-wrapper)
```

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[fiveam-code/laravel-notion-api

Laravel Wrapper for the Notion API

435224.4k1](/packages/fiveam-code-laravel-notion-api)[marcreichel/igdb-laravel

A Laravel wrapper for version 4 of the IGDB API (Apicalypse) including webhook handling

115146.6k1](/packages/marcreichel-igdb-laravel)[otherguy/php-currency-api

A PHP API Wrapper to offer a unified programming interface for popular Currency Rate APIs.

2526.2k](/packages/otherguy-php-currency-api)[grok-php/client

Grok PHP Client is a robust and community-driven PHP client library for seamless integration with Grok AI API, offering efficient access to advanced AI and data processing capabilities.

325.9k4](/packages/grok-php-client)

PHPackages © 2026

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