Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/jantoniogc/CursoReact-Clima/llms.txt

Use this file to discover all available pages before exploring further.

Clima React App fetches live weather data by calling the OpenWeatherMap Current Weather endpoint. Every request must include a valid API key via the appid query parameter. Without a working key, all queries will fail or be rejected by the API. The URL constructed in src/App.js looks like this:
const url = `http://api.openweathermap.org/data/2.5/weather?q=${ciudad},${pais}&appid=${appId}`;
The repository contains a hardcoded demo API key (0ce99c97e4fe1a22354d272a43c40232). This key may be rate-limited or revoked at any time. Always replace it with your own key before running the app in any non-trivial environment.

Get and configure an API key

1

Create a free account

Go to openweathermap.org and sign up for a free account.
2

Navigate to API Keys

After logging in, open your account dashboard and select the API Keys tab.
3

Copy or generate a key

Copy the default key or click Generate to create a new one. The free tier supports 60 calls per minute.
4

Replace the key in App.js

Open src/App.js and substitute the placeholder value for appId:
src/App.js
const appId = 'YOUR_API_KEY_HERE'; // Replace with your key
const url = `http://api.openweathermap.org/data/2.5/weather?q=${ciudad},${pais}&appid=${appId}`;

Request parameters

q
string
required
City and country code in {city},{countryCode} format — for example, Madrid,ES or Buenos Aires,AR.
appid
string
required
Your OpenWeatherMap API key. Obtain one from your account dashboard at openweathermap.org.

Response fields used by the app

name
string
City name returned by the API.
main.temp
number
Current temperature in Kelvin.
main.temp_max
number
Maximum temperature in Kelvin for the current conditions.
main.temp_min
number
Minimum temperature in Kelvin for the current conditions.
cod
string | number
Status code from the API. A value of '404' means the city was not found; the app uses this to display an error message instead of weather data.
The free tier of OpenWeatherMap allows up to 60 API calls per minute and 1,000,000 calls per month. For most development and personal use, these limits are sufficient without upgrading to a paid plan.

Build docs developers (and LLMs) love