Reputation: 437
I have created an application that fetches data from the IGDB API (https://api-docs.igdb.com/) to display informations about games.
I would like to allow users to import their Steam game library.
I use the Steam endpoint GetOwnedGames (http://api.steampowered.com/IPlayerService/GetOwnedGames/v0001/?key=xxxx&steamid=user_steam_id&format=json&include_appinfo=1&include_played_free_games=1) which sends back data such as
{
"response": {
"game_count": 1,
"games": [
{
"appid": 6020,
"name": "STAR WARS™ Jedi Knight: Jedi Academy™",
"playtime_forever": 0,
"img_icon_url": "2e359a8df71ea18ddd77fda3f6b307e6e86ef910",
"img_logo_url": "027e513fe7e7681203587f7926828fb188af54ed",
"playtime_windows_forever": 0,
"playtime_mac_forever": 0,
"playtime_linux_forever": 0
},
]
}
}
But I have trouble linking the Steam data and the IGDB one.
I don't think i can search IGDB by name because for instance if I search "STAR WARS™ Jedi Knight: Jedi Academy™"
POST https://api.igdb.com/v4/games
BODY
fields *, platforms.*, platforms.websites.*;
where name ~ *"STAR WARS™ Jedi Knight: Jedi Academy™"* & platforms != null;
limit 50; sort first_release_date desc;
IGDB doesnt find anything, because it knows this game as "Star Wars: Jedi Knight - Jedi Academy". (removing the special characters doesn't work either)
How would you go about linking these two APIs?
Upvotes: 2
Views: 1890
Reputation: 8162
There is no easy way. You have to go several steps to match games between services. You need to use the Steam app ID.
You cannot start with Steam because Steam does not have anything about IGDB. You have to start with IGDB instead.
IGDB provides the website
endpoint:
field type description
category Category Enum The service this website links to
...
url String The website address (URL) of the item
Website Enums
category
name value
official 1
...
steam 13
Now you have the Steam URL which contains the unique Steam app ID in its URL: https://store.steampowered.com/app/6020
. This is probably already enough for matching the game.
With Steam Web API endpoint GetAppList
you can match the Steam app ID with the game name.
Upvotes: 4