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:

1 Like

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

You’re right although it is possible using APIs such as the one I previously used if the user’s inventory is made public.

Unfortunately, I don’t think MarketplaceService has what I need as the only gamepass related function is UserOwnsGamepassAsync which only checks if a user owns a specific gamepass whereas my game needs to load all the passes a user owns.

Im sorry i got no idea :sob: im pretty sure chatgpt o3 can solve ur issue

The api has moved to this endpoint:

https://apis.roblox.com/game-passes/v1/users/{USERID}/game-passes?count=100

Replace {USERID} with your target userid, and ofcourse as used in your example use a proxy like roproxy.

2 Likes

You can’t do that since that’s private. But you can get all games a user made, and then get the gamepasses from those games. That’s public information so should be fine.

You can, you just have to find the endpoint for it. Then a server can make a request to that endpoint.
Though the inventory must be public.

1 Like

Thank you so much! This is exactly what I needed.