Php code for fetching data from apis