我想獲得的所有項目的價格從DOTA 2 列表使用此代碼:汽市場顯示所有價格項目DOTA 2
<?$urll2 = "http://api.steamapis.com/market/items/570?api_key=******";
enter code here$urljson2 = file_get_contents("$urll2");
$data2 = json_decode($urljson2);
echo $data2;
?>
並顯示此錯誤:
Warning: file_get_contents(http://api.steamapis.com/market/items/570?api_key=4E465E3EC414FE37DAE8357EF7F01863) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.1 401 Unauthorized
* HTTP/1.1 401未經授權*如您所說,您無權獲取內容。檢查你的API密鑰。 – Jer
如果我使用本地主機的API密鑰,在蒸汽我必須把它帶到localhost或不? – Dima
如果直接進入這個URL,它會給我JSON響應:'{「error」:「缺少必需的'api_key'參數。」}'。在'570'後面加上一個問號'?'。 – Jer