This forum is now read-only. Please use our new forums at

752 points
Submitted by
Cas Hutten
almost 3 years ago

why do I get "Error: Access denied"?

Hello, I just started on "How to use APIs with JavaScript" and at the first lesson, when you are supposed to get "OK" but instead I get "Error: Access denied". But Codecademy just let met go to the next lesson. What can be the cause of this?

pre-filled code of codecademy
var xhr = new XMLHttpRequest();"GET", "", false);


2 votes


I am not sure if these lessons have been updated. Apparently, the requests should be made to not http://...

Try that and you should get a status and status text from the site.

938 points
Submitted by
almost 3 years ago

1 Comment

541205f07c82ca8c3e0006d0_207123532 Cas Hutten almost 3 years ago

Thank you, this worked for me!