Comments (49)
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.
Hi @munkh-altai You should use appid not APPID
from openweathermap-php-api.
If you are a new start,it need ten minutes or more time before the key can use
from openweathermap-php-api.
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.
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.
thank you all. My problem solved. ;-)
@huynhit92
from openweathermap-php-api.
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.
from openweathermap-php-api.
Remove https:// and just use api.openweathermap.org/data/2.5/weather?q=London&appid=ba24c6018ddd72041749018d0c1b1ef8&units=metric
from openweathermap-php-api.
I tried the answers above but to no avail. ๐
from openweathermap-php-api.
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.
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.
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.
what changes did you make?
sorry, this is too old, i dont remember
from openweathermap-php-api.
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.
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.
The major problem is, it takes couple of hours to activate the API
from openweathermap-php-api.
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.
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.
I know the 15-30 minutes of waiting from the creation
from openweathermap-php-api.
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.
Hi @cmfcmf i was't use xxxx in APPID xxxx is just example.
But I it is fine working today.
from openweathermap-php-api.
Ok cool!
from openweathermap-php-api.
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.
Yup, me too. The suggestions here haven't worked
from openweathermap-php-api.
https://openweathermap.desk.com/customer/portal/questions/14413219-invalid-api-key
shit api!
https://openweathermap.org/faq
https://openweathermap.org/appid
https://github.com/search?q=openweathermap&ref=cmdform
from openweathermap-php-api.
from openweathermap-php-api.
https://github.com/liu044100/SmileWeather
https://github.com/buche/leaflet-openweathermap
https://github.com/michael-lynch/open-weather
from openweathermap-php-api.
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.
@Naveed-anwar123 you are using the samples.openweathermap.org
endpoint. You should use the api.openweathermap.org
endpoint instead.
from openweathermap-php-api.
Caution : Notice the difference between opostrophe and grave key
API - OpenWeatherMap ๋ ์จ Invalid api key
์ถ์ฒ: http://booolean.tistory.com/755 [boolean]
from openweathermap-php-api.
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.
Hi im haveing the next error:
Could you please post the code you are using?
from openweathermap-php-api.
what changes did you make?
from openweathermap-php-api.
{"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.
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.
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.
just wait for sometime(15 mins approx) after you signup or generate a api key, before calling the api ๐
from openweathermap-php-api.
You get this if trying to access a paid/premium service. Look for the free ones!
from openweathermap-php-api.
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.
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.
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.
hmm been waiting 2 hours, still getting the same error
from openweathermap-php-api.
{
"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.
{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.
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.
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.
Had the same issue, took about 20 mins before the API key started to work.
from openweathermap-php-api.
I too had the same issue, took about 10 mins before the API key started to work.
from openweathermap-php-api.
Related Issues (20)
- Zip Code? HOT 4
- Dealing with Internal error: 500001
- getRawWeatherGroupData() HOT 3
- OpenWeatherMap Class Not Found Error (NOT Installed through Composer) HOT 3
- GuzzleAdapter and Requestfactory excessive HOT 1
- getValue() error HOT 7
- $owm->getDailyWeatherForecast() HOT 6
- OWMNotFoundException never thrown
- Please add getForecast() method on WeatherForecast HOT 2
- Missing dependency psr/http-factory
- Move to Travis CI dot com or another CI service
- Add historic weather data HOT 1
- No method for One Call API HOT 4
- update to psr/cache to 3.0 ? HOT 1
- Return type of Cmfcmf\OpenWeatherMap\Util\Unit::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used HOT 1
- "Docusaurus" is spelled wrong in README.md HOT 1
- Replace UV Index API with One Call API
- typo HOT 1
- Convert Hourly Forecast into Daily Forecast
- Migrate to /guzzle7-adapter HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from openweathermap-php-api.