Code Monkey home page Code Monkey logo

Comments (6)

cmfcmf avatar cmfcmf commented on July 22, 2024

Hi @zkimi,

please provide a reproducible code snippet of how you call the library. Did you follow the Getting Started section?

Note that you should not edit the OpenWeatherMap.php file but rather set your API key in the constructor parameter as can be seen in the example in the Usage section.

from openweathermap-php-api.

zkimi avatar zkimi commented on July 22, 2024

Hi thanks for your answer, yes I followed the Getting Started section.

Screenshot_1

Here's the file I made.
I put my API key where I wrote "MY API KEY IS HERE" and removed it in OpenWeatherMap.php and error is still here.

Thank you.

from openweathermap-php-api.

cmfcmf avatar cmfcmf commented on July 22, 2024

Thank you for your clarification 👍
I'm afraid I can't reproduce the issue, it works for me.
Does calling

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

with the X's replaced by your API key produce a result?

from openweathermap-php-api.

zkimi avatar zkimi commented on July 22, 2024

Yes I do have a result, that's really weird...
Screenshot_2

from openweathermap-php-api.

cmfcmf avatar cmfcmf commented on July 22, 2024

Ahh, maybe that's because the daily forecast API is not available for free API keys: https://openweathermap.org/price. You will have to use the getWeatherForecast API to retrieve 3-hourly forecasts instead, I suppose.

I didn't notice that initially, because the API key I use for testing does not seem to have this limitation for some reason.

from openweathermap-php-api.

zkimi avatar zkimi commented on July 22, 2024

Okay, thanks.

So how do I have the daily forecast for the next 3 days? I have to pay? :(
Thought it was free...

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.