Jump to content

Simple download


ameliabob
 Share

Recommended Posts

I am trying to get a url that returns a json file but nothing seems to work nor do I get any errors

	<html>
<body>
<h1>Trial of getting url</h1>
<?php
echo "Hello World!";
$url = "https://api.iextrading.com/1.0/stock/market/batch?types=quote&filter=symbol,companyName,latestPrice,latestSource&symbols=AMD,APVO,DHI,ERI,GERN,LUV,LX,NVCR,TAP,WAR";
$url="https://www.espn.com";
	$ans = fopen($url, "r");
	?>
	</body>
</html>
	

It should return the following:

AMD  
quote  
symbol "AMD"
companyName "Advanced Micro Devices Inc."
latestPrice 15.8
latestSource "Close"
APVO  
quote  
symbol "APVO"
companyName "Aptevo Therapeutics Inc."
latestPrice 5.54
latestSource "Close"
DHI  
quote  
symbol "DHI"
companyName "D.R. Horton Inc."
latestPrice 40.75
latestSource "Close"
ERI  
quote  
symbol "ERI"
companyName "Eldorado Resorts Inc."
latestPrice 44.25
latestSource "Close"
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...