MSFT Stock Price:

setRequestUrl('https://alpha-vantage.p.rapidapi.com/query'); $request->setRequestMethod('GET'); $request->setQuery(new http\QueryString([ 'function' => 'TIME_SERIES_DAILY', 'symbol' => 'MSFT', 'outputsize' => 'compact', 'datatype' => 'json' ])); $request->setHeaders([ 'x-rapidapi-key' => 'b3b607624emshcdc6d945026a7e2p14c73bjsnedf86c1014f0', 'x-rapidapi-host' => 'alpha-vantage.p.rapidapi.com' ]); $client->enqueue($request)->send(); $response = $client->getResponse(); $data = json_decode($response->getBody(), true); $stockPrice = $data['Time Series (Daily)'][date('Y-m-d')]['4. close']; ?>