How do I put every melee gear's id from the catalog into an array?

The title pretty much explains it.

I just want a way to shove every melee gear id into a list in order to automate a tedious process I would otherwise have to do manually.

I tried using a proxy in studio for the catalog api and that didn’t work, so is there another way that I could get a list of all those gears?

Thanks

There’s some catalog API docs on the wiki, but you can avoid reading it and just add “json” before your params. This makes the URL for the gear list as JSON:
http://search.roblox.com/catalog/json?PageNumber=X&Category=5&Gears=1&SortType=3&Direction=2

I made a quick Python 3 script to pull this data.

Script Source
import requests
from time import sleep

# Base URL
baseUrl = "http://search.roblox.com/catalog/json?PageNumber=%d&Category=5&Gears=1&SortType=3&Direction=2"

# Get gear items until we run out of results
pageNum = 1
gear = list()

while True:
    resp = requests.get(baseUrl % pageNum).json()
    print("Page %d: %s" % (pageNum ,baseUrl % pageNum))

    # Ensure there is data on this page (if not we have reached the end)
    if not resp:
        break

    # Add to assets list
    for asset in resp:
        gear.append(asset["AssetId"])

    # Continue on next page
    pageNum += 1
    sleep(0.5) # Be kind to ROBLOX servers

# Output the data
print(gear)
print("%d Items" % len(gear))

The result is the following, which could easily be converted to a Lua table if you wanted to.

Output
...
[1208300505, 1117745433, 1117743696, 315617026, 1088051790, 1088051376, 1060280135, 1046323916, 1046322934, 346686597, 1033136271, 12187348, 972189904, 25740034, 98411325, 77443704, 90211299, 77443436, 66416579, 68233678, 64647651, 61459718, 56561579, 56561593, 55917420, 50938773, 50454041, 49491808, 51760061, 50938746, 54694334, 49929746, 51757162, 49929724, 44115185, 49052716, 43708943, 47871597, 45513203, 489196923, 37816777, 341110180, 42847923, 24440014, 23727705, 22787168, 22788134, 244081145, 28275809, 23306097, 25545089, 24346755, 22152234, 22787189, 21439778, 18409191, 21294489, 186958653, 21754543, 20721924, 176087505, 21445765, 18017365, 18482570, 21439893, 21802000, 20577851, 18776718, 18481407, 21416138, 139578571, 146047188, 124472052, 928914739, 928794651, 903199054, 903197575, 880499904, 846792499, 51346471, 34398653, 26777410, 13207169, 12775410, 12187431, 12187319, 10468915, 754871615, 754869699, 83704165, 68603324, 16895215, 73799348, 746687364, 746686384, 16641274, 125013769, 81154592, 709400407, 698862470, 431038614, 181550181, 629893424, 602146440, 583157224, 361950297, 335086410, 317593132, 302502491, 295461517, 286526176, 268533320, 255800577, 243791145, 233519998, 191261930, 188853857, 187688069, 14719505, 14131602, 14131296, 11956382, 11885154, 11453385, 11452821, 10910681, 10831489, 10758456, 10510024, 10469910, 532254782, 517827255, 522587921, 503955938, 483308034, 478707595, 120307951, 435116927, 68848741, 416846710, 409745306, 402304782, 94794774, 93136746, 86494893, 72069888, 64220933, 62350856, 170897263, 383609201, 365674685, 264990158, 356213216, 221181437, 335085355, 243778818, 317593302, 306971659, 306971294, 302280931, 295460702, 123234673, 287424278, 287426148, 280662903, 280662667, 268586231, 95951291, 254608905, 243791329, 243790334, 244082303, 160198658, 241511828, 241512134, 241017426, 241017568, 54130559, 46360920, 108158379, 233520257, 158069180, 101191388, 108149175, 226205948, 223785065, 223439643, 14876573, 11999235, 218631128, 181356054, 95951330, 168142394, 94794833, 172298750, 212500257, 120749528, 50938765, 156467990, 159229806, 73829193, 139577901, 99119240, 80661504, 69499437, 93136802, 73232786, 101106419, 48395736, 96669943, 53623322, 61963621, 48159731, 206136361, 206136532, 72069827, 178076749, 204095724, 204095670, 59190534, 189756588, 121946387, 183665514, 183797762, 183826384, 60357982, 183355969, 82357079, 92628079, 46360870, 48159648, 74385386, 174752186, 173755801, 170903610, 170902990, 168141496, 168140813, 168140949, 168141301, 53623350, 38326803, 83704190, 87361995, 142498104, 68539623, 160198363, 160189476, 160189871, 160189629, 159199263, 159199218, 158069110, 158069071, 157205837, 156467855, 156467926, 155661985, 149612243, 147937443, 147143821, 147143863, 147143881, 147143848, 68478587, 139578136, 139578061, 127506364, 127506324, 126719120, 126719148, 125013849, 47262951, 46846024, 117498849, 116693735, 85879456, 114020557, 112591894, 109583846, 108875151, 108158439, 108149201, 105351545, 107458531, 106701702, 106064277, 106064469, 105289761, 103359953, 97161222, 100469994, 99797381, 87361662, 96669687, 96669697, 96669682, 93536867, 93536785, 93136674, 93136666, 92627988, 69947367, 77443461, 77443491, 32858699, 83704169, 88885481, 86494914, 85879447, 85145626, 84418938, 83704154, 81847570, 80597060, 75550928, 74904413, 73829214, 73232803, 71597048, 71037101, 71037076, 69947379, 67319425, 65969704, 65079090, 62350883, 62350846, 60888284, 60888308, 60357959, 59175777, 55917409, 48159815, 54694329, 54694324, 54130537, 54130543, 53623248, 53130850, 51757126, 51346336, 49929767, 45177979, 32858586, 26421972, 46132907, 44561450, 40493542, 37821996, 30847746, 27171403, 17680660, 12145515, 10831509, 15176169, 15470359, 15970544, 13206984]
359 Items

I’m not sure what ROBLOX’s policy on HttpService requests to ROBLOX domains now, but you could probably change this script to Lua pretty easily, and put it through your proxy if you need to.

5 Likes

I actually just figured out how to do it with a java program. I’m sorry I didn’t update sooner.

Thanks for your help though, your code looks incredibly helpful!

Again, i’m super sorry.

We can close this post (I don’t know who to message about that)

No worries. Happy developing!

1 Like

No closing, but you can mark a post as a solution so it’s clear the thread is solved.