How can I get a user's gamepasses?

I’m working for an update to my game and I need help finding an api to get a list of all gamepasses that a user owns in their roblox inventory.

I originally used something similar to the following roproxy url. However, it now seems to be depreciated giving a 404 error and I have been unable to find any alternatives when searching online.

"https://www.roproxy.com/users/inventory/list-json?assetTypeId=34&cursor=&itemsPerPage=100&pageNumber=1&userId=973402642"

The result:
1Keeth 404 Page Error

If you have any ideas please let me know.

Note: I’m doing this in studio and so can’t use the roblox api

Thanks for reading!
Have a wonderful day :slight_smile:

Use market place service or local player, check if there is any gamepass option. It cant be somewhere else

1 Like

This is not possible without the user’s permission, which currently requires them to offer up their password/OAuth2 token. There are no native APIs that circumnavigate that either

local HttpService = game:GetService("HttpService")

local function I(url, errorMessage)
    local success, result = pcall(function()
        return HttpService:GetAsync(url)
    end)

    if success then
        return HttpService:JSONDecode(result)
    else
        warn(errorMessage)
        return nil
    end
end

local function V(W, X)
    local Y = {}
    
    local Z = "https://games.roproxy.com/v2/users/" .. W.UserId .. "/games?accessFilter=2&limit=50&sortOrder=Asc"
    
    local R = I(Z, "Failed to load user's games.")
    
    if R and R.data then
        print("Game data:", R)
        
        for _, aa in pairs(R.data) do
            local ab = aa.id
            local ac = "https://games.roproxy.com/v1/games/" .. ab .. "/game-passes?limit=100&sortOrder=Asc"
            
            local R2 = I(ac, "Error: Failed to load game passes.")
            
            if R2 and R2.data then
                for _, ad in pairs(R2.data) do
                    if ad.price then
                        table.insert(Y, ad.id)
                    end
                end
            end
        end
    end
    
    return Y
end