Contribute CoCoRaHS and NWS data to improve forecast accuracy.
curl --request PUT \
--url https://weather.io/forecast/forecast \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"city": "Albuquerque",
"zipCode": "87101",
"dataValue": "0.5 inches"
}
'import requests
url = "https://weather.io/forecast/forecast"
payload = {
"city": "Albuquerque",
"zipCode": "87101",
"dataValue": "0.5 inches"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({city: 'Albuquerque', zipCode: '87101', dataValue: '0.5 inches'})
};
fetch('https://weather.io/forecast/forecast', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"message": "Data contribution successful. Thank you for helping improve our forecasts!"
}{
"error": "Invalid data provided. Please check your input and try again."
}{
"error": "Unauthorized. Please provide a valid API key."
}{
"error": "Forbidden. You do not have permission to access this resource."
}{
"error": null
}Endpoints
Update Forecast
PUT
/
forecast
Contribute CoCoRaHS and NWS data to improve forecast accuracy.
curl --request PUT \
--url https://weather.io/forecast/forecast \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"city": "Albuquerque",
"zipCode": "87101",
"dataValue": "0.5 inches"
}
'import requests
url = "https://weather.io/forecast/forecast"
payload = {
"city": "Albuquerque",
"zipCode": "87101",
"dataValue": "0.5 inches"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({city: 'Albuquerque', zipCode: '87101', dataValue: '0.5 inches'})
};
fetch('https://weather.io/forecast/forecast', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"message": "Data contribution successful. Thank you for helping improve our forecasts!"
}{
"error": "Invalid data provided. Please check your input and try again."
}{
"error": "Unauthorized. Please provide a valid API key."
}{
"error": "Forbidden. You do not have permission to access this resource."
}{
"error": null
}Headers
Query Parameters
Type of precipitation being reported. Can be one of the following- 'Rain, Snow, Hail, Sleet, Slurry, Ice, Mixed, or Other.' Default is 'Rain'. If 'Other', then define the precipiationType in additionalInfo
Available options:
Rain, Snow, Hail, Sleet, Slurry, Ice, Mixed, Other Body
application/json

