Download the PHP package glebsky/dota2-api without Composer
On this page you can find all versions of the php package glebsky/dota2-api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package dota2-api
DotA2-Api
About
-
What is it? This is PHP code for processing DotA 2 API-requests.
-
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".
- 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 via Composer: `
or
composer require glebsky/dota2-api
-
Connect to your mysql-server with any tool (phpmyadmin, heidisql etc) and execute code from the file db_latest.sql.
- Initialize Dota2-Api like this: ``
Requests
| Type | URL |
|---|---|
| Supported | |
| GetMatchHistory | https://api.steampowered.com/IDOTA2Match_570/GetMatchHistory/v001/ |
| GetMatchDetails | https://api.steampowered.com/IDOTA2Match_570/GetMatchDetails/v001/ |
| GetPlayerSummaries | https://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/ |
| GetLeagueListing | https://api.steampowered.com/IDOTA2Match_570/GetLeagueListing/v0001/ |
| GetLiveLeagueGames | https://api.steampowered.com/IDOTA2Match_570/GetLiveLeagueGames/v0001/ |
| GetTeamInfoByTeamID | https://api.steampowered.com/IDOTA2Match_570/GetTeamInfoByTeamID/v001/ |
| GetHeroes | https://api.steampowered.com/IEconDOTA2_570/GetHeroes/v0001/ |
| GetTournamentPrizePool | https://api.steampowered.com/IEconDOTA2_570/GetTournamentPrizePool/v1/ |
| GetGameItems | https://api.steampowered.com/IEconDOTA2_570/GetGameItems/v0001/ |
| Unsupported | |
| EconomySchema | https://api.steampowered.com/IEconItems_570/GetSchema/v0001/ |
| GetMatchHistoryBySequenceNum | https://api.steampowered.com/IDOTA2Match_570/GetMatchHistoryBySequenceNum/v0001/ |
How to use it
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
$match - it's an object with all match data including slots info, ability-upgrades (if provided) and pick, bans (if cm-mode).
Save match-info in the database
matchMapperDb will check if match with $match->get('match_id') exists in the db and select method for save (insert or update).
Work with match-object
I want get last 25 matches with some player
``
Get player info
`` Player's id you can get via Player::convertId('xxxxx') method (xxxxx - its DotA ID).
Get team info
``
Get current heroes list
`` $heroes - array with numeric indexes (heroes ids)
Get current items list
``
Save received from web items list to db
``
Get current items list from db
``
Get leagues list
`` $leagues - array with numeric indexes (leagues ids)
Get leagues prize pool
``
``
Get live leagues matches
`` $games - array of live_match objects
Get matches from local db
``
Delete match(es) from local db
``
Get info about abilities, heroes, items, games mods, lobby types etc
``
Get map with barracks and towers
``
Get info about players from db
or for just getting one player, you can also use
Save info about players into db
``
Work with UGC Objects
``
Thanks
Updated By Glebsky