J
J
Jay Marlow2016-10-06 20:12:20
Python
Jay Marlow, 2016-10-06 20:12:20

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()

I'm sure it's not the code that's the problem, because I've tried many different ways, including working projects from github - empty json is returned everywhere.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
Berloga, 2016-10-07
@kolumbou

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 question

Ask a Question

731 491 924 answers to any question