I am using API of riots game.
I need to list all the champions and there matches and some other records related to it.
This is the code
I will get the $championInfo
by sending first request to get all champions
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
}
}
How to reduce the request of API? How should i get all the records in a single request of API or within a limited request?