I keep geeting HTTP Server response 429 when trying to get the json from the logs
This is my method that makes a request to the Logs.tf api, its written in java. Currently i basically get a List of Logs from a player(with having the limit set to 100, it works with having the limit set to 50 though) using the http://logs.tf/api/v1/log?player=Z&limit=X link and then parsing them one by one. First I Call this method to get the JSON and then a diffrent one to parse it, but around halfway through I get a 429 with the lmit set to 100.
My question is: is the Requestlimit the problem here or is my method somehow wrong?
//Gets the JSON String from a logURL
String getLogJson(URL logURL){
StringBuilder content = new StringBuilder();
try {
//Connect to Logs.tf and request a Log
HttpURLConnection con = (HttpURLConnection) logURL.openConnection();
con.setRequestMethod("GET");
//Reads the log JSON
BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
String inputLine;
while ((inputLine = in.readLine()) != null) {
content.append(inputLine);
}
//closes the connection
in.close();
con.disconnect();
} catch (IOException e) {
System.err.println("Connection Error");
e.printStackTrace();
}
//return the full json String
return content.toString();
}