GithubHelp home page GithubHelp logo

andshrew / playstation-trophies Goto Github PK

View Code? Open in Web Editor NEW
91.0 8.0 4.0 1.1 MB

Sony has an API for retrieving details of the trophies an account has earned, but there is no public documentation for using it. This is an attempt at documenting the API by capturing the requests made by the https://my.playstation.com web site.

License: MIT License

Dockerfile 100.00%
trophies playstation playstation-network api-documentation

playstation-trophies's People

Contributors

andshrew avatar wescopeland avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

playstation-trophies's Issues

Would there be interest in a Postman collection with the endpoints and tests?

I'm making a public Postman collection that hits the endpoints, authenticates, and then requests for data, in a practical way, akin to what your documentation library refers to.

Run in Postman

Would you be interested in having this added to your documentation, so your users can easily test the endpoints you describe? The greatest advantages of integrating the documentation with Postman are:

  • Very easy testing of endpoints;
  • Straightforward testing samples of expected outputs for each endpoint;
  • The ability to easily convert requests to code in any popular language;

PS: Thanks for the library, I'm doing my best to not fanboy too much. ๐Ÿ˜…

Endpoint for hours played

The PS5 can show the hours played for all your games (PS3, PS4, PS5). I assume there's an API endpoint for this and would love to find out what it is. Potentially only possible if the PS5 is jailbroken in order to MITM the traffic.

player's accountId

hey andshrew,

congratulations for this amazing project.

I wonder if you know some route in the playstation api to get player's accountId of any player non related to the npsso key. For example, to get accountId of all player's friends.

Missing documentation

Just noticed that this documentation are missing api/userProfile/v1/internal/users/{accountId}/profiles and api/search/v1/universalSearch

Would be nice to have this included as well, thanks!

Current (PS5 / "v2") API and trophyEarnedRate Information

Seemingly one of the limitations of the current trophy API is that you cannot view the trophyEarnedRate (the percentage of people who have earned a specific trophy) unless your account - or the account you are querying against - has played the game and has the trophy list synced.

You can see this behavior when you access the API directly as you will get a Resource Not Found error, and this is also the case both in the PS App and on console with the PS5. You can see this limitation in effect if you try and compare trophies with someone using a game that neither of you have synced to your account.

Trophy-Comparison

However, I have noticed that when a game has trophies listed in the activity card section the PS5 is doing something which does allow it to retrieve the trophyEarnedRate - even if it is a game that your account does not have the trophy list synced for.

Activity-Card-Trophy

Activity-Card-Trophy-Stats

From the limited data you can capture if you run the PS5 through a proxy I can see that it is accessing the API when you open these cards, but cannot see any of the detail in the exact request it is making.

I'm interested in what they are doing, so if anyone has come across this and can share I would like to include it in the documentation here.

It would seem likely that it is either:

  • There is another API endpoint which can be used to retrieve this information.
  • There is a specific accountId they are querying against which has every trophy list synced against it and so will always return the information in a request to the API.

Getting the region of a game ... API Endpoint needed

Hello together, it's not an issue, but a question form my side. I have done some research on the internet, but until now, there seems no way.

I want to get the region / country of a game. Because currently I have some games which has not the console registered region. I can play the games, and everything works well, but when I search for the trophies which I have done, I don't know the region code of the game. The region belongs to the CUSA /PPSA code or maybe to the NPWR id. But fetching the user game list or the trophy list, the regions will not be available inside the JSON structure.

Do you guys know a trick or a API endpoint to fetch this data?

Thanks in advanced

Documentation of the new PSN API?

First, truly great and detailed documentation of the API used by https://my.playstation.com

With the release of the new PSN app so is there a new base URL to access information with support for PS5 titles and other updated information as well, https://m.np.playstation.net/api/

So I simply wonder if you will take on the task to document this as well? At the time of this writing so does https://my.playstation.com still uses the old API and can't display PS5 titles.

Endpoint limit parameter values

First of all, thank you so much for all your work on this project, it is really something unique!

I'm doing some tests with the api (using isFakeAccount Python wrapper) and found out that the limit parameter values for the endpoint https://m.np.playstation.net/api/trophy/v1/users/{accountId}/trophyTitles are as follows:

Min 1 (already in the documentation)
Max 800 (higher values will return an 400 bad request http error)
Default 100 (if not specified it will limit to 100 game titles trophies)

Since the numbers os trophies and titles are very different in sizes I believe the values may be different on other endpoints, but I'll try to confirm it and let you know.

