• Steam API
    9 replies, posted
Firstly, i've got no idea on anything really to do with coding i just pretty much design, but i really want to mess around with a [url=http://noyte.co.uk/backpackchecker/]TF2 site[/url] that i designed a while ago. It's nothing amazing, and has probably been done before, but i just really want to get familiar with the API and pretty much coding in general. I've read up and down on the Wiki and it's all just a foreign language to me, has anybody got any patience to actually sit down and help me with this?
[url]http://steamcommunity.com/dev[/url] Read up on there. You need to fill out a form to get an API key before you can use it.
[QUOTE=Fear_Fox;29125071][url]http://steamcommunity.com/dev[/url] Read up on there. You need to fill out a form to get an API key before you can use it.[/QUOTE] read through that the other day and got the key, no idea what to do with it though
[url]http://developer.valvesoftware.com/wiki/Steam_Web_API#GetPlayerSummaries_.28v0001.29[/url] Simple REST calls?
[QUOTE=h2ooooooo;29125333][url]http://developer.valvesoftware.com/wiki/Steam_Web_API#GetPlayerSummaries_.28v0001.29[/url] Simple REST calls?[/QUOTE] i sorta get this, what do i do with it though? as i said i really need some explaining on this, i've got no experience with coding what so ever
It depends on what you want to do, if you're planning to grab profile info from users you gotta get their 64bit steamid, then parse the XML, JSON, or VDF. Personally, I prefer JSON as you can easily convert that data to a PHP array. So, heres an example of some code that may be able to get you started [code] $data = file_get_contents("http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0001/?key=YOURAPIKEY&steamids=76561197992486285"); $profile_info = json_decode($data); print_r($profile_info); [/code] Should work. Make sure your host or your own server has JSON installed, most servers do though. Also, you will want to replace 'YOURAPIKEY' in the URL with the key you received when you applied for one on your domain. From there, you can grab anyone's profile info.
[QUOTE=Sassharkey;29153419]It depends on what you want to do, if you're planning to grab profile info from users you gotta get their 64bit steamid, then parse the XML, JSON, or VDF. Personally, I prefer JSON as you can easily convert that data to a PHP array. So, heres an example of some code that may be able to get you started [code] $data = file_get_contents("http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0001/?key=YOURAPIKEY&steamids=76561197992486285"); $profile_info = json_decode($data); print_r($profile_info); [/code] Should work. Make sure your host or your own server has JSON installed, most servers do though. Also, you will want to replace 'YOURAPIKEY' in the URL with the key you received when you applied for one on your domain. From there, you can grab anyone's profile info.[/QUOTE] Since you have no idea about the code (hi noyte) $data means declare a variable called data so he's saying basically set the content of the variable to the JSON data from the steam profile. The $profile_info means he's declaring another variable but this time to the decoded data obtained using json_decode on his earlier declared $data variable. Then print_r($profile_info); basically means display that info in your browser
[QUOTE=:-P;29153657]Since you have no idea about the code (hi noyte) $data means declare a variable called data so he's saying basically set the content of the variable to the JSON data from the steam profile. The $profile_info means he's declaring another variable but this time to the decoded data obtained using json_decode on his earlier declared $data variable. Then print_r($profile_info); basically means display that info in your browser[/QUOTE] If he knows what a variable is then basically everything you just said is as obvious as hell. If he doesn't (which I honestly doubt) then what you just said wouldn't make much sense.
[QUOTE=PieClock;29156306]If he knows what a variable is then basically everything you just said is as obvious as hell. If he doesn't (which I honestly doubt) then what you just said wouldn't make much sense.[/QUOTE] I'm talking to him on steam you dolt, when he said it's a foreign language to him he means it god damn
[QUOTE=Sassharkey;29153419]It depends on what you want to do, if you're planning to grab profile info from users you gotta get their 64bit steamid, then parse the XML, JSON, or VDF. Personally, I prefer JSON as you can easily convert that data to a PHP array. So, heres an example of some code that may be able to get you started [code] $data = file_get_contents("http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0001/?key=YOURAPIKEY&steamids=76561197992486285"); $profile_info = json_decode($data); print_r($profile_info); [/code] Should work. Make sure your host or your own server has JSON installed, most servers do though. Also, you will want to replace 'YOURAPIKEY' in the URL with the key you received when you applied for one on your domain. From there, you can grab anyone's profile info.[/QUOTE] thank you very much for this, i appreciate it, i'm just pretty much figuring out where to put it [QUOTE=PieClock;29156306]If he knows what a variable is then basically everything you just said is as obvious as hell. If he doesn't (which I honestly doubt) then what you just said wouldn't make much sense.[/QUOTE] i did get that yeah, but i've been talking with him in steam and he's been really helpful and helped me a lot with coding
Sorry, you need to Log In to post a reply to this thread.