Skip to content

Notion integration to automatically update database entries containing a Steam App ID with latest data from the Steam API.

License

Notifications You must be signed in to change notification settings

NikkelM/Notion-Steam-API-Integration

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

88 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Notion Steam API Integration

Notion Steam API Integration banner

Notion integration for automatically updating database entries containing a Steam App ID with data from the Steam API.

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.

If you haven't already done so, you can obtain a Notion integration key by creating an (internal) Notion integration for your workspace. You can follow this guide to learn how to do so. You will need this key to run the integration locally.

IMPORTANT: Don't forget to connect the integration to your database, as described in the guide! Otherwise, the integration won't work.

Usage

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

node index.js

The integration will search the database for new entries that have the Steam App ID field (the name of this property must be defined in the configuration file) set to a value other than null and then fetch the corresponding data from the Steam API. Following this, the database entry will be updated with cleaned up data from the API, such as Steam user review scores or the game's tags, following the provided configuration.

You are able to have the integration running in the background whilst editing the database. You can also have database entries without the Steam App ID field set, these will be ignored by the integration.

If you change the configuration to include new game properties, you will need to run the integration with the forceReset flag set to true in the configuration, in order to also set the new value for all previously discovered games.

There currently is no way to reset a value that was previously set in the Notion database.

Configuration

Schema validation

The project provides a JSON validation schema for the required configuration file, which makes sure that all required information is provided.

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.

Top-level properties

notionIntegrationKey

The secret integration key for your Notion integration. Find it on your integration dashboard after creating a new integration on https://www.notion.so/my-integrations.

Type Default value Possible values Required
string "" A valid Notion integration key Yes
notionDatabaseId

The ID of the database you want to run the integration on. You can find the ID in the URL of your database, e.g. https://www.notion.so/myworkspace/your-database-id.

Type Default value Possible values Required
string "" A valid Notion database ID Yes
updateInterval

The interval in which the integration will check for updates to your Notion database. The value is in milliseconds. Must be at least 60000 (1 minute).

Type Default value Possible values Required
integer 60000 Integers >= 60000 Yes
steamAppIdProperty

The name of the property in your Notion database that contains the Steam App ID of the games.

Type Default value Possible values Required
string "Steam App ID" Any string Yes
forceReset

If true, the integration will reset the local database, fetch all Steam App ID's from the Notion database and refresh all game properties. This may take longer, depending on the size of your Notion database.

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

If true, the integration will always update entries in the Notion database that were modified since it last ran, even if the game already exists in the local database. It will only update if another user than the integration has last modified the entry.

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

Which game properties should be fetched when a new Steam game is detected, and the name of the corresponding field in the Notion database.

Type Default value Possible values Required
object See item below See sections below Yes, and at least one property set.
"gameProperties": {
	"gameName": {
		"enabled": true,
		"notionProperty": "Game Name",
		"isPageTitle": true
	},
	"coverImage": true,
	"gameIcon": true,
	"releaseDate": {
		"enabled": true,
		"notionProperty": "Release Date"
	},
	"reviewScore": {
		"enabled": true,
		"format": "percentage",
		"notionProperty": "Review Score"
	},
	"tags": {
		"enabled": true,
		"notionProperty": "Tags"
	}
}

gameProperties

gameName

The name of the game as it appears on Steam. The database field in Notion must be of type Text.

Type Default value Possible values Required
object See item below See sections below No
"gameName": {
	"enabled": true,
	"notionProperty": "Game Name",
	"isPageTitle": true
}

Possible values

enabled

Whether or not the name of the game should be set in the database.

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

notionProperty

The name of the Notion property to set the game name in.

Type Default value Possible values Required
string "Game Name" A valid Notion property name Yes

isPageTitle

Indicates if this property is the "Title" of the Notion page or not.

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

The cover image of the game as it appears on the shop page. Will be set as the cover image for the page if enabled.

Type Default value Possible values Required
object See item below See sections below No
"coverImage": {
	"enabled": true,
	"default": "https://cdn.cloudflare.steamstatic.com/store/home/store_home_share.jpg"
}

Possible values

enabled

Whether or not the cover image of the game should be set in the database.

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

default

The URL of the image to use if the game does not have a cover image through any of the two API's.

Type Default value Possible values Required
string "https://cdn.cloudflare.steamstatic.com/store/home/store_home_share.jpg" A valid URL Yes
gameIcon

The icon of the game as it appears in the game library. Will be set as the icon for the page if enabled.

Type Default value Possible values Required
object See item below See sections below No
"gameIcon": {
	"enabled": true,
	"default": "https://help.steampowered.com/public/shared/images/responsive/share_steam_logo.png"
}

Possible values

enabled

Whether or not the icon of the game should be set in the database.

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

default

The URL of the image to use if the game does not have an icon through any of the two API's.

Type Default value Possible values Required
string "https://help.steampowered.com/public/shared/images/responsive/share_steam_logo.png" A valid URL Yes
releaseDate

The release date of the game. The database field in Notion must be of type Date.

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

Possible values

enabled

Whether or not the release date of the game should be set in the database.

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

notionProperty

The name of the Notion property to set the release date in.

Type Default value Possible values Required
string "Release Date" A valid Notion property name Yes
reviewScore

