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

ActiveLibrary[API Development](/categories/api)

glebsky/dota2-api
=================

DotA 2 Web API PHP wrapper

2.2.2(5y ago)011MITPHPPHP &gt;5.2

Since Jul 10Pushed 5y agoCompare

[ Source](https://github.com/Glebsky/dota2-api)[ Packagist](https://packagist.org/packages/glebsky/dota2-api)[ RSS](/packages/glebsky-dota2-api/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (5)Versions (10)Used By (0)

### DotA2-Api

[](#dota2-api)

[![Latest Stable Version](https://camo.githubusercontent.com/fdd34ae37c2c19cc1644bcc3f34dc2398bcebd46209b39eb18ea49e5f1179098/68747470733a2f2f706f7365722e707567782e6f72672f676c6562736b792f646f7461322d6170692f76)](//packagist.org/packages/glebsky/dota2-api) [![Total Downloads](https://camo.githubusercontent.com/af26181565f8ee5f88568c25fb519532632066a9fd5ca1e8a449523dbaa2af51/68747470733a2f2f706f7365722e707567782e6f72672f676c6562736b792f646f7461322d6170692f646f776e6c6f616473)](//packagist.org/packages/glebsky/dota2-api) [![Latest Unstable Version](https://camo.githubusercontent.com/06d2dd98269618a934c8b8412f7587ee5629cfff8e2b89fa170c27f12aa91f41/68747470733a2f2f706f7365722e707567782e6f72672f676c6562736b792f646f7461322d6170692f762f756e737461626c65)](//packagist.org/packages/glebsky/dota2-api) [![License](https://camo.githubusercontent.com/13d524c91b4a091670c98126ba2e08f1b6b2380e69e46948c0869bdb1ac71e4b/68747470733a2f2f706f7365722e707567782e6f72672f676c6562736b792f646f7461322d6170692f6c6963656e7365)](//packagist.org/packages/glebsky/dota2-api)[![Coverage Status](https://camo.githubusercontent.com/24141af146b79087c1cbe5e8da49b9dc90c14a797fbb05345170093258746be5/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f476c6562736b792f646f7461322d6170692f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/Glebsky/dota2-api?branch=master)

### 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": {
        "glebsky/dota2-api": "2.2.2"
    }
}
```

or

`composer require glebsky/dota2-api`

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)

```
