Ragowit / psn100

PSN100 is a trophy tracking website with leaderboards, focusing on merging game stacks and removal of unobtainable trophies
https://psn100.net/
GNU General Public License v3.0
22 stars 2 forks source link

the region of the playstation account #14105

Closed eeews closed 3 weeks ago

eeews commented 3 weeks ago

Hello Ragowit, i hope you having a good day, i have seen your website and i saw the regions of players on the website but when i viewed tustin api and other APIs i didnt found any responses contain the country or the region of the playstation account. can you tell me how to fetch the country of the psn account i search for using the api

Ragowit commented 3 weeks ago

This is the part in my code where I grab the country: https://github.com/Ragowit/psn100/blob/f9c8389df1cf0c394530f8ce8e11caf700acf469/wwwroot/cron/30th_minute.php#L517-L530

And here's the code in Tustin: https://github.com/Tustin/psn-php/blob/5d9a357eed5e478e0b97112498c6cd5d6bac1749/src/Model/User.php#L128-L136

eeews commented 3 weeks ago

im used in my code python unfortunately so i cant take php do you have the api endpoint for that i tried mamy api endpoints but the response dont contain country

Ragowit commented 3 weeks ago

https://andshrew.github.io/PlayStation-Trophies/#/

Ragowit commented 3 weeks ago

And I believe this is the endpoint: https://github.com/Tustin/psn-php/blob/5d9a357eed5e478e0b97112498c6cd5d6bac1749/src/Iterator/UsersSearchIterator.php#L24-L46

eeews commented 3 weeks ago

this endpoint wont give me the country it Searches the Playstation Website this is the response of the that endpoint

"prefix": "GTA",
"suggestions": [],
"domainResponses": [
    {
        "domain": "ConceptGameMobileApp",
        "domainTitle": "Results for ConceptGameMobileApp with search term GTA",
        "domainTitleMessageId": "msgid_null",
        "domainTitleHighlight": [
            "Results for ConceptGameMobileApp with search term GTA"
        ],
        "zeroState": false,
        "univexId": "search.no_experiment.non.0.non_",
        "facetOptions": [],
        "next": "",
        "totalResultCount": 33,
        "results": [
            {
                "id": "201930:UP1004-CUSA00419_00-GTAVDIGITALDOWNL",
                "type": "conceptProduct",
                "univexId": "search.no_experiment.non.0.non_",
                "score": 234.40508,
                "conceptProductMetadata": {}
            }
        ]
    }
],
"fallbackQueried": false

}

Ragowit commented 3 weeks ago

It doesn't look like you're searching for users. What endpoint are you using?

Ragowit commented 3 weeks ago

I believe it should be https://m.np.playstation.com/api/search/v1/universalSearch

eeews commented 3 weeks ago

this api https://m.np.playstation.com/api/search/v1/universalSearch is used to search in Playstation Website example if i searched word GTA

{ "prefix": "GTA", "suggestions": [], "domainResponses": [ { "domain": "ConceptGameMobileApp", "domainTitle": "Results for ConceptGameMobileApp with search term GTA", "domainTitleMessageId": "msgid_null", "domainTitleHighlight": [ "Results for ConceptGameMobileApp with search term GTA" ], "zeroState": false, "univexId": "search.noexperiment.non.0.non", "facetOptions": [], "next": "", "totalResultCount": 33, "results": [ { "id": "201930:UP1004-CUSA00419_00-GTAVDIGITALDOWNL", "type": "conceptProduct", "univexId": "search.noexperiment.non.0.non", "score": 234.40508, "conceptProductMetadata": {} } ] } ], "fallbackQueried": false }

eeews commented 3 weeks ago

im using this api endpoint https://us-prof.np.community.playstation.net/userProfile/v1/users/{online_id}/profile2?fields=npId,onlineId,accountId,avatarUrls,plus,aboutMe,languagesUsed,trophySummary(@default,level,progress,earnedTrophies),isOfficiallyVerified,personalDetail(@default,profilePictureUrls),personalDetailSharing,personalDetailSharingRequestMessageFlag,primaryOnlineStatus,presences(@default,@titleInfo,platform,lastOnlineDate,hasBroadcastData),requestMessageFlag,blocking,friendRelation,following,consoleAvailability

this is the response {'profile': {'onlineId': 'hack', 'accountId': '2582846380429397720', 'npId': 'aGFja0BhNC5qcA==', 'avatarUrls': [{'size': 'l', 'avatarUrl': 'http://psn-rsc.prod.dl.playstation.net/psn-rsc/avatar/UP4468/CUSA10920_00-AV00000000000057_B8268CA6FF31BBE31863_l.png'}], 'plus': 0, 'aboutMe': '私はゲーマーなので、プレイしましょう!@bos', 'languagesUsed': ['ja'], 'trophySummary': {'level': 234, 'progress': 56, 'earnedTrophies': {'platinum': 18, 'gold': 141, 'silver': 190, 'bronze': 447}}, 'isOfficiallyVerified': False, 'personalDetailSharing': 'no', 'personalDetailSharingRequestMessageFlag': False, 'friendRelation': 'no', 'requestMessageFlag': False, 'blocking': False, 'following': False}}

there's no region of the account in it

Ragowit commented 3 weeks ago

What if you add country to your fields parameter?

Ragowit commented 3 weeks ago

Anyway, this repo is about https://psn100.net, not API calls. You should really ask in https://github.com/Tustin/psn-php or just try and use the python repo: https://github.com/isFakeAccount/psnawp