First off get a dev key from here, http://steamcommunity.com/dev/apikey and login with your Steam account and you will get unique key.Please do not share this key as it identifies you when you make WebAPI requests.

Quote:

Originally Posted by Zoid

When you go to http://steamcommunity.com/dev/apikey the "domain" field is just a note. It's not actually used for anything and is just a helpful field so you can tell us what your website is. You can just put your name in for now. Once you get a key, its what uniquely identifies you when accessing our WebAPI calls.

Common options:Note that unless otherwise stated, an option's default is empty/ignored.

Code:

key=<key> # Your personal API key (from above)
language=<lang> # The language to retrieve results in (default is en_us) (see http://en.wikipedia.org/wiki/ISO_639-1 for the language codes (first two characters) and http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes for the country codes (last two characters))
format=<form> # The format to retrieve results in ("JSON" or "XML") (default is JSON)

GetMatchHistoryBySequenceNum
Used to get the matches in the order which they were recorded (i.e. sorted ascending by match_seq_num).
This means that the first match on the first page of results returned by the call will be the very first public mm-match recorded in the stats.
This API combines GetMatchHistory with GetMatchDetails - i.e. each page returned requires no additional calls for more data.

If you have just a Steam-Name:
You can use this to search the Dota2 API directly using the player_name option of GetMatchHistory
You can then find their 32-bit ID in the list and then convert it to a 64-bit ID as above.

FAQ

Are match history and details going to be available for private matches?
These are not available at this time. We are looking at a possible OATUH based authentication system that will allow players to retrieve their private match history securely and allow third party sites to get that information they grant access to. We hope to have more details soon.

Is there a WebAPI for current games in progress?
Not yet! It has been suggested, so we will just have to wait and see!

Are there limits on how many API calls?

You must manually limit your requests to one request per second in order to reduce the strain on the servers

If you get a 503 Error: the matchmaking server is busy or you exceeded limits. Please wait 30 seconds and try again.

Please note that as written in the WebAPI T&C's, you are limited to 100,000 API calls per day.

Can I persist the data in a database or similar?YES! In fact, it is recommended in order to reduce the strain on the server.

I want to start developing, should I jump right into grabbing data using the API?
Short answer; no. You should not.
Whilst you are developing your application, it will be rather silly and inconsiderate to slam the API with calls for data you just throw away.
In stead, consider one of two alternatives:
1) (preferred) Manually make a few calls to the API and save the results to your hard drive, then use these to test from until you're confident your application does what it's supposed to.
2) If you are developing your actual dynamic API calls, (first make sure you have implemented a suitable request limit as above) consider using the Dota2 Beta TEST API, which works identically to the Dota2 Beta API, except its urls are different:

Code:

Replace "IDOTA2Match_570" with "IDOTA2Match_205790"

Can I create a private, unofficial league and use the API to get data for it?NO. You can only get publicly available data using the API, so you CANNOT get any private matches using it.

Is there feature X in the API which will give me a set of cumulative data Y?NO. The only features in the API are those listed above.
If you want to figure out the best hero, the best player, the most used hero, the most bought item or the team with the most wins, etc, etc, etc you have to use the available API calls to fetch the data, store it in a database and do the calculations yourself.

PLEASE REPLY WITH ANY THINGS THAT ARE WRONG/THINGS I SHOULD ADD.
THANKS

CHANGE LOG:

2012/10/11 - Created Thread.

2012/10/12 - Made SteamIDs its own section, changed to using ResolveVanityURL (thanks to RJackson).

2012/10/15 - Quoted Zoid's "API is down" post.

2013/01/27 - Removed api is down post, added link to the api's T&C's, fixed up a few errors (thanks to sema), added to-do list.

On a system that only supports up to 32-bit numbers, it's trickier. You have to rely on the language's built-in "big number" functions (i.e. PHP's gmp extension: see this post for details)

It's probably better practise to stick with API calls instead of relying on Steam Community's XML pages. If a user has a profile url of the format: http://steamcommunity.com/profile/12341234/, then 12341234 is their SteamId64; if they have a vanity url, as is your example, you can get their SteamId64 with the ISteamUser/ResolveVanityURL api call.

10-11-2012, 06:18 PM

MuppetMaster42

Quote:

Originally Posted by RJackson

It's probably better practise to stick with API calls instead of relying on Steam Community's XML pages. If a user has a profile url of the format: http://steamcommunity.com/profile/12341234/, then 12341234 is their SteamId64; if they have a vanity url, as is your example, you can get their SteamId64 with the ISteamUser/ResolveVanityURL api call.

Yeah, sorry, I didn't think about an API way to get it (silly me)
I updated the post to use ResolveVanityURL

10-11-2012, 08:14 PM

MuppetMaster42

Quote:

Originally Posted by walkingcarpet

This is a really great write up, thank you!

Though if I may ask politely... please change the all caps in the title.

edit: Also yes, this would be good to sticky.

Thanks :)

Also, I changed the title of the original post, but I think an admin has to change the thread Title..

10-14-2012, 11:27 PM

GeoStrik3r

thanks but you forgot to add "its not working since over a month"

10-22-2012, 05:41 AM

56k_Rockstar

So currently only the GetHeroes API call works right? Because thats the only request I get data from :( and the call is made to a different EndPoint (not $baseUrl but https://api.steampowered.com/IEconDOTA2_570/) and those are disabled at the moment, right?

I just looked into this stuff for a few minutes and called a bit against the API via PHP like this: