Using Derpibooru API in Java (403 Forbidden)

Ganondorf

Hi,
I am currently trying to use the API in Java to get the Tags of images (using the Image ID). But when I try to send the Get-Request I only get a 403 error back. I also tried adding my API key but that does not change anything.
Here is my code:
String startUrl = "https://derpibooru.org/api/v1/json/images/";
int id = 1;
String key = "censored";
String url = startUrl + id + "?key=" + key;
System.out.println("Opening URL " + url);
URL oUrl = new URL(url);
HttpsURLConnection con = (HttpsURLConnection) oUrl.openConnection();
con.setRequestMethod("GET");
con.setRequestProperty("Content-Type", "application/json");
con.setRequestProperty("cache-control", "no-cache");
con.setRequestProperty("Connection", "keep-alive");
con.setRequestProperty("Accept", "*/*");
con.setRequestProperty("Host", "derpibooru.org");
System.out.println(con.getResponseCode());
BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer body = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
   body.append(inputLine);
}
in.close();
con.disconnect();
Interested in advertising on Derpibooru? Click here for information!
Champions of Equestria

Help fund the $15 daily operational cost of Derpibooru - support us financially!

Syntax quick reference: **bold** *italic* ||hide text|| `code` __underline__ ~~strike~~ ^sup^ %sub%

Detailed syntax guide