admin管理员组

文章数量:1390519

I am using Steam's API to fetch player data. To do this you need to provide a steamID64 (76561197960435530) like this example shown here: /?appid=440&key=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&steamid=76561197960435530 however this can sometimes be tricky for my users as many have their own custom vanity url which does not provide the steamID64 for them to easily input. I know they could use use a website to look it up but this is not an option.

How would I take the input of a custom vanity profile URL like this: and convert this programatically into a steamID64 like this: 76561197960435530

I would like to implement this using JavaScript or by using an API.

I am using Steam's API to fetch player data. To do this you need to provide a steamID64 (76561197960435530) like this example shown here: http://api.steampowered./ISteamUserStats/GetUserStatsForGame/v0002/?appid=440&key=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&steamid=76561197960435530 however this can sometimes be tricky for my users as many have their own custom vanity url which does not provide the steamID64 for them to easily input. I know they could use use a website to look it up but this is not an option.

How would I take the input of a custom vanity profile URL like this: https://steammunity./id/customNameHere and convert this programatically into a steamID64 like this: 76561197960435530

I would like to implement this using JavaScript or by using an API.

Share Improve this question asked Jun 1, 2020 at 18:16 OrtovoxOrtovox 4521 gold badge12 silver badges18 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 7

Found the solution. Here it says you can use the following syntax to resolve a vanity url:

http://api.steampowered./ISteamUser/ResolveVanityURL/v0001/?key=XXXXXXXXXXXXXXXXXXXXXXX&vanityurl=userVanityUrlName

Don't quite know why it was hiding on the TF2 wiki though. I could have found it at https://steamapi.xpaw.me/#ISteamUser/ResolveVanityURL.

本文标签: javascriptHow to resolve a steam custom vanity profile URL to steamID64Stack Overflow