Raised This Month: $51 Target: $400
 12% 

Using Steam API Web


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
tuty
Veteran Member
Join Date: Jul 2008
Location: UK
Old 03-30-2012 , 06:31   Using Steam API Web
Reply With Quote #1

I took a look in API's dev, but i dunno how to retrieve player avatar via steamid in php.
Could somebody give me an example?

thanks
__________________
tuty is offline
Send a message via ICQ to tuty Send a message via AIM to tuty
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 03-30-2012 , 13:15   Re: Using Steam API Web
Reply With Quote #2

Append "?xml=1" to the end of a profile URL (both custom and normal) and you can grab an XML for that player's profile.
Exolent[jNr] is offline
8088
Veteran Member
Join Date: Jan 2008
Old 03-30-2012 , 18:04   Re: Using Steam API Web
Reply With Quote #3

It's safer to use this API. Examples can be found in the wiki.
__________________
steamID converter with OpenSearch browser plugin
8088 is offline
Dr. McKay
Sir Dr. SourceMod Plugin Approver Esq. Ltd. M.D. PhD
Join Date: Aug 2011
Location: Atlantis
Old 03-30-2012 , 18:59   Re: Using Steam API Web
Reply With Quote #4

PHP Code:
<?php
$apikey 
''// put your API key here
$steamid ''// the community ID of the player to look up

$response file_get_contents('http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key=' $apikey '&steamids=' $steamid);

$json json_decode($responsetrue);

$avatarurl $json['response']['players']['avatarfull']; // there's your avatar
?>
Of course, you will want to implement some kind of caching system or error detection.
__________________
Dr. McKay is offline
bazhenov93
Veteran Member
Join Date: Oct 2010
Old 03-30-2012 , 21:08   Re: Using Steam API Web
Reply With Quote #5

where I can find steam_api.php?
the php I have, the avatar does not work.. I downloaded it here
the ProKreedz 2.27 SQL.zip
bazhenov93 is offline
8088
Veteran Member
Join Date: Jan 2008
Old 03-30-2012 , 21:38   Re: Using Steam API Web
Reply With Quote #6

This thread is about writing your own implementation of the API. If you have a problem with someone else's script, you should contact its author.
__________________
steamID converter with OpenSearch browser plugin
8088 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 15:15.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode