我正在使用暴乱游戏的API。
我需要列出所有冠军,并有匹配和其他一些相关的记录。
这是代码
我将通过发送第一个获得所有冠军的请求获得$championInfo
foreach($championsInfo as $key => $value){
global $wpdb;
$API_Booster_ID = $value['champion_id'];
$API_Booster_Name = $value['champion_name'];
$API_Booster_Image = '';
$API_Summoner_ID = $value['summonerid'];
Insert Query Here
/*Spells Loop*/
foreach($value['spells'] as $spellsKey => $spellsValue){
$API_Spells_Name = $spellsValue['name'];
$API_Spells_Key = $spellsValue['key'];
$API_Spells_Image = $spellsValue['image']['full'];
Inserte Query Here
}
foreach($value['matchlist']['matches'] as $matchesKey => $matchesValue){
Need to send API Request based on match id (this will be more then 600 times for every $championInfo Loop)
Insert Query Here
}
}
如何减少API的请求? 如何在API的单个请求中或在有限的请求中获取所有记录?