Trouble accessing robotevents API

So recently, I’ve been working on a Discord bot written in C# that needs to access the robotevents API, and until now I’ve had no issues with it. I logged into the site and created an access token, and everything worked perfectly, up until today. Without changing any of the relevant code, robotevents.com suddenly stopped responding. I can still load the website in a browser perfectly fine, but my http GET request freezes up. I’m able to make a request from the API page without issue:

image

Here’s a program showing the code I use, which previously would have worked:

code
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;

class Program
{
    public static async Task Main(string[] args)
    {
        HttpClient _client = new HttpClient();
        _client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "[token]");
        Console.WriteLine("requesting...");
        string url = "https://www.robotevents.com/api/v2/events";
        Console.WriteLine(await (await _client.GetAsync(url)).Content.ReadAsStringAsync());
        Console.WriteLine("done!");
    }
}

I’ve tried this code on multiple machines, each getting stuck no matter what part of robotevents.com I try to access, api or otherwise. If I change the url to a generic website like https://vexforum.com then it works as expected, printing the received html. This would lead me to believe there is currently a problem with the robotevents site, which is puzzling as other Discord bots which access robotevents are still working.

1 Like

Try trapping the response code from RobotEvents. Earlier this year, I noticed that they’ve started implementing some sort of rate limiter. You’ll probably want to add retry logic to your code - in most situations like this “Exponential Backoff Retry” is the way to go

2 Likes