Weather

Basic principles

The Weather API is a RESTful API that provides for a specific location:

  • weather forecasts and reports on current weather conditions
  • information on severe weather alerts
  • information about when the sun and moon rise and set, and the phase of the moon

Weather observation example

{
        "url":"https://api.geoconcept.com/EU/GCW/geoconcept-web/api/lbs/weather.json",
        "type":"GET",
        "params": {
                "product": {
                        "sample":"observation"},
                "latitude": {
                        "sample":"47.26682"},
                "longitude": {
                        "sample":"-2.33794"}
        }
}

Parameters / Properties

Input

Input documentation, can be used too (without the credentials).

parameter description optional default

product

A parameter identifying the type of report to obtain.
The possible values are as follows:
- observation – current weather conditions from the eight closest locations to the specified location
- forecast_7days – morning, afternoon, evening and night weather forecasts for the next seven days.
- forecast_7days_simple – daily weather forecasts for the next seven days
- forecast_hourly – hourly weather forecasts for the next seven days
- forecast_astronomy – information on when the sun and moon rise and set, and on the phase of the moon for the next seven days
- alerts – forecasted weather alerts for the next 24 hours
- nws_alerts – all active watches and warnings for the US and Canada

no

latitude and longitude

Geographical coordinates in WGS-84-compliant format, specifying the area covered by the weather report.
For example, latitude=41.83&longitude=-87.68 requests a report for these coordinates.
The response is for the closest reporting stations to these coordinates.

yes *

name

Name of a city. If there is more than one match for the name, then the most populous location is in the response. Country, state and street name can be added to this parameter.
For example, the response for name=Berlin, USA is a report for the city of Berlin, New Hampshire, the response for name=Berlin, IL is a report for the city of Berlin, Illinois, and the response for name=Berlin is a report for the city of Berlin, Germany.

yes *

zipcode

ZIP code of the location. This parameter is supported only for locations in the United States of America.

yes *

hourlydate

Date for which hourly forecasts are to be retrieved. The format is YYYY-MM-DD or YYYY-MM-DDThh:mm:ss
Available only when the product parameter is set to forecast_hourly
If you set hourlydate for a date and time in the past or more than seven days in the future, the response does not contain any information. If you set hourlydate to the current date, the response contains hourly forecasts for the current date, including some forecasts before when you sent the query depending on the data in the system. If you set hourlydate to a future date, the response contains hourly forecasts for the entire day.

no

oneobservation

Boolean, if set to true, the response only includes the closest location.
Only available when the product parameter is set to observation.

no

false

language

Defines the language used in the descriptions in the response.
For example, the response for a query with language=french has descriptions in French.
The following languages are supported (danish, dutch, english, french, german, greek, hindi, italian, japanese, polish, portuguese, romanian, russian, spanish ).
If the language specified is not supported, the response contains descriptions in English.

no

english

metric

Boolean, defines whether metric or imperial units are used in the response.
If set to false, the response contains imperial units (feet, inch, Fahrenheit, miles).

no

true

(*) At least one of these latitude and longitude OR name OR zipcode must be assigned a value.

Output

See Output documentation.

Possible returns

Case of a correct answer (status is 200) 

