Skip to content
 
 

Repository files navigation

Game Pass API

Game Pass API banner

This project provides a quick and easy way to get a list of all games currently available on Xbox Game Pass on a given platform (Console, PC or through EA Play) in a given region.

Using the configuration file, the type and format of many properties can be customized, from simply getting the game's names all the way to fetching store prices at the moment of the request.

Take a look at the section below to learn how to use the configuration file, or take a look at the examples and work from there.

Setup

Run npm install to install the required dependencies first.

Following this, create a config.json file in the root directory of the project and fill it with your desired configuration.

Usage

After providing the config.json configuration file, you can run the script using

node index.js

You will find the resulting data in the created output folder.

Unsure how it works? Take a look at the examples for some inspiration.

Configuration

Schema validation

The project provides an extensive JSON validation schema for the required configuration file, which offers guidance on the possible properties that can be extracted from the API, as well as options for formatting the resulting data.

Are you missing a property? Feel free to open an issue and I will see what I can do. Alternatively, fork the repository and open a Pull Request.

The schema can be found in the config.schema.json file and used within your config.json by adding the following property:

"$schema": "config.schema.json"

NOTE: The script will test your provided config.json against this schema, so make sure your configuration is valid.

Properties

The following is a list of all configuration items, their defaults and the values they can take.

If a given property is not present in the configuration file, it will automatically be assumed to have a value of false (or equivalent, depending on the property type).

Top-level properties

markets

The two letter market codes for which to fetch games. The script will run once for each market code.

Type Default value Possible values Required
array ["US"] "US", "DZ", "AR", "AU", "AT", "BH", "BD", "BE", "BR", "BG", "CA", "CL", "CN", "CO", "CR", "HR", "CY", "CZ", "DK", "EG", "EE", "FI", "FR", "DE", "GR", "GT", "HK", "HU", "IS", "IN", "ID", "IQ", "IE", "IL", "IT", "JP", "JO", "KZ", "KE", "KW", "LV", "LB", "LI", "LT", "LU", "MY", "MT", "MR", "MX", "MA", "NL", "NZ", "NG", "NO", "OM", "PK", "PE", "PH", "PL", "PT", "QA", "RO", "RU", "SA", "RS", "SG", "SK", "SI", "ZA", "KR", "ES", "SE", "CH", "TW", "TH", "TT", "TN", "TR", "UA", "AE", "GB", "VN", "YE", "LY", "LK", "UY", "VE", "AF", "AX", "AL", "AS", "AO", "AI", "AQ", "AG", "AM", "AW", "BO", "BQ", "BA", "BW", "BV", "IO", "BN", "BF", "BI", "KH", "CM", "CV", "KY", "CF", "TD", "TL", "DJ", "DM", "DO", "EC", "SV", "GQ", "ER", "ET", "FK", "FO", "FJ", "GF", "PF", "TF", "GA", "GM", "GE", "GH", "GI", "GL", "GD", "GP", "GU", "GG", "GN", "GW", "GY", "HT", "HM", "HN", "AZ", "BS", "BB", "BY", "BZ", "BJ", "BM", "BT", "KM", "CG", "CD", "CK", "CX", "CC", "CI", "CW", "JM", "SJ", "JE", "KI", "KG", "LA", "LS", "LR", "MO", "MK", "MG", "MW", "IM", "MH", "MQ", "MU", "YT", "FM", "MD", "MN", "MS", "MZ", "MM", "NA", "NR", "NP", "MV", "ML", "NC", "NI", "NE", "NU", "NF", "PW", "PS", "PA", "PG", "PY", "RE", "RW", "BL", "MF", "WS", "ST", "SN", "MP", "PN", "SX", "SB", "SO", "SC", "SL", "GS", "SH", "KN", "LC", "PM", "VC", "TJ", "TZ", "TG", "TK", "TO", "TM", "TC", "TV", "UM", "UG", "VI", "VG", "WF", "EH", "ZM", "ZW", "UZ", "VU", "SR", "SZ", "AD", "MC", "SM", "ME", "VA", "NEUTRAL" Yes, at least one market code.
language

