A nodejs
API to retrieve a user's Playstation trophy data from the Playstation website.
To use the API within your code you can use #request
to return all the games that have been attached to a user's account.
import { Trophies } from 'playstation-trophies';
Trophies.request('{{username}}', (err, games) => {
console.log(`{{username}} has ${games.length} games`);
})
Each Game
may contain:
{
"id": "Playstation Game ID",
"title": "Name of the game",
"platforms": "[PS3|PS4|VITA]",
"progress": "Completion percentage for trophies",
"trophies": "[list of trophies completed]",
"avatar": "URL for game avatar"
}
A CLI is also available for quickly searching users data to use in your shell.
# return all games belonging to {{username}} in JSON format
npm run cli {{username}} -- --format json
MIT