PHPackages                             anlutro/sc2ranks-v2 - 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. anlutro/sc2ranks-v2

AbandonedArchivedLibrary[API Development](/categories/api)

anlutro/sc2ranks-v2
===================

PHP implementation of SC2Ranks API V2

1.1.1(12y ago)5331MITPHPPHP &gt;=5.3.0

Since Aug 25Pushed 12y ago1 watchersCompare

[ Source](https://github.com/anlutro/sc2ranks-v2)[ Packagist](https://packagist.org/packages/anlutro/sc2ranks-v2)[ Docs](https://github.com/anlutro/sc2ranks-v2)[ RSS](/packages/anlutro-sc2ranks-v2/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependencies (2)Versions (7)Used By (0)

SC2Ranks v2 API - PHP implementation
====================================

[](#sc2ranks-v2-api---php-implementation)

[![Build Status](https://camo.githubusercontent.com/8d86253be114196dfc06a10fe594b9b2ce62a3ed01d3a99ff5040fa56d8968f1/68747470733a2f2f7472617669732d63692e6f72672f616e6c7574726f2f73633272616e6b732d76322e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/anlutro/sc2ranks-v2)

A simple object-oriented implementation of the second version of SC2Ranks API. The implementation parses JSON returned from the SC2Ranks API server and doesn't do anything to manipulate it. Check out the [API documentation](http://www.sc2ranks.com/api) for information on how the returned data is structured.

Package is still in development and can't be considered stable, but should be functional. Please report any problems via the Github issues page.

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

[](#installation)

Install as a [Composer](http://getcomposer.org) package: `composer require anlutro\sc2ranks-v2:dev-master`

Usage
-----

[](#usage)

```
$sc2r = new \anlutro\SC2Ranks\SC2Ranks('my_api_key');

$player = $sc2r->getPlayerFromProfileUrl('http://eu.battle.net/sc2/en/profile/180786/1/Raziel/');

try {
	$teams = $sc2r->getPlayerTeams($player);
	var_dump($teams);
} catch (\anlutro\SC2Ranks\SC2RanksException $e) {
	echo $e->getMessage();
}
```

Functions
---------

[](#functions)

- `setDefault(array $array)` Pass an array of default values for league, region, bracket and expansion.
- `returnArray()` Return associative arrays instead of objects.
- `getRemainingCredits()` See how many remaining credits for API calls you have.
- `getsumCreditsSpent()` Get the sum of credits spent during the class's lifetime.
- `getCreditsSpentLast()` Get how many credits were spent on the last request.
- `getCreditsSpent()` Get an array of the calls ran and how many credits were spent on each.
- `getPlayerFromProfileUrl($url)` Get a Player object from a Battle.net or SC2Ranks profile URL.
- `createPlayer($region, $bnetId)` Get a Player object from region and Battle.net ID.
- `getPlayerCharacter(Player $player)` Get the character of a player.
- `getPlayerTeams(Player $player, $options = array())` Get the teams of a player.
- `searchCharacter($name, $options = array())` Search SC2Ranks for a name.
- `getBulkCharacters(array $players)` Get a large number of characters. Must be an array of Player objects.
- `getBulkTeams(array $players, array $options = array())` Get a large number of teams.
- `getClanInfo($region, $tag, $options = array())` Get info about a clan.
- `getClanCharacters($region, $tag, $options = array())` Get the characters of a clan's members.
- `getClanTeams($region, $tag, $options = array())` Get the teams of a clan's members.
- `getDivisionInfo($divId)` Get information on a division.
- `getDivisionTeams($divId, $limit = 10)` Get the teams of a division.
- `getCdivInfo($cdivId)` Get information on a custom division.
- `getCdivTeams($divId, $options = array())` Get the teams in a custom division.
- `getCdivCharacters($divId, $options = array())` Get the characters of a custom division.
- `addCdivPlayer($divId, Player $player)` Add a player to a custom division.
- `removeCdivPlayer($divId, Player $player)` Remove a player from a custom division.
- `addCdivPlayers` and `removeCdivPlayers` can be used in the same way, but you can pass an array of Player objects to add/remove more than one at the time.

Contact
=======

[](#contact)

Open an issue on GitHub if you have any problems or suggestions.

If you have any questions or want to have a chat, look for anlutro @ chat.freenode.net.

License
=======

[](#license)

The contents of this repository is released under the [MIT license](http://opensource.org/licenses/MIT).

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity62

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 ~13 days

Total

6

Last Release

4623d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/48f62855097c02888b96494da9a389988cd7ecb9001465f8ec30f15672fb5b5a?d=identicon)[anlutro](/maintainers/anlutro)

---

Top Contributors

[![anlutro](https://avatars.githubusercontent.com/u/163093?v=4)](https://github.com/anlutro "anlutro (19 commits)")

---

Tags

starcraft

### Embed Badge

![Health badge](/badges/anlutro-sc2ranks-v2/health.svg)

```
[![Health](https://phpackages.com/badges/anlutro-sc2ranks-v2/health.svg)](https://phpackages.com/packages/anlutro-sc2ranks-v2)
```

###  Alternatives

[hubspot/api-client

Hubspot API client

24015.5M18](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172437.8k11](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

94452.6k6](/packages/botman-driver-telegram)[anlutro/bulk-sms

BulkSMS API implementation in PHP.

3727.1k](/packages/anlutro-bulk-sms)

PHPackages © 2026

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