Answer the question
In order to leave comments, you need to log in
Why does steam api return empty json?
Good day.
I've never had this problem before, maybe someone can help me.
Using the standard request to get profile stats ( api.steampowered.com/ISteamUser/GetPlayerSummaries... ) api returns empty json {'response': {'players': []}}
However, if you just paste the same line in the browser - json is filled and looks like it should (which confirms the validity of the web api key ).
I even took a few simple projects from github for the sake of testing - history repeats itself. empty json. This is definitely not a code error.
What could be the problem?
UPD:
def sendreq(steam_id):
params = {
"key":apikey,
"steamids": steam_id,
"format":"json"
}
url = 'http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/'
r = requests.get(url, params=params)
data = r.json()
Answer the question
In order to leave comments, you need to log in
The catch seems to be your choice of steamid, it looks like no such user exists.
I take your code and run it with my apikey and steamid 76561197960435530 and get the usual json like in the browser.
If you are still sure that the problem is not on your side - write to Steam support, but in general, it's better to find the error yourself;)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question