Web API Limit 429 (How can I solve?)

Hello developers, I’m working on a python code that scans my list of users to see if they are suitable for the promotion. I was late to do that so I have to do it right now and fast.

I wrote a code that promoted users one by one. It’s working perfectly how I wanted but after some successful attempts, I’m getting error 429 (So many attempts).

My code is containing only 2 requests from Roblox. I tried to delay it by 1 second but still not worked. Do I have to try to use proxies or Is my way to promote is wrong? Thanks for any help or advice.

Hi there. Before answering your question, would it be possible to provide what API endpoint you used? I just want to check if there’s anything specified about that specific code on the API Docs page.

If it really is a “too many attempts” error (which it probably is), then it means that you are probably making too many attempts, whether from that script or other scripts combined. I’ve made a bot previously that does like 14 requests to Roblox APIs in the same second (14 different API endpoints), with 4 of those requests being recursive and rerunning up to 10 times, meaning that the total requests could be up to 50 per 5 seconds. Sometimes, this command was ran multiple times, meaning that within 10 seconds, there could have been 200 requests. Never have I personally gotten a 429 error. That said, it is possible that your code is making a lot of requests somewhere or that the account you are using for making the requests is being used by other external sources, causing it to reach its call limit cap.

your web hosts has maybe a ddos protection or might be like a 100 visits/month limitation. ddos protections limits your ip on accessing your web, like 15 requests per few seconds or maybe a few minutes. limitations is some strategy your hosting provider use to make you pay a membership for more or unlimited requests. if your game requests to much on it, it will soon reach the limit and you may not be able to send a http request to the hosting and you might have to wait a month

He is running a Python script while using the Web API. I do not believe this applies here. Roblox isn’t making requests to him, he is making requests to the Roblox servers. Having a limitation on outgoing requests sounds a bit unrealistic. Most services don’t limit incoming and outgoing requests, at least for VPS’s that is. Only services that have a limit like that are usually database services or email services, as well as API services, but I personally have never seen VPS’s that limit requests.

Like he said, he is running an external Python script that promotes a user. No game is requesting to him as far as I’m aware, and the issue isn’t on Roblox and his servers, but with his Python script updating ranks via the Roblox’s Web APIs.

oh, i did a misunderstanding there sorry haha

1 Like

Hello thanks for answering me, I recently changed code to doing steps more easier. Right now, my python script is only saving the ID’s of the usernames because of I want to use ID’s later.

I’m using get by username
https://api.roblox.com/users/get-by-username?username=roblox

By the way, I tried to run it with my Local Device recently, is it wrong?
And I changed my API’s permission to 0.0.0.0/0 “Because I can try use proxies” Is it would be the problem?

I will be honest, I have never messed around with changing the DNS server and such, so I cannot enlighten you on this problem. For me, I simply ran my bot on my computer and then on a VPS, and it worked everywhere. If you are saying that it works sometimes and doesn’t work at other times, then it means that the requests work but then you are being limited by Roblox itself. Are you sure that you aren’t accidentally making 1000 requests or something? It might also be smart to pass a cookie (create an alternative account for this one) because maybe Roblox is limiting non-signed in users.

What code did you use to do that?

I’m using python requests library.

for username in usernames:
        time.sleep(1)
        
        response = requests.get(f"https://api.roblox.com/users/get-by-username?username={username}&api_key={api_key}")
        
        if response.status_code == 200:
           
            user_id = response.json()["Id"]
            
            f.write(f"{user_id}\n")
            
            print(f"Converted {username} to {user_id}")
        else:
            print(f"Failed to convert {username} ({response.status_code})")

status_code is 429

I’m adding delay to make it work, It’s really odd. Sometimes working and sometimes not. I’m using API key as well, working at 0.0.0.0/0
About the requests, I’m not sure. I think I’m getting requests as how is it should be.

How many usernames are you searching through? That might be the issue.

  1. api.roblox.com has been deprecated. Pretty sure it has something to do with routing everything into one IP but nevermind that.

Use this instead:

response = requests.post(f"https://users.roblox.com/v1/usernames/users", json = {
  "usernames": [
    username
  ]
})
users = response.json()["data"]
if len(users) == 0:
  print("User not found")
else:
  user = users[0]
  userId = user["id"]
  print(f"User id: {userId}")
1 Like

My list containing total of 2698 usernames that have to be converted into their ID’s.

Really Interesting… It worked better than I expected. I can run my code faster and decrease delay. Thanks mate.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.