Since I'm not a developer and have little to no experience with Git commands etc I'm posting it here. ๐Ÿ˜…

PS Store Wishlist

Just wondering if you're aware of the endpoint to get the PS Store wish list for a user?

Unable to retrieve API token

Greetings,

I am trying to get my API token to test some of the endpoints, but I am unable to do it. I followed all the steps from this link https://andshrew.github.io/PlayStation-Trophies/#/APIv2?id=obtaining-an-authentication-token

But powershell is giving me the following error:

Error: Check npsso
Cannot index into a null array.
At line:22 char:1

  • $body = @{
  •   + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
      + FullyQualifiedErrorId : NullArray
    
    

Error: Unable to obtain Authentication Token

played time for a game

Hello, I would like to know if there's a route to get users played time in a specific game.

Some webpages like exophase already have this feature.

Thanks!

How to get Game Region?

hello,
is it possible to get the Games Region?
With the help of the documentation i was able to write a python programm to track my earned trophies for a OBS TrophyTracker overlay...works fine. But since i played some Stacks it would be nice if i could read out the reagion (eu, na, as etc.) of a game...

can anybody help?

Cannot index into a null array.

Hello,

When I am trying to execute:

$token = Get-AuthenticationToken -npsso "Ghzhxl%%%%%%%%%%%%%%%%%%%%%%%%%%%"

I am getting this kind of error:

Error: Check npsso
Cannot index into a null array.
At C:\Users\o.sikorskyi\OneDrive - Playtech\Desktop\test.ps1:22 char:1
+ $body = @{
+ ~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : NullArray

What kind of issue is this?

Differences between Invoke-RestMethod and browser fetch api

First, congratulations for this project. Very impressive indeed.
I was thinking what's the difference between the Invoke-RestMethod and fetch api running on browser. I'm trying to use fetch to get a valid token without success. Do you have any idea about this?

Problem with the Get-AuthenticationToken method

First, congratulations for the amazing work on this project, very impressive indeed.

I'm having some trouble when I try to use the Get-AuthenticationToken method with my npsso string.
it throws me the following error message:

image

Do you know what could possibly be the solution for this?

Game Region Data

Hello, I would like to know if there's a way of getting the region of a game through Sony's API. For example. One game can have multiple instances by region, ASIA, USA, EU, etc...

How to get the needed "npCommunicationId" from CUSA and PPSA?

Hello all,

since the API has been revised by Sony, I need some help to get special game information. For PS4 games I can still use this API call to get the npCommunicationid which is needed for e.g. the trophy list of the game:

CUSA02387_00 --> Battlefield 1

https://us-tpy.np.community.playstation.net/trophy/v1/apps/trophyTitles?fields=@default&npLanguage=de&npTitleIds=CUSA02387_00

A PS5 game like PPSA01349 will not work to get the needed NPWRxxxxx_00 id with this API call.

The above call will return the npCommunicationId: NPWR08899_00 only for PS4 games.

This call get all trophy sets of a game in general without user account binding.

https://m.np.playstation.net/api/trophy/v1/npCommunicationIds/NPWR08899_00/trophyGroups/all/trophies?npServiceName=trophy

For every request the AccessToken is needed!!!! To get this token, see the documentation here.

My question ist now, how to get the npCommunitionId (NPWRxxxxx_00) for every title (Ps4,Ps5), independent of the user account. Just to get a preview of the game trophies before purchasing the game.

Hopefully someone has an idea or a APi call to get the NPWRxxxxx_00 id for every platform.

Best regards

Is postman compatible with this api?

Hello,

I am trying to use Postman from Playstation-trophies api, but I am getting an error message saying:

{
"error": {
"referenceId": "e435efb4-70fd-11ed-99c3-01c61dc733aa",
"code": 2241025,
"message": "Invalid token"
}
}

Here's a screenshot of what I am setting up with, but let me know if postman is compatible with this api. Thank you!(:

psn

Account Creation Date Endpoint / Query

Hello, @andshrew!

I've been exploring your projects and code, and I must say you've done an excellent job, especially with the documentation โ€“ it's really well done!

I've been on the hunt for a way to find the creation date of a PSN (PlayStation Network) Account. I've noticed that some people have already implemented this in Discord and Telegram bots, but they are reluctant to share their methods.

As an example, here's a sample of the output I've come across:

img

All the data displayed here is accessible to our open-source community except for the creation date. I'd love to hear your thoughts on this. Do you have any insights on how I can obtain this piece of information?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.