andshrew / PlayStation-Trophies

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.
MIT License
104 stars 4 forks source link

PS Store Wishlist #18

Closed joekw closed 1 year ago

joekw commented 1 year ago

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

rafaelfgyn commented 1 year ago

Are you saying that this endpoint actually exists?

joekw commented 1 year ago

it must do, right? the app gets it from somewhere...

rafaelfgyn commented 1 year ago

yeah... you have a point. I've never got to know. Would be nice to get this endpoint...

andshrew commented 1 year ago

Hi @joekw

I don't know it offhand but I will look at what the app is using the next time I get a chance and share it.

The web store has the wish list too so you could also just grab the URL it is accessing from there using your browsers developer tools.

andshrew commented 1 year ago

So the app is using this URL:

https://m.np.playstation.com/api/graphql/v1/op?operationName=metGetStoreWishlist&variables={}&extensions= {"persistedQuery":{"version":1,"sha256Hash":"571149e8aa4d76af7dd33b92e1d6f8f828ebc5fa8f0f6bf51a8324a0e6d71324"}}

You can access that either by logging in to the PS Store in your browser and then browsing to that URL (it will automatically use the authentication cookie which the PS Store has created), or you can use the method of authenticating that's in the trophy documentation.

You'll get a response like this (assuming you've got some things on your wishlist):

{
  "data": {
    "storeWishlist": [
      {
        "__typename": "Product",
        "boxArt": {
          "__typename": "Media",
          "url": "https://image.api.playstation.com/vulcan/ap/rnd/202205/1307/Ue3ndByOUb2iHviPJqImWsYy.png"
        },
        "id": "UP0102-CUSA33877_00-CLASSICREDC00001",
        "localizedStoreDisplayClassification": "Full Game",
        "name": "Resident Evil Director’s Cut",
        "platforms": [
          "PS4",
          "PS5"
        ],
        "price": {
          "__typename": "SkuPrice",
          "basePrice": "$9.99",
          "discountText": "-100%",
          "discountedPrice": "Included",
          "isExclusive": true,
          "isFree": true,
          "isTiedToSubscription": true,
          "serviceBranding": [
            "PS_PLUS"
          ],
          "skuId": "UP0102-CUSA33877_00-CLASSICREDC00001-U001",
          "upsellServiceBranding": [
            "PS_PLUS"
          ],
          "upsellText": "Premium"
        },
        "storeDisplayClassification": "FULL_GAME"
      },
      {
        "__typename": "Product",
        "boxArt": {
          "__typename": "Media",
          "url": "https://image.api.playstation.com/vulcan/ap/rnd/202303/0810/07dbdb4d05e9dc0dd3d431d1510d1ee1f9660e8c9e703588.png"
        },
        "id": "UP0700-CUSA33746_00-SLUS007970000000",
        "localizedStoreDisplayClassification": "Full Game",
        "name": "R4 RIDGE RACER TYPE 4® PS4 & PS5",
        "platforms": [
          "PS4",
          "PS5"
        ],
        "price": {
          "__typename": "SkuPrice",
          "basePrice": "$5.99",
          "discountText": "-100%",
          "discountedPrice": "Included",
          "isExclusive": true,
          "isFree": true,
          "isTiedToSubscription": true,
          "serviceBranding": [
            "PS_PLUS"
          ],
          "skuId": "UP0700-CUSA33746_00-SLUS007970000000-U001",
          "upsellServiceBranding": [
            "PS_PLUS"
          ],
          "upsellText": "Premium"
        },
        "storeDisplayClassification": "FULL_GAME"
      },
      {
        "__typename": "Product",
        "boxArt": {
          "__typename": "Media",
          "url": "https://image.api.playstation.com/vulcan/ap/rnd/202210/0706/EVWyZD63pahuh95eKloFaJuC.png"
        },
        "id": "UP0102-PPSA07411_00-RE4RMAINGAME0000",
        "localizedStoreDisplayClassification": "Full Game",
        "name": "Resident Evil 4",
        "platforms": [
          "PS4",
          "PS5"
        ],
        "price": {
          "__typename": "SkuPrice",
          "basePrice": "$59.99",
          "discountText": null,
          "discountedPrice": "$59.99",
          "isExclusive": false,
          "isFree": false,
          "isTiedToSubscription": false,
          "serviceBranding": [
            "NONE"
          ],
          "skuId": "UP0102-PPSA07411_00-RE4RMAINGAME0000-U003",
          "upsellServiceBranding": [
            "NONE"
          ],
          "upsellText": null
        },
        "storeDisplayClassification": "FULL_GAME"
      }
    ]
  }
}
joekw commented 1 year ago

you are the best, thank you!!