dsyua2828 2019-04-21 22:06
浏览 70

Steam api用户数据:仅适用于一个蒸汽ID,否则DOESNT WORK

I'm really new to php and doesnt understand much with apis.. I wrote this code:

<?php
$steamkey = "xxxxxxxx"; // censored I use the right steamkey
$id_user = "76561198059606697"; // only this steam id works

$apifr = "http://api.steampowered.com/ISteamUserStats/GetUserStatsForGame/v0002/?appid=730&key=".$steamkey."&steamid=".$id_user;

$data = file_get_contents($apifr); // put the contents of the file into a variable

$test = json_decode($data);

echo print_r($test->playerstats->stats[0]->value, true);
?>

the result is the total_kills of the player steam id:

49999

The result "49999" are the right total_kills of the player in csgo, which actually works just fine, but if I try different steamids it doesnt work anymore...

Could someone please help me and explain why or give another solution to use the steam api for csgo player stats?

Thank you all

I tried more then 10 different right steam ids, however they doesnt work... Some people have names instead of for example "1231943812" as a steam id, it doesnt work too, I dont know how to use the names too

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥188 寻找能做王者评分提取的
    • ¥15 matlab用simulink求解一个二阶微分方程,要求截图
    • ¥30 乘子法解约束最优化问题的matlab代码文件,最好有matlab代码文件
    • ¥15 写论文,需要数据支撑
    • ¥15 identifier of an instance of 类 was altered from xx to xx错误
    • ¥100 反编译微信小游戏求指导
    • ¥15 docker模式webrtc-streamer 无法播放公网rtsp
    • ¥15 学不会递归,理解不了汉诺塔参数变化
    • ¥15 基于图神经网络的COVID-19药物筛选研究
    • ¥30 软件自定义无线电该怎样使用