Weather app: API key got blocked :(

I received this email today:

"Dear @Customer,
Your OpenWeatherMap API key […] is temporary blocked due to the continual sufficient exceeding of the calls per minute limit by performing 848 calls within a minute but the limit for the Free account is 60 rpm.

To unblock your API key and restore the normal operation with the weather API we ask you to surpress the loading from your API keys or upgrade your subscription. Contact us info@openweathermap.org for any help with choosing the proper type of the subscription."

I don’t have a clue why the calls per minute are suddenly this high. So I have two questions:

  1. Anyone knows what could be going on here?

  2. How can I surpress these calls? I obviously don’t want to upgrade to a payed version.

Hi,

if you are using codepen, disable the auto updating preview. It could be calling your api every time you type a character or two because it reloads all the javascript - you’ll then have to click RUN to see any changes you make. Either that or comment out the api call whilst you work on css etc

1 Like

Hi https://forum.freecodecamp.com/users/markj78 I have finished this app a few months ago and haven’t updated it since.
Or does it act the same when other people view the code?

Oh in that case… i’d probably generate a new key.

maybe also do a console log of the call response to make sure its not something in your code.

It’s weird. I just had a look at it and now it’s working again.
I think something really really odd happened when those 848 calls per minute were made.

i just logged your response too and nothing unusual there at all.

Could the key have been copied and used by somebody else?

yes, that’s why I said generate a new key. Just in case. Thing is though, its a public key, so anyone can get one and it may be displayed in the JS. Not worth stealing really. Maybe for mischief but that’s about it.

1 Like

Ok, got it. Thank you. I guess I just leave it like this for now.