The language to use when fetching game properties. Properties such as the game description will be in this language.

Type Default value Possible values Required
string en-us "es-ar", "pt-br", "en-ca", "fr-ca", "es-cl", "es-co", "es-mx", "en-us", "nl-be", "fr-be", "cs-cz", "da-dk", "de-de", "es-es", "fr-fr", "en-ie", "it-it", "hu-hu", "nl-nl", "nb-no", "de-at", "pl-pl", "pt-pt", "de-ch", "sk-sk", "fr-ch", "fi-fi", "sv-se", "en-gb", "el-gr", "ru-ru", "en-au", "en-hk", "en-in", "id-id", "en-my", "en-nz", "en-ph", "en-sg", "vi-vn", "th-th", "ko-kr", "zh-cn", "zh-tw", "ja-jp", "zh-hk", "en-za", "tr-tr", "he-il", "ar-ae", "ar-sa" Yes
platformsToFetch

Which platforms to fetch games for, any of "console", "pc" and "eaPlay".

Type Default value Possible values Required
array ["console", "pc", "eaPlay"] "console", "pc", "eaPlay" Yes, at least one platform.
outputFormat

What kind of format the resulting JSON should use for the cleaned game properties.

Type Default value Possible values Required
string "array" "array": The resulting data structure is an array with its entries being dictionaries holding separate game's properties.
"productTitle": The resulting data structure is a dictionary that uses games' title as keys.
"productId": The resulting data structure is a dictionary that uses games' product ID's as keys.
"0-indexed": The resulting data structure is a dictionary that uses rolling integers as keys.
Yes
treatEmptyStringsAsNull

Whether to treat empty strings as null values.

Type Default value Possible values Required
boolean true true or false No
keepCompleteProperties

Whether to keep the original, complete list of properties for the fetched games. Will be saved in a separate file per platform and market.

Type Default value Possible values Required
boolean false true or false No
includedProperties

The properties that should be contained in the cleaned version of the API response.

Type Default value Possible values Required
object Not applicable See sections below Yes, and at least one sub-property

includedProperties

productTitle

Whether to include the title of the game.

Type Default value Possible values Required
boolean true true or false No
productId

Whether to include the product ID of the game.

Type Default value Possible values Required
boolean true true or false No
developerName

Whether to include the name of the developer of the game.

Type Default value Possible values Required
boolean true true or false No
publisherName

Whether to include the name of the publisher of the game.

Type Default value Possible values Required
boolean true true or false No
categories

Whether to include the game's categories. This can be used as tags.

Type Default value Possible values Required
boolean true true or false No
productDescription

Whether to include the description of the game.

Type Default value Possible values Required
object See item below See sections below No
"productDescription": {
	"enabled": true,
	"preferShort": false
}

Possible values

enabled

Whether to include the description of the game.

Type Default value Possible values Required
boolean true true or false Yes

preferShort

Whether to prefer the short description of the game over the long description.

Type Default value Possible values Required
boolean false true or false No
images

Whether to include image URL's for the game.

Type Default value Possible values Required
object See sections below See sections below No

Possible values

enabled

Whether to include image URL's for the game.

Type Default value Possible values Required
boolean true true or false Yes

imageTypes

What kinds of images should be considered, and a maximum of many of each type should be chosen. A value of -1 indicates no limit.

Type Default value Possible values Required
object See item below Any number of image type combinations with values from -1 upwards. Yes, at least one imageType.
"imageTypes": {
	"TitledHeroArt": -1,
	"SuperHeroArt": -1,
	"Logo": -1,
	"Poster": -1,
	"Screenshot": -1,
	"BoxArt": -1,
	"Hero": -1,
	"BrandedKeyArt": -1,
	"FeaturePromotionalSquareArt": -1
}

