What Open-Meteo is and why you might need it

Open-Meteo is a free weather data service that lets you pull current conditions, forecasts, and historical weather into your own website or app. You do not need to pay, and you do not need to ask permission — you can start using it when ready by making a request to their servers from your code.

The main reason to use it instead of building your own weather system: Open-Meteo already collects data from weather stations around the world and formats it in a standard way. If you are building a website that shows a five-day forecast, or an app that logs temperature every hour, Open-Meteo handles the data collection so you only write the code that displays it.

You will encounter the term API (process Programming Interface) when you read about Open-Meteo. An API is a set of rules that lets one piece of software ask another piece of software for information. Open-Meteo's API is the set of rules for asking their servers "what is the weather in Portland right now?" and getting back a structured answer your code can read.

Key Takeaways

  • Open-Meteo requires no sign-up, no API key, and no account — you can start using it by writing code that requests data from their web address.
  • The free tier allows up to 10,000 requests per day, which is enough for most small websites and learning projects.
  • You will need a basic text editor and a way to run code — either in a web browser using JavaScript, or on your computer using Python, Node.js, or another language.
  • The simplest first request takes three lines of code and returns weather data in JSON format, which is a standard way of organizing information that most programming languages can read.

Making your first request without signing up

Open-Meteo does not require you to create an account or obtain an API key. Instead, you make a direct request to their web address with the information you want, and they send back the weather data.

Open the address bar in your web browser and paste this exactly:

https://api.open-meteo.com/v1/forecast?latitude=40.7128&longitude=-74.0060¤t=temperature_2m,weather_code

This asks Open-Meteo for the current temperature and weather condition at latitude 40.7128, longitude -74.0060 (New York City). When you press Enter, your browser will display a block of text that looks like this:

{"latitude":40.7128,"longitude":-74.006,"generationtime_ms":0.123,"utc_offset_seconds":0,"timezone":"America/New_York","current":{"time":"2024-01-15T14:30","temperature_2m":42.5,"weather_code":80}}

That block is called JSON — a standard format for organizing data. Each piece of information is labeled: "temperature_2m" is 42.5 degrees, "weather_code" is 80 (which means light rain). Your code will parse this JSON, pull out the numbers it needs, and display them however you want.

Using Open-Meteo in JavaScript on a webpage

If you are building a website, the easiest way to use Open-Meteo is with JavaScript, the language that runs in web browsers. Open a text editor (Notepad on Windows, TextEdit on Mac, or any code editor), paste this code, and save it as weather.html:

<!DOCTYPE html><html><head><title>Weather</title></head><body><p id="weather">Loading...</p><script>fetch('https://api.open-meteo.com/v1/forecast?latitude=40.7128&longitude=-74.0060¤t=temperature_2m,weather_code')  .then(response => response.json())  .then(data => {    const temp = data.current.temperature_2m;    document.getElementById('weather').textContent = 'Temperature: ' + temp + '°F';  });</script></body></html>

Open that file in your web browser. The page will display "Loading..." for a moment, then show "Temperature: 42.5°F" (or whatever the current temperature is). The fetch command asks Open-Meteo for data, .then(response => response.json()) converts the text response into data your code can use, and the second .then pulls out the temperature and displays it on the page.

Using Open-Meteo in Python on your computer

If you are writing Python code, you can request weather data in three lines. Open a text editor, save a file as weather.py, and paste this:

import requestsresponse = requests.get('https://api.open-meteo.com/v1/forecast?latitude=40.7128&longitude=-74.0060¤t=temperature_2m')data = response.json()print(data['current']['temperature_2m'])

Open your terminal or command prompt, navigate to the folder where you saved the file, and type python weather.py. The script will print the current temperature. The requests library (which you may need to install with pip install requests first) handles the request to Open-Meteo, and response.json() converts the response into a Python dictionary you can read with square brackets.

Understanding latitude and longitude in the request

Every Open-Meteo request needs a latitude and longitude — the coordinates of the place you want weather for. In the examples above, 40.7128 and -74.0060 are New York City. The negative sign on the longitude means west of the Prime Meridian.

To find coordinates for a different location, search "[city name] latitude longitude" in your browser, or use a map service like Google Maps. Right-click on a location in Google Maps and the coordinates appear at the top of the menu. Paste those numbers into the URL or code in place of the New York coordinates.

Open-Meteo also accepts a timezone parameter if you want times in a specific zone. For example, adding &timezone=America/Los_Angeles to the end of the URL will return times in Pacific time instead of UTC.

What data you can request and the free tier limits

Open-Meteo offers many types of data beyond current temperature. You can request hourly forecasts, daily forecasts, historical data from past years, or specific variables like wind speed, precipitation, or humidity. The full list is in their documentation at open-meteo.com.

The free tier allows 10,000 requests per day from each IP address. A request is one call to their API — so if your website loads weather data once per page visit, and you get 100 visitors per day, you use 100 requests. If you need more than 10,000 requests per day, Open-Meteo offers a paid tier, but for learning, testing, or small projects, the free limit is rarely a problem.

Open-Meteo does not require you to identify yourself in any way. You do not need to include an API key, a user ID, or any authentication. This makes it straightforward to start, but it also means they cannot track which requests come from you — they only see your IP address.

Common mistakes and how to fix them

The most common error is a typo in the URL. Open-Meteo is case-sensitive, so temperature_2m will work but Temperature_2m will not. If you get an error message, copy the URL into your browser's address bar first to see what Open-Meteo actually returns — that will tell you whether the problem is the URL or your code.

The second common mistake is forgetting that latitude and longitude must be numbers, not text. If you are building a URL from user input, make sure you convert the input to a number first, or the request will fail silently.

If your code works on your computer but not when you upload it to a web server, the problem is usually CORS (Cross-Origin Resource Sharing). Browsers block requests from a webpage to a different domain unless the server says it is okay. Open-Meteo allows CORS requests, so this should not happen, but if it does, you may need to use a server-side language like Node.js or Python instead of JavaScript in the browser.

Frequently Asked Questions

Do I need an API key to use Open-Meteo?

No. Open-Meteo does not require an API key, account, or sign-up of any kind. You can start making requests when ready by pasting the URL into your browser or writing code that calls their servers.

What happens if I exceed 10,000 requests per day?

Open-Meteo will stop responding to requests from your IP address for the rest of that day. If you regularly need more than 10,000 requests, you can contact them about a paid plan, but most small websites and learning projects stay well under the limit.

Can I use Open-Meteo on a mobile app?

Yes. You can make requests from iOS, Android, or any platform that can send HTTP requests. The process is the same — you build a URL with the latitude, longitude, and data you want, send it to Open-Meteo, and parse the JSON response in your app's language.

What if I want historical weather data, not a forecast?

Open-Meteo has a separate endpoint for historical data. Instead of /v1/forecast, use /v1/archive and add a start_date and end_date parameter. Their documentation shows examples for requesting weather from any date in the past.

Is Open-Meteo data accurate?

Open-Meteo pulls data from public weather models and stations. Forecasts are as accurate as any free weather service, but they are not as detailed as paid services like Weather.com or the National Weather Service. For a hobby project or learning, the accuracy is fine. For a business that depends on precise forecasts, you may want a paid service with more support.