Report

Simple Data Toolkit - Playstation Trophies - Python

November 17, 2024 at 3:13 AM UTC
This post has no media.
Profile picture
Franklin Powers

Simple Data Toolkit provides an API for retrieving trophies from PlayStation. (Release pending)

You will need to get an NPSSO token first:

Login via https://store.playstation.com
And then access https://ca.account.sony.com/api/v1/ssocookie

This will need to be set in an environment variable PSN_NPSSO
Or you can set it in Python with com_sdtk_api_PSNAPI.setNpsso

To retrieve all trophies for an account id in Python, using Simple Data Toolkit, we can do the following:


from sdtk import com_sdtk_api_PSNAPI

def printer(data, reader):
print(reader.toArrayOfNativeMaps(None))

com_sdtk_api_PSNAPI.trophyTitlesAPI().retrieveData({"accountId": None}, printer)


To retrieve all trophies for a given title, you'll need it's communication id and use the following Python code:

from sdtk import com_sdtk_api_PSNAPI

def printer(data, reader):
print(reader.toArrayOfNativeMaps(None))

com_sdtk_api_PSNAPI.trophiesForTitleAPI().retrieveData({"communicationId": "NPWR20188_00", "trophyGroupId": None}, printer)


To retrieve all trophies earned for a given title, you'll need it's communication id and use the following Python code:

from sdtk import com_sdtk_api_PSNAPI

def printer(data, reader):
print(reader.toArrayOfNativeMaps(None))

com_sdtk_api_PSNAPI.trophiesEarnedForATitleAPI().retrieveData({"accountId": None, "communicationId": "NPWR20188_00", "trophyGroupId": None}, printer)

Any thoughts on Franklin's post?

To comment or reply, you need an Ortingo account.

Sign in or sign up

Here's what Ortingoers think of Franklin's post.

There are no comments on this post.