Description of the various image types:

Image type Description Aspect Ratio Example
Screenshot In-game screenshots. 16:9 Link
TitledHeroArt Banner featuring the game's name. 16:9 Link
Poster Banner featuring the game's name in portrait mode, such as for smartphones. 2:3 Link
SuperHeroArt Artwork without text. 16:9 Link
Hero Artwork without text. 2:1 Link
BoxArt Banner featuring the game's logo and name in a square "box" format. 1:1 Link
BranedKeyArt Banner featuring the game's name with an "XBOX" logo on top. 73:100 Link
FeaturePromotionalSquareArt Banner featuring the game's logo (without name) in a square "box" format. 1:1 Link
Logo Small, square game logo, to be used e.g. as a game library icon. 1:1 Link
releaseDate

Whether to include the game's release date.

Type Default value Possible values Required
object See item below See sections below No
"releaseDate": {
	"enabled": true,
	"format": "date"
}

Possible Values

enabled

Whether to include the game's release date.

Type Default value Possible values Required
boolean true true or false Yes

format

How to format the date string. Either the full dateTime (YYYY-MM-DDTHH:mm:ss.sssssssZ) or just the date (YYYY-MM-DD).

Type Default value Possible values Required
string "date" "date" or "dateTime" Yes
userRating

Whether to include the game's user rating.

Type Default value Possible values Required
object See item below See sections below No
"userRating": {
	"enabled": true,
	"aggregationInterval": "AllTime",
	"format": "percentage"
}

Possible Values

enabled

Whether to include the game's user rating.

Type Default value Possible values Required
boolean true true or false Yes

aggregationInterval

Which kind of interval to use for rating aggregation.

Type Default value Possible values Required
string "AllTime" "AllTime", "30Days", "7Days" Yes

format

How to format the rating. Either as the original x-out-of-5 stars value (0.0 - 5.0) or as a percentage (0.0 - 1.0).

Type Default value Possible values Required
string "percentage" "percentage" or "stars" Yes
pricing

Whether to include the game's price information. The currency that is used is dependent on the chosen "market".

Type Default value Possible values Required
object See item below See sections below No
"pricing": {
	"enabled": true,
	"priceTypes": [
		"ListPrice",
		"MSRP",
		"WholesalePrice"
	],
	"missingPricePolicy": "useZero"
}

Possible Values

enabled

Whether to include the game's price information. The currency that is used is dependent on the chosen \"market\".
Type Default value Possible values Required
boolean true true or false Yes

priceTypes

Which kinds of prices to include. Choose from ListPrice, MSRP and WholesalePrice (i.e. applied discounts).
Type Default value Possible values Required
array ["ListPrice", "MSRP", "WholesalePrice"] Any combination of:
"ListPrice": The current listing price in the store.
"MSRP": The manufacturer's suggested retail price.
"WholesalePrice": The wholesale price, i.e. the ListPrice after sales have been applied.
Yes, at least one priceType.

missingPricePolicy

What to do if a price is missing. Either "useZero", "useNull" or "useEmptyString".
Type Default value Possible values Required
string "useNull" "useZero", "useNull" or "useEmptyString" Yes
storePage

Whether to include the game's store page URL. Note that this is not guaranteed to always result in a working URL, as it needs to be inferred and is not available through the API.

Type Default value Possible values Required
boolean true true or false No

Related projects

If you would like to know the Steam App ID's for the games you own on Steam, Epic Games or GOG, you can use the Steam App ID Finder to do just that.

You can then use the Notion Steam API Integration to automatically add information about those games to your Notion database.

Alternatively, you can use the JSON to Notion tool to directly create a new page in your Notion database for each game extracted using the Game Pass API - this tool works with any kind of JSON file!

Feedback

If you have any question, feedback or feature requests, feel free to open an issue.

About

Get all games currently available for Xbox Game Pass, with their API-exposed properties formatted just the way you need them!

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages