PHPackages                             theconcepteur/ogame-public-api - 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. theconcepteur/ogame-public-api

ActiveLibrary[API Development](/categories/api)

theconcepteur/ogame-public-api
==============================

Ogame Class for use public ogame api

05PHP

Since Jul 22Pushed 4y ago1 watchersCompare

[ Source](https://github.com/th3conc3pt3ur/ogame-public-api)[ Packagist](https://packagist.org/packages/theconcepteur/ogame-public-api)[ RSS](/packages/theconcepteur-ogame-public-api/feed)WikiDiscussions master Synced 6d ago

READMEChangelogDependenciesVersions (1)Used By (0)

Ogame Public Api Class
======================

[](#ogame-public-api-class)

PHP class for retreive info on the GameForge's OGame public api

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

[](#installation)

`composer require theconcepteur/ogame-public-api:dev-master`

Usage
-----

[](#usage)

the class contruct take 3 arguments : number of the server,locale, and boolean for activated the cache or not (strongly recommanded !)

```
use OgamePublicApi\OgamePublicApi;
$og = new OgamePublicApi(179,'fr',true);
```

API
---

[](#api)

Get list of player (call at init)

```
$og->getPlayers()
```

Get list of Alliances (call at init)

```
$og->getAlliances
```

Retrieve info about Planet and Moon of the Player with id = $id

```
$og->getPlayerData($id)
```

With cache system on, you can retrieves player data along with his planets and moon in one call :

```
$og->getPlayer($id)
```

Cache System
------------

[](#cache-system)

This class provide a built-in cache system. 2 cache file type exist : `xml` and `json`

`xml` cache the ogame api file

`json` cache the internal system file

At class init we build the alliances and players list, and we pre-create the `player_X.json` file.

When we call the `$og->getPlayerData($id)` we write the `xml` file of this call AND we update the `player_X.json` with this data.

This way we have a complete file with all players data.

Each api call have a related files and this files have different cache expiration time. This time is configure in the `cacheValid` function accordingly to the info we have on the official interval.

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity29

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/9545d66ec20b78b3683777b018e7e1caf8361fdfb28bbc2534f5ea5f8427311c?d=identicon)[th3conc3pt3ur](/maintainers/th3conc3pt3ur)

---

Top Contributors

[![th3conc3pt3ur](https://avatars.githubusercontent.com/u/1927030?v=4)](https://github.com/th3conc3pt3ur "th3conc3pt3ur (2 commits)")

### Embed Badge

![Health badge](/badges/theconcepteur-ogame-public-api/health.svg)

```
[![Health](https://phpackages.com/badges/theconcepteur-ogame-public-api/health.svg)](https://phpackages.com/packages/theconcepteur-ogame-public-api)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

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