{
    "observations": {
        "location": [
            {
                "observation": [
                    {
                        "daylight": "D",
                        "description": "Partly sunny. Mild.",
                        "skyInfo": "14",
                        "skyDescription": "Partly sunny",
                        "temperature": "19.00",
                        "temperatureDesc": "Mild",
                        "comfort": "19.00",
                        "highTemperature": "18.10",
                        "lowTemperature": "15.60",
                        "humidity": "64",
                        "dewPoint": "12.00",
                        "precipitation1H": "*",
                        "precipitation3H": "*",
                        "precipitation6H": "*",
                        "precipitation12H": "*",
                        "precipitation24H": "*",
                        "precipitationDesc": "",
                        "airInfo": "*",
                        "airDescription": "",
                        "windSpeed": "16.68",
                        "windDirection": "230",
                        "windDesc": "Southwest",
                        "windDescShort": "SW",
                        "barometerPressure": "1011.18",
                        "barometerTrend": "",
                        "visibility": "*",
                        "snowCover": "*",
                        "icon": "6",
                        "iconName": "mostly_cloudy",
                        "iconLink": "http://app-test.geoconcept.com/zEU/GCW/geoconcept-web/api/lbs/weather/icon/17.png",
                        "ageMinutes": "27",
                        "activeAlerts": "0",
                        "country": "France",
                        "state": "Pays de la Loire",
                        "city": "Pornichet",
                        "latitude": 47.2668,
                        "longitude": -2.3379,
                        "distance": 56.43,
                        "elevation": 0,
                        "utcTime": "2021-07-06T14:30:00.000+02:00"
                    }
                ],
                "country": "France",
                "state": "Pays de la Loire",
                "city": "Pornichet",
                "latitude": 47.26682,
                "longitude": -2.33794,
                "distance": 0,
                "timezone": 1
            },
            {
                "observation": [
                    {
                        "daylight": "D",
                        "description": "Overcast. Mild.",
                        "skyInfo": "18",
                        "skyDescription": "Overcast",
                        "temperature": "19.00",
                        "temperatureDesc": "Mild",
                        "comfort": "19.00",
                        "highTemperature": "*",
                        "lowTemperature": "*",
                        "humidity": "63",
                        "dewPoint": "11.78",
                        "precipitation1H": "*",
                        "precipitation3H": "0.03",
                        "precipitation6H": "0.03",
                        "precipitation12H": "*",
                        "precipitation24H": "*",
                        "precipitationDesc": "",
                        "airInfo": "*",
                        "airDescription": "",
                        "windSpeed": "25.95",
                        "windDirection": "220",
                        "windDesc": "Southwest",
                        "windDescShort": "SW",
                        "barometerPressure": "1011.10",
                        "barometerTrend": "Rising",
                        "visibility": "19.15",
                        "snowCover": "0.00",
                        "icon": "7",
                        "iconName": "cloudy",
                        "iconLink": "http://app-test.geoconcept.com/zEU/GCW/geoconcept-web/api/lbs/weather/icon/17.png",
                        "ageMinutes": "57",
                        "activeAlerts": "0",
                        "country": "France",
                        "state": "Pays de la Loire",
                        "city": "Nantes",
                        "latitude": 47.1667,
                        "longitude": -1.6,
                        "distance": 56.9,
                        "elevation": 23,
                        "utcTime": "2021-07-06T14:00:00.000+02:00"
                    }
                ],
                "country": "France",
                "state": "Pays de la Loire",
                "city": "Nantes",
                "latitude": 47.1667,
                "longitude": -1.6,
                "distance": 56.9,
                "timezone": 1
            },
            {
                "observation": [
                    {
                        "daylight": "D",
                        "description": "Partly sunny. Mild.",
                        "skyInfo": "14",
                        "skyDescription": "Partly sunny",
                        "temperature": "19.50",
                        "temperatureDesc": "Mild",
                        "comfort": "19.50",
                        "highTemperature": "*",
                        "lowTemperature": "*",
                        "humidity": "72",
                        "dewPoint": "14.28",
                        "precipitation1H": "*",
                        "precipitation3H": "0.00",
                        "precipitation6H": "0.00",
                        "precipitation12H": "*",
                        "precipitation24H": "*",
                        "precipitationDesc": "",
                        "airInfo": "*",
                        "airDescription": "",
                        "windSpeed": "22.24",
                        "windDirection": "220",
                        "windDesc": "Southwest",
                        "windDescShort": "SW",
                        "barometerPressure": "1011.70",
                        "barometerTrend": "Rising",
                        "visibility": "15.13",
                        "snowCover": "*",
                        "icon": "6",
                        "iconName": "mostly_cloudy",
                        "iconLink": "http://app-test.geoconcept.com/zEU/GCW/geoconcept-web/api/lbs/weather/icon/17.png",
                        "ageMinutes": "57",
                        "activeAlerts": "0",
                        "country": "France",
                        "state": "Pays de la Loire",
                        "city": "St-Sauveur",
                        "latitude": 46.7,
                        "longitude": -2.3333,
                        "distance": 63.1,
                        "elevation": 24,
                        "utcTime": "2021-07-06T14:00:00.000+02:00"
                    }
                ],
                "country": "France",
                "state": "Pays de la Loire",
                "city": "St-Sauveur",
                "latitude": 46.7,
                "longitude": -2.3333,
                "distance": 63.1,
                "timezone": 1
            },
            {
                "observation": [
                    {
                        "daylight": "D",
                        "description": "Partly sunny. Mild.",
                        "skyInfo": "14",
                        "skyDescription": "Partly sunny",
                        "temperature": "16.89",
                        "temperatureDesc": "Mild",
                        "comfort": "16.89",
                        "highTemperature": "*",
                        "lowTemperature": "*",
                        "humidity": "77",
                        "dewPoint": "12.78",
                        "precipitation1H": "*",
                        "precipitation3H": "0.00",
                        "precipitation6H": "0.00",
                        "precipitation12H": "*",
                        "precipitation24H": "*",
                        "precipitationDesc": "",
                        "airInfo": "*",
                        "airDescription": "",
                        "windSpeed": "35.21",
                        "windDirection": "210",
                        "windDesc": "Southwest",
                        "windDescShort": "SW",
                        "barometerPressure": "1010.20",
                        "barometerTrend": "Rising",
                        "visibility": "15.13",
                        "snowCover": "*",
                        "icon": "6",
                        "iconName": "mostly_cloudy",
                        "iconLink": "http://app-test.geoconcept.com/zEU/GCW/geoconcept-web/api/lbs/weather/icon/17.png",
                        "ageMinutes": "57",
                        "activeAlerts": "0",
                        "country": "France",
                        "state": "Brittany",
                        "city": "Le Talut",
                        "latitude": 47.3,
                        "longitude": -3.2167,
                        "distance": 66.46,
                        "elevation": 34,
                        "utcTime": "2021-07-06T14:00:00.000+02:00"
                    }
                ],
                "country": "France",
                "state": "Brittany",
                "city": "Le Talut",
                "latitude": 47.3,
                "longitude": -3.2167,
                "distance": 66.46,
                "timezone": 1
            },
            {
                "observation": [
                    {
                        "daylight": "D",
                        "description": "Overcast. Mild.",
                        "skyInfo": "18",
                        "skyDescription": "Overcast",
                        "temperature": "18.72",
                        "temperatureDesc": "Mild",
                        "comfort": "18.72",
                        "highTemperature": "*",
                        "lowTemperature": "*",
                        "humidity": "66",
                        "dewPoint": "12.22",
                        "precipitation1H": "*",
                        "precipitation3H": "0.00",
                        "precipitation6H": "0.00",
                        "precipitation12H": "*",
                        "precipitation24H": "*",
                        "precipitationDesc": "",
                        "airInfo": "*",
                        "airDescription": "",
                        "windSpeed": "20.39",
                        "windDirection": "230",
                        "windDesc": "Southwest",
                        "windDescShort": "SW",
                        "barometerPressure": "1011.90",
                        "barometerTrend": "Rising",
                        "visibility": "18.02",
                        "snowCover": "*",
                        "icon": "7",
                        "iconName": "cloudy",
                        "iconLink": "http://app-test.geoconcept.com/zEU/GCW/geoconcept-web/api/lbs/weather/icon/17.png",
                        "ageMinutes": "57",
                        "activeAlerts": "0",
                        "country": "France",
                        "state": "Pays de la Loire",
                        "city": "La Roche-Sur-Yon",
                        "latitude": 46.7,
                        "longitude": -1.3833,
                        "distance": 96.11,
                        "elevation": 85,
                        "utcTime": "2021-07-06T14:00:00.000+02:00"
                    }
                ],
                "country": "France",
                "state": "Pays de la Loire",
                "city": "La Roche-Sur-Yon",
                "latitude": 46.7,
                "longitude": -1.3833,
                "distance": 96.11,
                "timezone": 1
            },
            {
                "observation": [
                    {
                        "daylight": "D",
                        "description": "Partly sunny. Mild.",
                        "skyInfo": "14",
                        "skyDescription": "Partly sunny",
                        "temperature": "17.00",
                        "temperatureDesc": "Mild",
                        "comfort": "17.00",
                        "highTemperature": "*",
                        "lowTemperature": "*",
                        "humidity": "77",
                        "dewPoint": "13.00",
                        "precipitation1H": "*",
                        "precipitation3H": "*",
                        "precipitation6H": "*",
                        "precipitation12H": "*",
                        "precipitation24H": "*",
                        "precipitationDesc": "",
                        "airInfo": "*",
                        "airDescription": "",
                        "windSpeed": "20.39",
                        "windDirection": "240",
                        "windDesc": "Southwest",
                        "windDescShort": "SW",
                        "barometerPressure": "1012.19",
                        "barometerTrend": "",
                        "visibility": "*",
                        "snowCover": "*",
                        "icon": "6",
                        "iconName": "mostly_cloudy",
                        "iconLink": "http://app-test.geoconcept.com/zEU/GCW/geoconcept-web/api/lbs/weather/icon/17.png",
                        "ageMinutes": "27",
                        "activeAlerts": "0",
                        "country": "France",
                        "state": "Pays de la Loire",
                        "city": "La Roche",
                        "latitude": 46.7,
                        "longitude": -1.38,
                        "distance": 96.3,
                        "elevation": 87,
                        "utcTime": "2021-07-06T14:30:00.000+02:00"
                    }
                ],
                "country": "France",
                "state": "Pays de la Loire",
                "city": "La Roche",
                "latitude": 46.7,
                "longitude": -1.38,
                "distance": 96.3,
                "timezone": 1
            }
        ]
    },
    "feedCreation": "2021-07-06T12:57:23.235Z",
    "metric": true
}

Case of a missing parameter (status is 400) 

{
    "Type": "Invalid Request",
    "Message": [
        "Mandatory parameter latitude or longitude is missing"
    ]
}