how to get steam id c++

#include <iostream>
#include <fstream>
#include <sstream>
#include <string>

std::string GetSteamID(const std::string& profileURL) {
    std::string steamID;
    std::size_t found = profileURL.find_last_of("/");

    if (found != std::string::npos) {
        std::string idSubstring = profileURL.substr(found + 1);
        std::stringstream idStream(idSubstring);
        idStream >> steamID;
    }

    return steamID;
}

int main() {
    // Example Steam profile URL
    std::string profileURL = "https://steamcommunity.com/profiles/123456789";

    // Extract Steam ID from the profile URL
    std::string steamID = GetSteamID(profileURL);

    // Display the extracted Steam ID
    std::cout << "Steam ID: " << steamID << std::endl;

    return 0;
}