achievements-app / psn-api

A JavaScript library that lets you get trophy, user, and game data from the PlayStation Network.
https://psn-api.achievements.app
MIT License
255 stars 29 forks source link

retrieving the actual PSNID of the game, not just the npCommunicationID #156

Open platinumachievements opened 5 months ago

platinumachievements commented 5 months ago

Im trying to get the actual psnid of the game that the trophy list is attached to. im aware the trophy list for the game is the npcommunication id.

i.e Portal Knghts game ID for the US region is CUSA06266 the trophy link id is - "npCommunicationId": "NPWR12397_00", the url is - https://store.playstation.com/en-us/product/UP4040-CUSA06266_00-PORTALKNIGHTS000

im after either - UP4040-CUSA06266_00-PORTALKNIGHTS000 or CUSA06266

the reason why is im trying to get to the hero image (the main title image of the game) is there any endpoints that i can get either the gameid/url or the hero image url

Many thnaks in Advance

platinumachievements commented 5 months ago

just to add to this, the information i require is in the getRecentlyPlayedGames call, however this is only for the user that has the associated token. i want to use it on specific users. im especially interested in getting the entitlementId, titleId or productId.

this is the return call from the getrecentlyplayedgames call. -

const mockResponse: RecentlyPlayedGamesResponse = { data: { gameLibraryTitlesRetrieve: { typename: "GameList", games: [ { typename: "GameLibraryTitle", conceptId: "203715", entitlementId: "EP2002-CUSA01433_00-ROCKETLEAGUEEU01", image: { __typename: "Media", url: "https://image.api.playstation.com/gs2-sec/appkgo/prod/CUSA01433_00/7/i_5c5e430a49994f22df5fd81f446ead7b6ae45027af490b415fe4e744a9918e4c/i/icon0.png" }, isActive: true, lastPlayedDateTime: "2023-03-10T01:01:01.390000Z", name: "Rocket League®", platform: "PS4", productId: "EP2002-CUSA01433_00-ROCKETLEAGUEEU01", subscriptionService: "NONE", titleId: "CUSA01433_00" },