The user review score for the game, formatted as one of a number of options. The database field in Notion must match the type defined by the chosen "format".

Type Default value Possible values Required
object See item below See sections below No
"reviewScore": {
	"enabled": true,
	"format": "percentage",
	"notionProperty": "Review Score"
}

Possible values

enabled

Whether or not the user review score should be set in the database.

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

format

How the review score should be formatted.

Type Default value Possible values Required
string percentage percentage: Notion database field type: Number. A percentage value formatted as a float from 0.00-1.00.
sentiment:Notion database field type: Select. A sentiment value such as "Overwhelmingly Positive" or "Mixed".
total:Notion database field type: Number. The total number of reviews submitted for the game, across all languages.
positive:Notion database field type: Number. The total number of positive reviews submitted for the game, across all languages.
negative:Notion database field type: Number. The total number of negative reviews submitted for the game, across all languages.
positive/negative:Notion database field type: Text. The total number of positive and negative reviews submitted for the game, across all languages, formatted as "{numPositive} positive / {numNegative} negative".
Yes

notionProperty

The name of the Notion property to set the user review score in.

Type Default value Possible values Required
string "Review Score" A valid Notion property name Yes
tags

The user-defined tags of the game as they can be seen on the store page. The database field in Notion must be of type Multi-select.

Type Default value Possible values Required
object See item below See sections below No
"tags": {
	"enabled": true,
	"notionProperty": "Tags",
	"language": "english"
}

Possible values

enabled

Whether or not the tags of the game should be set in the database.

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

notionProperty

The name of the Notion property to set the tags in. This field must be of type Multi-select.

Type Default value Possible values Required
string "Tags" A valid Notion property name Yes

language

The language of the tags, e.g. "english" or "spanish".

Type Default value Possible values Required
string "english" Valid language names. Invalid names return an error from the Steam API. Yes
gameDescription

The short description of the game as it appears on the store page. The database field in Notion must be of type Text.

Type Default value Possible values Required
object See item below See sections below No
"gameDescription": {
	"enabled": true,
	"notionProperty": "Game Description"
}

Possible values

enabled

Whether or not the description of the game should be set in the database.

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

notionProperty

The name of the Notion property to set the description in.

Type Default value Possible values Required
string "Game Description" A valid Notion property name Yes
storePage

The URL to the store page of the game. The database field in Notion must be of type URL.

Type Default value Possible values Required
object See item below See sections below No
"storePage": {
	"enabled": true,
	"notionProperty": "Store Page"
}

Possible values

enabled

Whether or not the store page URL should be set in the database.

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

notionProperty

The name of the Notion property to set the store page URL in.

Type Default value Possible values Required
string "Store Page" A valid Notion property name Yes
gamePrice

The price of the game on Steam. Does not account for current sales or discounts (as this data would be outdated too quickly). The currency depends on your current country. The database field in Notion must be of type Number.

Type Default value Possible values Required
object See item below See sections below No
"gamePrice": {
	"enabled": true,
	"notionProperty": "Price"
}

Possible values

enabled

Whether or not the price of the game should be set in the database.

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

notionProperty

The name of the Notion property to set the price in.

Type Default value Possible values Required
string "Price" A valid Notion property name Yes
steamDeckCompatibility

The Steam Deck Compatibility score, which can be one of "Verified", "Playable", "Unsupported" or "Unknown". The database field in Notion must be of type Select.

Type Default value Possible values Required
object See item below See sections below No
"steamDeckCompatibility": {
	"enabled": true,
	"notionProperty": "Steam Deck Compatibility"
}

Possible values

enabled

Whether or not the Steam Deck Compatibility score should be set in the database.

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

notionProperty

The name of the Notion property to set the Steam Deck Compatibility score in.

Type Default value Possible values Required
string "Steam Deck Compatibility" A valid Notion property name Yes
gameDevelopers

The developer(s) of the game. The database field in Notion must be of type Multi-select.

Type Default value Possible values Required
object See item below See sections below No
"gameDevelopers": {
	"enabled": true,
	"notionProperty": "Developers"
}

Possible values

enabled

Whether or not the developer(s) of the game should be set in the database.

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

notionProperty

The name of the Notion property to set the developer(s) in.

Type Default value Possible values Required
string "Developers" A valid Notion property name Yes
gamePublishers

The publisher(s) of the game. The database field in Notion must be of type Multi-select.

Type Default value Possible values Required
object See item below See sections below No
"gamePublishers": {
	"enabled": true,
	"notionProperty": "Publishers"
}

Possible values

enabled

Whether or not the publisher(s) of the game should be set in the database.

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

notionProperty

The name of the Notion property to set the publisher(s) in.

Type Default value Possible values Required
string "Publishers" A valid Notion property name Yes

Related projects

You can get a list of all games you own on Steam, Epic Games or GOG using the Steam App ID Finder. This project also includes a utility to get the Steam App IDs from just a list of game names.

Do you want to add games that are available on Game Pass to your Notion database? Use the Game Pass API to get the data you need.

If have data in the form of a complex JSON file, you can use the JSON to Notion tool to import all the required properties to your Notion database - this tool works great with the Game Pass API.

Feedback

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