PHPackages                             kronusme/dota2-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. kronusme/dota2-api

ActiveLibrary[API Development](/categories/api)

kronusme/dota2-api
==================

DotA 2 Web API PHP wrapper

2.2.1(9y ago)4782.7k252[12 issues](https://github.com/kronusme/dota2-api/issues)[4 PRs](https://github.com/kronusme/dota2-api/pulls)MITPHPPHP &gt;5.2

Since Jul 10Pushed 5y ago66 watchersCompare

[ Source](https://github.com/kronusme/dota2-api)[ Packagist](https://packagist.org/packages/kronusme/dota2-api)[ RSS](/packages/kronusme-dota2-api/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (7)Dependencies (5)Versions (8)Used By (0)

\#DotA2-Api

[![Build Status](https://camo.githubusercontent.com/53b232a396c20c180ebe774a822049d450fd60cb435e6f739aaffa1d7589c1b3/68747470733a2f2f7472617669732d63692e6f72672f6b726f6e75736d652f646f7461322d6170692e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/kronusme/dota2-api)[![Coverage Status](https://camo.githubusercontent.com/54e15ba16cfd62df51fac5780cf1a2c2e3154fa3d4b8dd750282d29546c439c8/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6b726f6e75736d652f646f7461322d6170692f62616467652e706e673f6272616e63683d6d6173746572)](https://coveralls.io/r/kronusme/dota2-api?branch=master)[![License](https://camo.githubusercontent.com/3f5a45ad2562885abf6e8411fbbbda29df40e06edfeb61b8886f4b2b9689529f/68747470733a2f2f706f7365722e707567782e6f72672f6b726f6e75736d652f646f7461322d6170692f6c6963656e73652e737667)](https://packagist.org/packages/kronusme/dota2-api)[![Latest Stable Version](https://camo.githubusercontent.com/4322e555edca2bb5ec006ada5a3b86ee6af42fe9f8df36870377ebab5f0f19fe/68747470733a2f2f706f7365722e707567782e6f72672f6b726f6e75736d652f646f7461322d6170692f762f737461626c652e737667)](https://packagist.org/packages/kronusme/dota2-api)[![Dependencies](https://camo.githubusercontent.com/9ebd387d8a0539e9e8b514074baf05509f082251208d2e05a35a5e4a3ac1e3da/68747470733a2f2f7777772e76657273696f6e6579652e636f6d2f757365722f70726f6a656374732f3534363965643836613736306365376263383030303032372f62616467652e737667)](https://www.versioneye.com/user/projects/5469ed86a760ce7bc8000027)[![Code Climate](https://camo.githubusercontent.com/08f4f7ef2b6fd624adaea78fa0fc1f93bd06ca6c705304ad24f4aa994eb533a8/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f6b726f6e75736d652f646f7461322d6170692f6261646765732f6770612e737667)](https://codeclimate.com/github/kronusme/dota2-api)

### About

[](#about)

1. **What is it?**This is PHP code for processing DotA 2 API-requests.
2. **What can it do?**It can get match-list for some criteria, get match-info for single match, get steam-profile info for users. AND save all this data in MySQL database. For more information see - "How to use it".
3. **What I need to work with it?**First of all you need web-server with **PHP 5.3+** ( **PDO** and **cURL** should be enabled) and **MySQL 5**. Then look at install section.

### Install

[](#install)

1. Install via [Composer](http://getcomposer.org/):

```
{
    "require": {
        "kronusme/dota2-api": "2.2.1"
    }
}
```

2. Connect to your mysql-server with any tool (phpmyadmin, heidisql etc) and execute code from the file **db\_latest.sql**.
3. Initialize Dota2-Api like this:

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

use Dota2Api\Api;

Api::init('YOUR_API_KEY', array('localhost', 'root', 'password', 'db_name', 'table_prefix_'));
```

### Requests

[](#requests)

TypeURL**Supported**GetMatchHistory[https://api.steampowered.com/IDOTA2Match\_570/GetMatchHistory/v001/](https://api.steampowered.com/IDOTA2Match_570/GetMatchHistory/v001/)GetMatchDetails[https://api.steampowered.com/IDOTA2Match\_570/GetMatchDetails/v001/](https://api.steampowered.com/IDOTA2Match_570/GetMatchDetails/v001/)GetPlayerSummariesGetLeagueListing[https://api.steampowered.com/IDOTA2Match\_570/GetLeagueListing/v0001/](https://api.steampowered.com/IDOTA2Match_570/GetLeagueListing/v0001/)GetLiveLeagueGames[https://api.steampowered.com/IDOTA2Match\_570/GetLiveLeagueGames/v0001/](https://api.steampowered.com/IDOTA2Match_570/GetLiveLeagueGames/v0001/)GetTeamInfoByTeamID[https://api.steampowered.com/IDOTA2Match\_570/GetTeamInfoByTeamID/v001/](https://api.steampowered.com/IDOTA2Match_570/GetTeamInfoByTeamID/v001/)GetHeroes[https://api.steampowered.com/IEconDOTA2\_570/GetHeroes/v0001/](https://api.steampowered.com/IEconDOTA2_570/GetHeroes/v0001/)GetTournamentPrizePool[https://api.steampowered.com/IEconDOTA2\_570/GetTournamentPrizePool/v1/](https://api.steampowered.com/IEconDOTA2_570/GetTournamentPrizePool/v1/)GetGameItems[https://api.steampowered.com/IEconDOTA2\_570/GetGameItems/v0001/](https://api.steampowered.com/IEconDOTA2_570/GetGameItems/v0001/)**Unsupported**EconomySchema[https://api.steampowered.com/IEconItems\_570/GetSchema/v0001/](https://api.steampowered.com/IEconItems_570/GetSchema/v0001/)GetMatchHistoryBySequenceNum[https://api.steampowered.com/IDOTA2Match\_570/GetMatchHistoryBySequenceNum/v0001/](https://api.steampowered.com/IDOTA2Match_570/GetMatchHistoryBySequenceNum/v0001/)### How to use it

[](#how-to-use-it)

#### IMPORTANT!

[](#important)

Before parsing and saving leagues matches to your DB, make sure that you've saved leagues to the DB (using `leaguesMapperWeb`! If you try to save some "public" matches, you should REMOVE `foreign key` for field `leagueid` in the table `matches`!

#### Load some match-info

[](#load-some-match-info)

```
