API Setup

What is an API? API stands for Application program interface and it is a set of routines, protocols, and tools for building software applications.


Requesting a Steam API Key


  1. Make a Steam Account if You Don't Have One:
    Signup Here
  2. Then You will need to sign up for an API key from steam:
    Apply Here
  3. [RECOMMENDED] Get your steam ID from here, or from your profile URL:
    Get Steam ID

Important


This guide will help you get started with the Steam API but first it’s important to understand how to use the Steam API.

Every method in the Steam API can return its results in 3 different formats: JSON, XML, and VDF. Each format represents the data described herein differently. For the purpose of this tutorial we will be focusing on working with JSON.


The Basic API call


In order to use the API using GET or POST the URI format of each API request has to begin like so:

http://api.steampowered.com/

This is a template for how the url is to be formatted to return data in JSON format::

http://api.steampowered.com/"interface"/"method"/"method_version"/

Interface:


You can view all of them here:

Steam Interfaces

This is a template for how the url is to be formatted to return data in JSON format::

http://api.steampowered.com/"interface"/"method"/"method_version"/

Here’s a look at the iSteamUserStats:

{ "name": "ISteamUserStats", "methods": [ { "name": "GetGlobalAchievementPercentagesForApp", "version": 1, "httpmethod": "GET", "parameters": [ { "name": "gameid", "type": "uint64", "optional": false, "description": "GameID to retrieve the achievement percentages for" } ] }, { "name": "GetGlobalAchievementPercentagesForApp", "version": 2, "httpmethod": "GET", "parameters": [ { "name": "gameid", "type": "uint64", "optional": false, "description": "GameID to retrieve the achievement percentages for" } ] }, { "name": "GetGlobalStatsForGame", "version": 1, "httpmethod": "GET", "parameters": [ { "name": "appid", "type": "uint32", "optional": false, "description": "AppID that we're getting global stats for" }, { "name": "count", "type": "uint32", "optional": false, "description": "Number of stats get data for" }, { "name": "name[0]", "type": "string", "optional": false, "description": "Names of stat to get data for" }, { "name": "startdate", "type": "uint32", "optional": true, "description": "Start date for daily totals (unix epoch timestamp)" }, { "name": "enddate", "type": "uint32", "optional": true, "description": "End date for daily totals (unix epoch timestamp)" } ] },

We Will be using this When We Call it and display it with Handlebars:


64x64

HOME

The Steam Api doesn’t allow for cross-origin so first we will have to create our own server using Node!

Setup Node Server

The Steam Api doesn’t allow for cross-origin so first we will have to create our own server using Node!

API Setup

Set up the Steam API!

GetPlayerAchievements

Use The API for the first time.

JSON and HandleBars

Learn how to Use JSON and Handlebars together.

Examples

A few Example Calls to get you familiar with the API.