Andrew Guyton's Blog

On a whim, I decided to make a YQL Open Table for the Steam Web API. It was fairly simple given my previous experience with creating YQL tables. This means you can pull data from Steam using YQL, and combine it with all of the other functionality in YQL. I’ve put them on github and made a pull request, so hopefully they’ll end up in the master list of community tables before long. Here are the files on github: disavian:yql-tables/steam. To use these, drop the commands after the cut into the YQL Console.

Web API

Here are the different functions I’ve implemented. The first three are documented here: Steam Web API. YQL lets you specify the location for a table with the ‘use’ keyword, so I’ve included the locations on github so you can try them.

steam.news.xml

This allows you to get news items for a game.
use 'https://github.com/disavian/yql-tables/raw/master/steam/steam.news.xml' as steam.news; select * from steam.news where appid='440' and maxlength='300'

steam.user.xml

This lets you get information on a user. Note that steam.user requires you to get an API key.
use 'https://github.com/disavian/yql-tables/raw/master/steam/steam.user.xml' as steam.user; select * from steam.user where key='XXXXXXXXXXXXXXXXXXXXXXX' and steamids='76561197960435530'

steam.userstats.xml

This lets you get global achievement stats for a game.
use 'https://github.com/disavian/yql-tables/raw/master/steam/steam.userstats.xml' as steam.userstats; select * from steam.userstats where gameid='440'

Community API

The following functions are from this page: Steam Community Web API.

steam.community.player.profile.xml

This gets a player profile by id:
use 'https://github.com/disavian/yql-tables/raw/master/steam/steam.community.player.profile.xml' as steam.community.player.profile; select * from steam.community.player.profile where id='76561197968575517'

This gets a player profile by custom url:
use 'https://github.com/disavian/yql-tables/raw/master/steam/steam.community.player.profile.xml' as steam.community.player.profile; select * from steam.community.player.profile where customurl='disavian'

steam.community.player.gamestats.xml

This gets stats and achievements for a game:
use 'https://github.com/disavian/yql-tables/raw/master/steam/steam.community.player.gamestats.xml' as steam.community.player.gamestats; select * from steam.community.player.gamestats where id='76561197968575517' and game='L4D'

This uses the user’s custom url:
use 'https://github.com/disavian/yql-tables/raw/master/steam/steam.community.player.gamestats.xml' as steam.community.player.gamestats; select * from steam.community.player.gamestats where customurl='ChetFaliszek' and game='L4D'

steam.community.player.gamestats.feed.xml

For games that expose raw stats data, the following function exists:
use 'https://github.com/disavian/yql-tables/raw/master/steam/steam.community.player.gamestats.feed.xml' as steam.community.player.gamestats.feed; select * from steam.community.player.gamestats.feed where id='76561197968575517' and appid='500'

This also works with the custom url.
use 'https://github.com/disavian/yql-tables/raw/master/steam/steam.community.player.gamestats.feed.xml' as steam.community.player.gamestats.feed; select * from steam.community.player.gamestats.feed where customurl='ChetFaliszek' and appid='500'

steam.community.leaderboards.list.xml

The following grabs a list of leaderboards for a game; as of this writing it was generating malformed xml, which has nothing to do with my code or YQL.
use 'https://github.com/disavian/yql-tables/raw/master/steam/steam.community.leaderboards.list.xml' as steam.community.leaderboards.list; select * from steam.community.leaderboards.list where game='L4D'

steam.community.leaderboards.game

The following pulls data from a specific leaderboard; in particular, entries by friends of the player noted in steamid:
use 'https://github.com/disavian/yql-tables/raw/master/steam/steam.community.leaderboards.game.xml' as steam.community.leaderboards.game; select * from steam.community.leaderboards.list where game='L4D' and leaderboardid='30' and steamid='76561197968575517'

This lets you ask for a set of leaderboard entries.
use 'https://github.com/disavian/yql-tables/raw/master/steam/steam.community.leaderboards.game.xml' as steam.community.leaderboards.game; select * from steam.community.leaderboards.list where game='L4D' and leaderboardid='30' and start='1' and end='10'

steam.community.groups.xml

This lets you get the list of members in a group from the group’s id:
use 'https://github.com/disavian/yql-tables/raw/master/steam/steam.community.groups.xml' as steam.community.groups; select * from steam.community.groups where id='103582791429521412'

Or the group’s name:
use 'https://github.com/disavian/yql-tables/raw/master/steam/steam.community.groups.xml' as steam.community.groups; select * from steam.community.groups where name='Valve'

Leave a Reply

 

Powered by WordPress and theme developed using WordPress Theme Generator.
Copyright © Andrew Guyton. All rights reserved. Feeds: Entries (RSS) and Comments (RSS).