How would i use Catalog/marketplace API?

just read this: External Catalog Queries | Documentation - Roblox Creator Hub

but don’t understand some of it. How would I get the script to print the item description? Could anyone give me some pointers? I am not asking for a full code.

I’m fairly sure HttpService isn’t able to send requests to Roblox sites, so not entirely sure that you would be able to utilize it within Roblox scripts. It would most likely give you a trust check failed error.

So if I were to try to find how many purchaseCount’s an item has, its not possible?

It is possible, just using the Catalog API wouldn’t be your best bet if you want to keep it all on Roblox. MarketplaceService might have what you’re looking for. I would look through the functions on the API reference.

1 Like

Just used the search feature and tried to find posts that show RAP since it is pretty similar. the Api doesn’t not have any info/

It is possible yes, You would need to create a proxy on some backend server then recieve requests from it to get the data. Although if your trying to do something like “Total sales of clothes per user”, It is possible / isnt. You would have to loop every single asset on the groups store, Which can take a while and hit the rate limits fast.

2 Likes

The Marketplace(Service) API is different to the Catalogue API.

As people have mentioned, if you want to use the Catalogue API, you would need to use HTTP Service and a proxy.

As SS4PPHIRE has mentioned, it is indeed possible with the MarkerplaceService

local MarketplaceService = game:GetService("MarketplaceService")
local assetId = 4962552589
local productInfo = MarketplaceService:GetProductInfo(assetId, Enum.InfoType.Asset)

:GetProductInfo() returns a dictionary, so we can find out it’s keys using a loop

for k, v in pairs (productInfo) do
    print(k .. ": " .. v)
end

This shows they keys are:

  • AssetTypeId
  • Description
  • IsNew
  • Updated
  • IsLimitedUnique
  • ProductId
  • MinimumMembershipLevel
  • Created
  • Creator
  • IsLimited
  • ContentRatingTypeId
  • TargetId
  • ProductType
  • IsPublicDomain
  • Sales
  • Name
  • PriceInRobux
  • AssetId
  • IconImageAssetId
  • IsForSale

Description is one of them so we can get the value by accessing as per a usual lua dictioarty

print(productInfo.Description)
--or
print(productInfo["Description"])

(The InfoType Enum supports different product types, but I assume you just want assets for the short demo)

The catalogue API you originally linked, is more suited to web servers rather than directly from a Roblox game, which I think is why we have the two APIs.

2 Likes

So it works, but is there any way more efficient then looping for a player when they join instead of going through what they own, which is inefficient?

If it’s just Decals or Models you wanted, you can use InsertService’s :GetUserSets() and :GetCollection() to get a list of assets the user owns in their decal or model set.

If it’s the users hats/inventory you’re after, then I don’t think this is possible. Bare in mind Roblox allows you to hide your inventory in settings as a privacy setting, so it’s probably not something you should be able to do for any user.

So clothing I guess, isn’t possible? since it is in the inventory.

1 Like