Code Monkey home page Code Monkey logo

Comments (49)

cmfcmf avatar cmfcmf commented on May 28, 2024 78

For everyone reading this in the future: It can take "a couple of hours" until your API key is activated (see https://openweathermap.org/faq#error401).


Hi @altaihero, does calling the following URL in your browser work for you (replace the X's by your api key)?

http://api.openweathermap.org/data/2.5/weather?q=Berlin&APPID=XXXXXXXXXXXXXXXXXXXXXXXX

from openweathermap-php-api.

huynhit92 avatar huynhit92 commented on May 28, 2024 26

Hi @munkh-altai You should use appid not APPID

from openweathermap-php-api.

302wanger avatar 302wanger commented on May 28, 2024 22

If you are a new start,it need ten minutes or more time before the key can use

from openweathermap-php-api.

cmfcmf avatar cmfcmf commented on May 28, 2024 18

Hi @marlonlom!

Does the problem persist? Does calling http://api.openweathermap.org/data/2.5/weather?q=Berlin&APPID=XXXXXXXXXXXXXXXXXXXXXXXX directly from your browser work?
Please note that it takes a few minutes until your new api key is activated.

Let me know if it works now!

from openweathermap-php-api.

marlonlom avatar marlonlom commented on May 28, 2024 14

at now, it continue just like that...
{ cod: 401, message: "Invalid API key. Please see http://openweathermap.org/faq#error401 for more info." }

from openweathermap-php-api.

munkh-altai avatar munkh-altai commented on May 28, 2024 10

thank you all. My problem solved. ;-)
@huynhit92

from openweathermap-php-api.

Naveed-anwar123 avatar Naveed-anwar123 commented on May 28, 2024 10

http://samples.openweathermap.org/data/2.5/weather?q=Lahore,PK&appid=542ffd081e67f4512b705f89d2a611b2
Always return London weather. What the heck any body knows?

from openweathermap-php-api.

leosalass-zz avatar leosalass-zz commented on May 28, 2024 10

from openweathermap-php-api.

hirenbhal avatar hirenbhal commented on May 28, 2024 6

Remove https:// and just use api.openweathermap.org/data/2.5/weather?q=London&appid=ba24c6018ddd72041749018d0c1b1ef8&units=metric

from openweathermap-php-api.

mcsanantonio avatar mcsanantonio commented on May 28, 2024 5

I tried the answers above but to no avail. ๐Ÿ‘Ž

from openweathermap-php-api.

mapsgeek avatar mapsgeek commented on May 28, 2024 3

i'm calling it with appid={key} and it doesn't work ! this must be some kind of bug and failure in the API
i even deleted the API key and generated a new one still the same

from openweathermap-php-api.

cmfcmf avatar cmfcmf commented on May 28, 2024 2

Please note that it takes a few minutes until your new api key is activated.

If the key doesn't work after a few minutes, try contacting the OpenWeatherMap team. I can't really help with that. ๐Ÿ˜•

from openweathermap-php-api.

xgqfrms-GitHub avatar xgqfrms-GitHub commented on May 28, 2024 2

https error

https://api.openweathermap.org/data/2.5/weather?q=London&appid=xxxxxxx

http ok

http://api.openweathermap.org/data/2.5/weather?q=London&appid=xxxxxxx

from openweathermap-php-api.

leosalass-zz avatar leosalass-zz commented on May 28, 2024 2

what changes did you make?

sorry, this is too old, i dont remember

from openweathermap-php-api.

minsoo-web avatar minsoo-web commented on May 28, 2024 2

Hey guys.
I try to every this of answers and my result was same -> 401 Invalid API Keys

My solution is

If you just sign up user or create API keys, just wait a for minutes(or more) it was solved.

from openweathermap-php-api.

cmfcmf avatar cmfcmf commented on May 28, 2024 1

Hi @georgeharnwell, are you on a free account? The historical weather condition api is not free, see http://openweathermap.org/price (it was free months (years?) ago but isn't anymore).

from openweathermap-php-api.

aathil-Mr-ITGuy avatar aathil-Mr-ITGuy commented on May 28, 2024 1

The major problem is, it takes couple of hours to activate the API

from openweathermap-php-api.

giocorvo avatar giocorvo commented on May 28, 2024 1

Hi @altaihero, does calling the following URL in your browser work for you (replace the X's by your api key)?

http://api.openweathermap.org/data/2.5/weather?q=Berlin&APPID=XXXXXXXXXXXXXXXXXXXXXXXX

For everyone reading this in the future: It is most likely that a new API key takes a few minutes until it works.

Hi! For me your link works, (I know the 15-30 minutes of waiting from the creation). Please help me... If it could be useful, the script is here: https://github.com/DelManari/AR-Weather

from openweathermap-php-api.

DilinaHirantha avatar DilinaHirantha commented on May 28, 2024 1

you need to wait just 10-15 minutes because it will take time to activate your API key. after that you can use it as follow,

https://api.openweathermap.org/data/2.5/weather?q=London&appid=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

for me it worked perfectly!

from openweathermap-php-api.

giocorvo avatar giocorvo commented on May 28, 2024 1

I know the 15-30 minutes of waiting from the creation

from openweathermap-php-api.

Allenkayode avatar Allenkayode commented on May 28, 2024 1

it turns out that after creating a new Api key, you just have to wait for a few mins before activiation

from openweathermap-php-api.

munkh-altai avatar munkh-altai commented on May 28, 2024

Hi @cmfcmf i was't use xxxx in APPID xxxx is just example.
But I it is fine working today.

from openweathermap-php-api.

cmfcmf avatar cmfcmf commented on May 28, 2024

Ok cool!

from openweathermap-php-api.

georgeharnwell avatar georgeharnwell commented on May 28, 2024

Hi @cmfcmf,

I am now having this issue. I can successfully navigate to http://api.openweathermap.org/data/2.5/weather?q=Manchester,UK with my API key. But any of the historical calls I make are returning an Unauthorised error

Kind regards,
George

from openweathermap-php-api.

NahidRM avatar NahidRM commented on May 28, 2024

Yup, me too. The suggestions here haven't worked

from openweathermap-php-api.

xgqfrms-GitHub avatar xgqfrms-GitHub commented on May 28, 2024

https://openweathermap.desk.com/customer/portal/questions/14413219-invalid-api-key

shit api!

https://openweathermap.org/faq

https://openweathermap.org/appid

https://github.com/google/maps-for-work-samples/blob/master/samples/maps/OpenWeatherMapLayer/index.html

https://github.com/search?q=openweathermap&ref=cmdform

from openweathermap-php-api.

xgqfrms-GitHub avatar xgqfrms-GitHub commented on May 28, 2024

#46

from openweathermap-php-api.

xgqfrms-GitHub avatar xgqfrms-GitHub commented on May 28, 2024

https://github.com/liu044100/SmileWeather
https://github.com/buche/leaflet-openweathermap
https://github.com/michael-lynch/open-weather

from openweathermap-php-api.

cmfcmf avatar cmfcmf commented on May 28, 2024

Hey @xgqfrms-GitHub,

please stop spamming random links and sentences. If this was StackOverflow, I'd close this with "unsure what you are asking"...

If you are unhappy with what OpenWeatherMap provides, either argue with them directly or use a different, probably paid, service.

from openweathermap-php-api.

cmfcmf avatar cmfcmf commented on May 28, 2024

@Naveed-anwar123 you are using the samples.openweathermap.org endpoint. You should use the api.openweathermap.org endpoint instead.

from openweathermap-php-api.

khjoony avatar khjoony commented on May 28, 2024

Caution : Notice the difference between opostrophe and grave key
API - OpenWeatherMap ๋‚ ์”จ Invalid api key

์ถœ์ฒ˜: http://booolean.tistory.com/755 [boolean]

from openweathermap-php-api.

leosalass-zz avatar leosalass-zz commented on May 28, 2024

Hi im haveing the next error:
Client error: GET http://api.openweathermap.org/data/2.5/api/user/city resulted in a 401 Unauthorized response: {"cod":401, "message": "Invalid API key. Please see http://openweathermap.org/faq#error401 for more info."}

im trying to consume two diferent services:
1- api.openweathermap.org/data/2.5/weather?lat=10.9883696&lon=-74.8051523&units=metric&appid=xxxxxxxxxxxxxxxxxxxx

2- api.openweathermap.org/data/2.5/forecast?APPID=xxxxxxxxxxxxxxxxxxx&lat=10.9883696&lon=-74.8051523&units=metric

both are working on postman and web browser, but when i use it on my project i allways get 401 error.

on my front im useing laravel with vue + axios.get
on my back im working on laravel too,

the problem persists on front and back api calls.

other importrant point, im using laravel homestead(vagrant) for develipong

from openweathermap-php-api.

cmfcmf avatar cmfcmf commented on May 28, 2024

Hi im haveing the next error:

Could you please post the code you are using?

from openweathermap-php-api.

kevinmholbrook avatar kevinmholbrook commented on May 28, 2024

what changes did you make?

from openweathermap-php-api.

AnneRajan avatar AnneRajan commented on May 28, 2024

{"cod":401, "message": "Invalid API key. Please see http://openweathermap.org/faq#error401 for more info."}

I am using valid api key still its not working please help

from openweathermap-php-api.

YoganandamD avatar YoganandamD commented on May 28, 2024

If you just signed up, the automated email says that key will be activated in couple of hours. You should check back after couple of hours

from openweathermap-php-api.

curenosm avatar curenosm commented on May 28, 2024

Maybe it's just that you have to wait around 30 minutes to start using a new APPID, that happened to me.

from openweathermap-php-api.

Arunprasadh93 avatar Arunprasadh93 commented on May 28, 2024

just wait for sometime(15 mins approx) after you signup or generate a api key, before calling the api ๐Ÿ‘

from openweathermap-php-api.

aero77 avatar aero77 commented on May 28, 2024

You get this if trying to access a paid/premium service. Look for the free ones!

from openweathermap-php-api.

echu18 avatar echu18 commented on May 28, 2024

Hi @munkh-altai You should use appid not APPID

this worked for me! thanks! I changed APPID to appid in Postman and the weather data replaced the error message

from openweathermap-php-api.

jmgawecki avatar jmgawecki commented on May 28, 2024

hey guys. As mentioned before, I cannot get a request through my terminal as it says Invalid API key. But it does work through my browser.

curl -v http://api.openweathermap.org/data/2.5/weather?q=Berlin&APPID=MYAPIKEY - This is how I do it through my terminal. Is that wrong? Many thanks for help.

from openweathermap-php-api.

Andrii-Horpynchenko avatar Andrii-Horpynchenko commented on May 28, 2024

This is a working template - https://api.openweathermap.org/data/2.5/weather?q=Kharkiv&units=metric&APPID=XXXXXXXXXXXXXXXXXXXXXXXX.
Replace XXXXXXXXXXXXXXXXXXXXXXX with your API key

from openweathermap-php-api.

ispysoftware avatar ispysoftware commented on May 28, 2024

hmm been waiting 2 hours, still getting the same error

from openweathermap-php-api.

uzzal-mondal avatar uzzal-mondal commented on May 28, 2024

https://api.openweathermap.org/data/2.5/forecast/daily?q=dhaka&cnt=16&appid=d43795792c1050d9f397f55993a485d6

{
"cod": 401,
"message": "Invalid API key. Please see http://openweathermap.org/faq#error401 for more info."
}

how i can solve the issues.

from openweathermap-php-api.

shubhankar-mern avatar shubhankar-mern commented on May 28, 2024

{cod: 401, message: 'Invalid API key. Please see http://openweathermap.org/faq#error401 for more info.'}
my api key is very old....still getting the issue ..why?

from openweathermap-php-api.

Jatin9098 avatar Jatin9098 commented on May 28, 2024

While working with flutter I have the same issue.
While hitting the URL from browser the URL : https://api.openweathermap.org/data/2.5/weather?lat=26.5778&lon=78.494953&appid=525xxxxxxx598b

and hitting from the mobile URL will be changed to
https://api.openweathermap.org/data/2.5/weather %3F lat=26.5778&lon=78.494953&appid=525xxxxxxx598b

So after /data/2.5/weather use the query parameter while hitting the API

for Flutter it is solved below:
final queryParameters = {
'lat': '26.5778',
'lon': 78.494953',
'appid': '525xxxxxxx598b',
};
var url = Uri.https('api.openweathermap.org', '/data/2.5/weather',queryParameters);

from openweathermap-php-api.

IoIxD avatar IoIxD commented on May 28, 2024

Unfortunately whoever downvoted that person who said it can take two hours was downvoting in vain.

OpenWeatherMap themselves say that it can take a few hours for an API key to be valid.

Why it takes so long is beyond me but I hope this helps somebody.

from openweathermap-php-api.

rajhlinux avatar rajhlinux commented on May 28, 2024

Had the same issue, took about 20 mins before the API key started to work.

from openweathermap-php-api.

SadakVali avatar SadakVali commented on May 28, 2024

I too had the same issue, took about 10 mins before the API key started to work.

from openweathermap-php-api.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.