The basic structure for all queries uses some or all of the following 'Components':
api/trigger/{Location}/{DataType} {Time} {Element} {Operator} {Value} {Unit}
Each of these query 'Components' will be available to the user to construct a logical query to return a response with a YES / NO answer. More info about response
There are two different ways to specify the location:
Latitude/Longitude Co-ordinates or post code/zipcode.
Valid decimal geolocation coordinates with the following format: "latitude,longitude", with no more than 3 decimal places.
A valid postcode with the following format: "country.postcode"
where country can be the available countries in our system.
Country | Value | Format (@ = Letter, # = Number) |
---|---|---|
United Kingdom | 'uk' | 'uk.postcode' |
United States | 'us' | 'us.#####' |
Argentina | 'ar' | 'ar.@####@@@' |
Austria | 'at' | 'at.#####' |
Australia | 'au' | 'au.#####' |
Belgium | 'be' | 'be.####' |
Brazil | 'br' | 'br.#####-###' |
Canada | 'ca' | 'ca.@#@ #@#' |
Denmark | 'dk' | 'dk.####' |
Finland | 'fi' | 'fi.#####' |
France | 'fr' | 'fr.#####' |
Germany | 'de' | 'de.postcode' |
Ireland | 'ie' | 'ie.@@@' |
Italy | 'it' | 'it.#####' |
Netherlands | 'nl' | 'nl.####' |
Norway | 'no' | 'no.####' |
Spain | 'es' | 'es.#####' |
Sweden | 'se' | 'se.### ##' |
Please contact us if you would like postcodes to be made available for another country.
There are 3 different Data Types you can query;
Please refer to the below tables for specific information on each Data Type;
You can query Past Weather data up to 7-days into the past. Past Weather queries require you define a ‘Time’. When you query Past Weather it will use the closest available data to your chosen location.
The Past Weather ‘Data Type’ is defined within the query using the text “pwx” or “past”
api/trigger/{Location}/past {Element} {Time} {Operator} {Value}
api/trigger/51.50,-0.12/past yesterday temperature gt 10
You can query Current Weather data. There is no need to define a ‘Time’ when querying Current Weather. When you query Current Weather it will use the closest available data to your chosen location.
The Current Weather ‘Data Type’ is defined within the query using the text “cwx” or “current”
api/trigger/{Location}/Current {Element} {Operator} {Value}
api/trigger/51.50,-0.12/current temperature gt 10
You can query Forecast Weather data up to 7-days into the future. Forecast Weather queries require you define a ‘Time’. When you query Forecast Weather it will use the closest available data to your chosen location.
The Forecast Weather ‘Data Type’ is defined within the query using the text “fwx” or “forecast”.
api/trigger/{Location}/forecast {Element} {TimePeriod} {Operator} {Value}
api/trigger/51.50,-0.12/forecast tomorrow temperature gt 10
Time period is only required for "past" and "forecast" data types. Queries for Current weather data returns the closest live observations. The time period can be defined in 4 different ways:
For a specific interval between two points in time, must contain two dates in the following format. The hour part (hh) is optional.: "yyyy.mm.dd,yyyy.mm.dd" or "yyyy.mm.dd.hh,yyyy.mm.dd.hh"
The day period can prefix a date with the following format: "day_period.yyyy.mm.dd"
The day period option helps run queries for specific periods in the day across multiple days. Day period prefix can be:
The day period can prefix a time frame between two dates, with the following format: "prefix.yyyy.mm.dd,yyyy.mm.dd"
For a predefined time span use the following format: "predefined_timespan"
or you can postfix it with a day period: "predefined_timespan.day_period"
The Precipitation Type element is defined within the query using the text “weather” or “wx”.
Any precipitation - "anyprecip"
Significant precipitation - "sigprecip"
Heavy precipitation - "heavyprecip"
Any rain - "anyrain" or "rain"
Significant rain - "sigrain"
Heavy rain - "heavyrain"
Any snow - "anysnow" or "snow"
Significant snow - "sigsnow"
Heavy snow - "heavysnow"
The Temperature element is defined within the query using the text “temperature” or “temp”. The Temperature element can be used for the following ‘Data Types’;
When using the Temperature element within the query the following ‘Operators’, ‘Values’ and ‘Units’ can be applied;
decimal value
Celsius "c" (default)
Fahrenheit "f"
The Relative Humidity element is defined within the query using the text “humidity” or “hum”. The Relative Humidity element can be used for the following ‘Data Types’;
When using the Relative Humidity element within the query the following ‘Operators’, ‘Values’ and ‘Units’ can be applied;
decimal value
Percentage (default)
The Wind Speed element is defined within the query using the text “windspeed” or “wspd”. The Wind Speed element can be used for the following ‘Data Types’;
When using the Wind Speed element within the query the following ‘Operators’, ‘Values’ and ‘Units’ can be applied;
decimal value
Meters per second "mps" (default)
Kilometers per hour "kmh"
Miles per hour "mph"
Knots "kn"
The Wind Direction element is defined within the query using the text “winddirection” or “wdir”. The Wind Direction element can be used for the following ‘Data Types’;
When using the Wind Direction element within the query the following ‘Operators’, ‘Values’ and ‘Units’ can be applied;
degrees (default)
compass "com"
Values 0 and 360 in degrees are equivalent and queries can accept either value. Therefore 0,90 degrees is equivalent to 360,90 degrees.
Between x,y - "x" is the start value, and "y" the finish value in a clockwise direction. Both values are also included.
Therefore between 45 and 90 degrees (45,90) would cover 45,46,47 ... 88,89,90 degrees.
Whereas between 90 and 45 degrees (90,45) would cover 90,91,92 ... 43,44,45.
The same principal is applied to compass values.
For example SE,NE would cover SE,S,SW,W,NW,N,NE compass points.
The Cloud Cover element is defined within the query using the text “Cloud” or “cld”. The Cloud Cover element can be used for the following ‘Data Types’;
When using the Cloud Cover element within the query the following ‘Operators’, ‘Values’ and ‘Units’ can be applied;
decimal value
Percentage (default)
The Visibility element is defined within the query using the text “visibility” or “vis”. The Visibility element can be used for the following ‘Data Types’;
When using the Visibility element within the query the following ‘Operators’, ‘Values’ and ‘Units’ can be applied;
decimal value
Kilometers "km" (default)
Miles "mi" (default)
The Air Pressure element is defined within the query using the text “pressure” or “pres”. The Air Pressure element can be used for the following ‘Data Types’;
When using the Air Pressure element within the query the following ‘Operators’, ‘Values’ and ‘Units’ can be applied;
decimal value
Millibars "mb" (default)
Inches "in"
The Precipitation Amount element is defined within the query using the text “precipitation” or “preciptl”. The Precipitation Amount element can be used for the following ‘Data Types’;
When using the Precipitation Amount element within the query the following ‘Operators’, ‘Values’ and ‘Units’ can be applied;
decimal value
Millimeters "m" (default)
Inches "in"
The Rainfall Amount element is defined within the query using the text “raintl”. The Rainfall Amount element can be used for the following ‘Data Types’;
When using the Rainfall Amount element within the query the following ‘Operators’, ‘Values’ and ‘Units’ can be applied;
decimal value
Millimeters "m" (default)
Inches "in"
The Snowfall Amount element is defined within the query using the text “snowtl”. The Snowfall Amount element can be used for the following ‘Data Types’;
When using the Snowfall Amount element within the query the following ‘Operators’, ‘Values’ and ‘Units’ can be applied;
decimal value
Centimeters "cm" (default)
Inches "in"
The ‘average’ function is defined by adding the text ‘.avg’ to the end of an element within a query. The ‘average’ function will return a response based on the ‘Element average’ for the defined time period.
The ‘average’ function can be added into queries using ‘Past’ and ‘Forecast’ data.
The ‘average’ function cannot be added into queries using ‘Current’ data.
The ‘average’ function can be added to the following elements;