[Question] Looking for player-id endpoint
tbitowt opened this issue · 5 comments
Hi,
Do you know if there is any endpoint to get player-id from Name#Tag?
Hey! I've been looking for an endpoint like this for my own usage as well. I'll update this issue if I find anything useful. The best place to check for something like this would probably be the friend requests system. However that's managed via a different api that runs locally on the device, I'm assuming through the Riot Launcher. Since friend requests etc hit 127.0.0.1
with a random port, rather than the a.pvp.net
domain like all the others.
I've started some work on the RiotClientServices.exe
which is where all of the friend request stuff is managed.
Take a look at the new class I added: LocalRiotClientAPI.js
You could make a request to add the Name#Tag
as a friend, grab the puuid
which is the player Id, and then remove the friend, which would delete the friend request. Of course, if you are already friends, then just use the getFriends
method which lists all of your VALORANT friends and their puuid
.
Here's some example code, I haven't tested it, but it gives you an idea:
const Valorant = require('@liamcottle/valorant.js');
const localRiotClientApi = Valorant.LocalRiotClientAPI.initFromLockFile();
// add the friend
localRiotClientApi.addFriend('name', 'tag').then((response) => {
// log response, you can get puuid from it
console.log(response.data);
}).catch((error) => {
console.log(error);
});
Have a look at the notes in the class file, which explains that you need to run this code on the same PC where VALORANT is running for it to work.
@liamcottle , are you aware how RiotClientServices.exe is communicating to retrieve this data after a localhost API call from a client?
I haven't had a chance to reverse engineer the RiotClientServices.exe yet.
I was looking what is going on after localhost call with fiddler, but haven't found anything. Or the connection was established before I ran fiddler (but I have ran it before starting the RiotClientServices.exe
), or it works somehow different