API Version 1

2016-11-11

This is the latest stable version.

General description

This is a REST API, served over HTTPS.

Unless stated otherwise, the only supported method for all requests is HTTP GET.

The API is served exclusively over HTTPS.

API versioning

The API URLs include the version number. Multiple versions of the API may be supported concurrently. Read our API contract for more information.

Base URL

Host

The hostname depends on the installation and DNS configuration (e.g., the service could be accessed via CNAME records). In the general case, you may expect the service to be available under wxt.navlost.eu as the canonical hostname, and this is what we will use throughout the documentation.

URL prefix

All requests will be served from /api/v1/.

Note: v1 is the prefix for version 1 of the API.

Authentication

Two types of authentication are supported:

Basic authentication

This is the default authentication method, and is required for certain administrative operations such as generating tokens or changing a user’s password.

Password change

Your account’s password may be changed via the following endpoint:

POST https://user:passwd@wxt.navlost.eu/api/v1/auth/user/{user}/password

Content-Type: application/json

{
"hash": "Hex-encoded password hash",
"algorithm": "sha256|sha384|sha512"
}

Parameters:

Alternatively, instead of a JSON object, you can also supply the new password in plain text as a string literal in the POST body:

Content-Type: application/json

"newpassword"

Note that the content type still has to be application/json, and note the double quotes surrounding the password, needed to make it a valid JSON string literal.

Token-based authentication

This type of authentication allows a user to delegate his authority to access the service to another party, for a limited time, without having to reveal his credentials.

Usage

The user generates a token by using the appropriate API call, then somehow transmits that token to the third party. The third party presents the token to the service in an HTTP header named AUTH-TOKEN, the value of which is the verbatim token.

If the token is valid, not expired, and sufficient for the endpoint being accessed, the client will be granted access under the generating user’s credentials.

If the token does not comply with all of the above conditions, access will be denied with an HTTP 401 error code.

Create

POST https://user:passwd@wxt.navlost.eu/api/v1/auth/token/new

Content-Type: application/json

{
"expires": "ISOTStamp|TTL",
"ip_address": "IPv4|IPv6"
}

Parameters:

Both request parameters are optional. The request body may be omitted althogether if defaults are used.

On success, it returns HTTP 201 (Created)

Example requests:

{
"expires": "2016-01-01T00:01:23Z",
"ip_address": "2a00:1450:400d:807::200e"
}

{
"expires": 600
}

Example response:

{
"token": "34a8b18e53f091e442a3da04bbbe46af335855dab89fcd84470b9b4f2dd0341c5ab26d66b8e8a85971a57bbfc50666d1afe0b75560016351da92203faf66b052",
"expires_on": "2016-01-01T22:32:52.175Z"
}

Delete

DELETE https://user:passwd@wxt.navlost.eu/api/v1/auth/token/{token}

This command immediately expires a token.

It responds always with HTTP 202 (Accepted), regardless of whether or not {token} exists or has ever existed. Tokens may only be deleted by the user who has created them.

Retrieve

GET https://user:passwd@wxt.navlost.eu/api/v1/auth/token/

Returns the list of currently active tokens for the user.

Example response:

{
"tokens": [
{
"ip_address": "",
"created_on": "2016-01-01T10:35:35.798Z",
"token": "713399736b4ebf886680bc4dfe1cff32f536475e4fa1567480b3b19d030be8776e5244c98d7e092f67773cda8574344c11ebe1373c9fa096904c506b208a3557",
"expires_on": "2016-01-01T11:35:34.952Z"
}
]
}

Use

Tokens may be used with any non-administrative request. That is to say, those which retrieve non-user-specific data, such as forecast weather.

To use a token, include it in the request as a header named AUTH-TOKEN, as in the following example—we use curl for illustration purposes:

curl -H "AUTH-TOKEN: 713399736b4ebf886680bc4dfe1cff32f536475e4fa1567480b3b19d030be8776e5244c98d7e092f67773cda8574344c11ebe1373c9fa096904c506b208a3557" \
"https://wxt.navlost.eu/api/v1/f/"

If a token ceases to be valid, e.g., because it has expired or been removed, the server will respond with HTTP 401 (Unauthorized), in which case the user should obtain another token and retry the request.

Data requests: Summary

List of forecast items:

GET https://user:passwd@wxt.navlost.eu/api/v1/f/


Forecast item data:

GET https://user:passwd@wxt.navlost.eu/api/v1/f/{elements}


Forecast values: at current time:

GET https://user:passwd@wxt.navlost.eu/api/v1/f/{elements}/{locations}


Forecast values: at a specific time:

GET https://user:passwd@wxt.navlost.eu/api/v1/f/{elements}/{locations}/{epochs}


Forecast values: other than ground level:

GET https://user:passwd@wxt.navlost.eu/api/v1/f/{elements}/{locations}/{epochs}/{levels}


METAR / TAF reports:

GET https://user:passwd@wxt.navlost.eu/api/v1/r/{reports}/{icaoOrLoc}?count={count}&output={output}

Data requests: Generalities

Request method

In general, data requests are GET-based endpoints where all the request parameters are specified in the URL. In many cases multiple values may be specified for a given parameter (such as element types, locations, times, etc.) by separating the different values with a semicolon, as will be shown latter in the examples.

Response type

The default response type is application/json, although other formats may be supported. At the present time, there is partial support for comma-separated value (CSV) responses.

The response JSON object for this version of the API aims for brevity and usually follows a hierarchical pattern to group multiple values according to location, date, etc.

Value lists

Please note that, as a general rule, lists of values are not sorted on the server. It is expected that any sorting that may be needed will be done client-side.

Vertical levels specification

To specify the vertical level that a data request refers to, when applicable, the following conventions are used:

Aeronautical format

Level Examples
Feet above mean sea level A5000
Metres above mean sea level M1500
Flight level (feet) F100
Flight level (metric) S30

Distance above mean sea level

Level Examples
Metres above MSL 1000 m
Feet above MSL 3000 ft

Negative values are also accepted, although at present they would not return any data.


Common geographic datums

Level Specification
Ground GND, or SFC
Mean sea level MSL

Datums of meteorological interest

Level Specification (short) Specification (long)
Freezing level frzl 0c-isotherm
Tropopause tpp tropopause
Maximum wind level mwl max-wind
Highest tropospheric freezing level htfl highest-tropospheric-freezing-level

Clouds

Level Specification (short) Specification (long)
Boundary layer cloud bottom bcb boundary-cloud-bottom
Boundary layer cloud top bct boundary-cloud-top
Low cloud bottom lcb low-cloud-bottom
Low cloud top lct low-cloud-top
Mid cloud bottom mcb middle-cloud-bottom
Mid cloud top mct middle-cloud-top
High cloud bottom hcb high-cloud-bottom
High cloud top hct high-cloud-top
Convective cloud bottom ccb convective-cloud-bottom
Convective cloud top cct convective-cloud-top

Data requests: Detail

For brevity, the authentication part of the URLs (user:passwd@) will be omitted in the following examples, but either basic authentication or a token need to be used for every request.

List of forecast items

This is data coming from a numerical forecast model, either directly or derived from it.

GET https://wxt.navlost.eu/api/v1/f/

Retrieves a list of available forecast elements, such as wind, temperature, etc.

Response

Content-Type: application/json

An array of objects, each representing an available forecast element. Each object exposes three properties:

[
{
"name": "UGRD",
"description": "U-Component of Wind",
"unit": "m/s"
},
{
"name": "VGRD",
"description": "V-Component of Wind",
"unit": "m/s"
},
{
"name": "RH",
"description": "Relative Humidity",
"unit": "%"
}
]

Forecast item data

GET https://wxt.navlost.eu/api/v1/f/{elements}

Where {elements} is one or more element names, separated by a semicolon.

Examples

GET https://wxt.navlost.eu/api/v1/f/RH

Get RH (relative humidity) element information.

GET https://wxt.navlost.eu/api/v1/f/RH;UGRD;VGRD

Get information for the RH, UGRD, and VGRD elements.

Response

Content-Type: application/json

An array of objects, one for each recognised element containing, in addition to the properties previously described, a list of epochs available (as ISO-8601 formatted strings), and a list of available vertical levels, typically isobaric levels in hectoPascals or a specific surface, such as ground level or mean sea level.

Note that only the minimum and maximum values for epochs and isobaric levels are significant, as interpolation will occur between the closest two epochs/levels if the exact values are not directly available. Do note also that minima and maxima are not necessarily the first and last elements in a list, as can be seen in the following example response.

[
{
"name": "RH",
"description": "Relative Humidity",
"unit": "%",
"epochs": [
"2016-01-09T16:00:00.000Z",
"2016-01-04T18:00:00.000Z",
"2016-01-26T11:00:00.000Z",
"2016-01-31T09:00:00.000Z"
],
"levels": [
{
"unit": "hPa",
"value": 800
},
{
"unit": "hPa",
"value": 950
},
{
"unit": "hPa",
"value": 30
},
{
"unit": "hPa",
"value": 550
},
{
"unit": "GND",
"value": 0
}
]
},
{
"name": "UGRD",
"description": "U-Component of Wind",
"unit": "m/s",
"epochs": [
"2016-01-09T16:00:00.000Z",
"2016-01-04T18:00:00.000Z",
"2016-01-26T11:00:00.000Z",
"2016-01-31T09:00:00.000Z"
],
"levels": [
{
"unit": "hPa",
"value": 800
},
{
"unit": "hPa",
"value": 950
},
{
"unit": "hPa",
"value": 30
},
{
"unit": "hPa",
"value": 550
},
{
"unit": "GND",
"value": 0
}
]
},
{
"name": "VGRD",
"description": "V-Component of Wind",
"unit": "m/s",
"epochs": [
"2016-01-09T16:00:00.000Z",
"2016-01-04T18:00:00.000Z",
"2016-01-26T11:00:00.000Z",
"2016-01-31T09:00:00.000Z"
],
"levels": [
{
"unit": "hPa",
"value": 800
},
{
"unit": "hPa",
"value": 950
},
{
"unit": "hPa",
"value": 30
},
{
"unit": "hPa",
"value": 550
},
{
"unit": "GND",
"value": 0
}
]
}
]

Forecast values: at current time

GET https://wxt.navlost.eu/api/v1/f/{elements}/{locations}

or

GET https://wxt.navlost.eu/api/v1/f/{elements}/{locations}/@

Where {locations} is one or more geographical locations expressed as latitude, longitude in decimal degrees on the EPSG:4326 datum. Multiple locations are separated by a semicolon.

Examples

GET https://wxt.navlost.eu/api/v1/f/TMP/-1.28325,36.81724;-1.03664,37.07752

Get the current TMP (temperature) value in Nairobi and Thika, Kenya, at ground level.

GET https://wxt.navlost.eu/api/v1/f/TMP;UGRD;VGRD/-1.28325,36.81724;-1.03664,37.07752

As above, but also get surface wind data.

Response

Content-Type: application/json

An object having the following structure:

Root
└─latitude,longitude
└─timestamp
└─"GND"
└─element
└─value|error

Where:

Example response:

{
"-1.283250,36.817240": {
"2016-01-08T18:22:34.364Z": {
"GND": {
"TMP": 289.817,
"UGRD": -4.26,
"VGRD": -0.808
}
}
},
"-1.036640,37.077520": {
"2016-01-08T18:22:34.364Z": {
"GND": {
"TMP": 290.472,
"UGRD": -1.607,
"VGRD": -0.943
}
}
}
}

Forecast values: at a specific time

GET https://wxt.navlost.eu/api/v1/f/{elements}/{locations}/{epochs}

Where {epochs} is one or more UTC epochs, either in a valid ISO-8601 format or as a Unix timestamp, or as an epoch relative to current time (see below). Examples: 2016-05-24T08:00:00Z, 2016-05-24T08Z, 1464076800. Multiple epochs are separated by a semicolon.

Relative Epochs

Epochs can also be expressed relative to present time. This has the advantage that request URLs may be hard-coded in some cases.

These relative epochs start with the @ sign, which is optionally followed by an offset part and a modulo part, both expressed in integer seconds, which for the offset may be a negative number. Thus, the full format is @[offset][%modulo].

Offset

The offset is an integer number of seconds, it can be positive, negative, or zero. If present, it is written immediately following the @ sign. If absent, zero is assumed.

Modulo

The modulo is an integer number of seconds. If present, it must be strictly positive. It is written after the offset part, if any, otherwise immediately after the @ sign. It is always preceded by either a % sign or the literal expression mod. The latter has the advantage that it does not need to be URL-encoded. Examples below use both expressions.

The resulting epoch is then calculated as: (t + offset) mod modulo

This allows the user to represent a variety of relative points in time, such as:

Relative epoch Notation(s)
Now @
One hour from now @3600, @+3600
One and a half hours ago @-5400
Current time, truncated to seconds @%1, @mod1
Current time, truncated to minutes @%60, @mod60
Current hour @%3600, @mod3600
Current time, truncated to nearest even hour @%7200, @mod7200
Today @%86400, @mod86400
Tomorrow @86400%86400, @86400mod86400
Yesterday @-86400%86400, @-86400mod86400
One week and six hours from now, truncated to nearest hour which is divisible by three @626400%10800, @626400mod10800

Examples

GET https://wxt.navlost.eu/api/v1/f/TMP/-1.28325,36.81724;-1.03664,37.07752/2016-01-01

GET https://wxt.navlost.eu/api/v1/f/TMP/-1.28325,36.81724;-1.03664,37.07752/2016-01-01T00Z

GET https://wxt.navlost.eu/api/v1/f/TMP/-1.28325,36.81724;-1.03664,37.07752/2016-01-01T00:00:00Z

GET https://wxt.navlost.eu/api/v1/f/TMP/-1.28325,36.81724;-1.03664,37.07752/1451606400

All of the above refer to the same epoch, midnight UTC first of January, 2016.

GET https://wxt.navlost.eu/api/v1/f/TMP/-1.28325,36.81724;-1.03664,37.07752/@%2510800;@10800%2510800;@21600mod10800

Get the weather in three-hourly intervals, the most recent past and the two nearest in the future. Note the URL-escaped percent sign in the first two epochs.

Response

Content-Type: application/json

As in the previous example.

Example response:

{
"-1.283250,36.817240": {
"2016-01-08T18:00:00.000Z": {
"GND": {
"TMP": 290.274
}
},
"2016-01-08T21:00:00.000Z": {
"GND": {
"TMP": 287.112
}
},
"2016-01-09T00:00:00.000Z": {
"GND": {
"TMP": 285.865
}
}
},
"-1.036640,37.077520": {
"2016-01-08T18:00:00.000Z": {
"GND": {
"TMP": 291.394
}
},
"2016-01-08T21:00:00.000Z": {
"GND": {
"TMP": 287.456
}
},
"2016-01-09T00:00:00.000Z": {
"GND": {
"TMP": 287.657
}
}
}
}

Forecast values: other than ground level.

GET https://wxt.navlost.eu/api/v1/f/{elements}/{locations}/{epochs}/{levels}

Where {levels} is one or more vertical levels (altitudes), expressed as described earlier in this document, e.g., in aeronautical format (F100, A5000), or as a pressure level (hPa700), or as the expressions SFC, GND, frzl, etc. Some forecast elements may not relate to a particular altitude, and for those the altitude parameter may be omitted. For elements which do require an altitude, if omitted, it will be assumed to be ground level (equivalent to GND).

Note that you may request the current epoch, alone or in addition to other epochs, by using the @ shortcut.

Examples

GET https://wxt.navlost.eu/api/v1/f/TMP;UGRD;VGRD/-1.28325,36.81724;-1.03664,37.07752/2016-01-01T00Z;2016-01-01T01Z/GND;hPa500;A3000;M3000

Get the temperature and winds for Nairobi and Thika, at 00Z and 01Z on 2016-01-01, at:

GET https://wxt.navlost.eu/api/v1/f/UGRD;VGRD;HGT/-1.28325,36.81724;-1.03664,37.07752/@/mwl

Get the current height of the maximum wind level, and the wind speeds.

Response

Content-Type: application/json

As in the previous cases. The total number of values returned is num_elements × num_locations × num_epochs × num_levels.

{
"-1.283250,36.817240": {
"2016-01-09T00:00:00.000Z": {
"hPa500": {
"TMP": 267.272,
"UGRD": 0.181,
"VGRD": -1.818
},
"GND": {
"TMP": 285.865,
"UGRD": -2.676,
"VGRD": -1.63
},
"A3000": {
"TMP": 290.997,
"UGRD": -3.11,
"VGRD": -1.907
},
"M300": {
"TMP": 295.085,
"VGRD": -1.907,
"UGRD": -3.11
}
},
"2016-01-09T01:00:00.000Z": {
"hPa500": {
"TMP": 267.211,
"VGRD": -2.1,
"UGRD": 0.486
},
"GND": {
"TMP": 285.768,
"UGRD": -2.258,
"VGRD": -1.777
},
"A3000": {
"TMP": 290.955,
"UGRD": -2.634,
"VGRD": -2.091
},
"M300": {
"TMP": 295.022,
"UGRD": -2.634,
"VGRD": -2.091
}
}
},
"-1.036640,37.077520": {
"2016-01-09T00:00:00.000Z": {
"hPa500": {
"TMP": 267.533,
"UGRD": 0.41,
"VGRD": -2.623
},
"GND": {
"TMP": 287.657,
"UGRD": -0.796,
"VGRD": -1.018
},
"A3000": {
"TMP": 291.41,
"UGRD": -0.99,
"VGRD": -1.257
},
"M300": {
"TMP": 295.482,
"UGRD": -0.99,
"VGRD": -1.257
}
},
"2016-01-09T01:00:00.000Z": {
"hPa500": {
"UGRD": 0.212,
"VGRD": -2.771,
"TMP": 267.506
},
"GND": {
"TMP": 287.278,
"UGRD": -0.168,
"VGRD": -1.325
},
"A3000": {
"TMP": 291.17,
"UGRD": -0.214,
"VGRD": -1.702
},
"M300": {
"TMP": 295.238,
"UGRD": -0.214,
"VGRD": -1.702
}
}
}
}

METAR / TAF reports

GET https://wxt.navlost.eu/api/v1/r/{reports}/{icaoOrLoc}?options={options}

Retrieves recent METAR or TAF reports for specific locations.

Where {reports} is either:

Where {icaoOrLoc} is one or more valid ICAO identifiers or locations (formatted as latitude,longitude), with multiple identifiers or locations separated by a semicolon. ICAO identifiers and locations can be mixed freely.

Options

The {options} parameter controls a number of parameters concerning the search. Its general format is options={option1:value1},{option2:value2}…. Where the option is a boolean flag, its value may be omitted.

These are the valid options:

For the above parameters, values above their maxima are truncated, and negative values are treated as if they were positive.

The following may also be specified:

Examples

GET https://wxt.navlost.eu/api/v1/r/METAR;TAF/HKJK;-4,39?options=location

Get the three latest METAR and TAF reports for Nairobi airport and for whatever is closest to 039° E, 04° S (Mombasa, in this case). Include the location of those airports.

Response

Content-Type: application/json

The structure of the returned object depends on whether a search has been done by ICAO identifier or by coordinates.

By ICAO identifier only:

Parent object
└─"reports" (literal)
└─Report type ("METAR" or "TAF")
└─ICAO identifier
└─Epoch (ISO-8601 timestamp, Zulu time)
└─Value or error message

By coordinates:

Parent object
├─"search" (literal)
│ └─Location (in the form of “latitude,longitude”)
│ └─ICAO identifier
│ ├─"location" (literal, only if "options=location" has been used)
│ │ ├─"lat" (literal)
│ │ │ └─Latitude
│ │ └─"lon" (literal)
│ │ └─Longitude
│ └─"distance" (literal)
│ └─Distance (from reference point to station, in metres)
└─"reports" (literal)
└─Report type ("METAR" or "TAF")
└─ICAO identifier
└─Epoch (ISO-8601 timestamp, Zulu time)
└─Value or error message
{
"search": {
"-4.000000,39.000000": {
"HKMO": {
"location": {
"lat": -4.02,
"lon": 39.62
},
"distance": 68828
}
}
},
"reports": {
"METAR": {
"HKJK": {
"2016-01-08T00:30:00.000Z": "HKJK 080030Z 24006KT 9999 BKN019 13/12 Q1023 NOSIG",
"2016-01-08T00:00:00.000Z": "HKJK 080000Z 25004KT 9999 BKN019 13/12 Q1023 NOSIG",
"2016-01-07T23:30:00.000Z": "HKJK 072330Z 24005KT 9999 SCT019 13/12 Q1023 NOSIG"
},
"HKMO": {
"2016-01-08T02:00:00.000Z": "HKMO 080200Z 25003KT 9999 SCT018 22/21 Q1017 NOSIG",
"2016-01-08T00:00:00.000Z": "HKMO 080000Z 21005KT 9999 VCSH BKN020 22/21 Q1016 NOSIG",
"2016-01-07T23:00:00.000Z": "HKMO 072300Z 22005KT 9999 SCT020 22/20 Q1016 NOSIG"
}
},
"TAF": {
"HKJK": {
"2016-01-08T23:00:00.000Z": "TAF HKJK 082310Z 0900/1006 20005KT 9999 FEW009 SCT017 BECMG 0908/0911 12010KT BKN024 TEMPO 0912/0918 09010G15KT FEW028 BECMG 0920/0923 VRB05KT CAVOK TEMPO 1000/1006 24005KT FEW008 BKN017",
"2016-01-08T17:00:00.000Z": "TAF HKJK 081700Z 0818/0924 VRB05KT 9999 FEW023 TEMPO 0900/0906 20005KT FEW009 BKN017 BECMG 0908/0911 12005KT FEW024 TEMPO 0912/0918 09010G15KT SCT028 BECMG 0920/0923 VRB05KT CAVOK ",
"2016-01-08T11:00:00.000Z": "TAF HKJK 081100Z 0812/0918 09010KT 9999 SCT028 BECMG 0820/0823 VRB05KT CAVOK TEMPO 0900/0906 20005KT 9999 FEW009 BKN017 BECMG 0908/0911 12005KT SCT024 "
},
"HKMO": {
"2016-01-09T05:00:00.000Z": "TAF HKMO 090500Z 0906/1012 25004KT 9999 BKN018 BECMG 0909/0912 14010KT SCT023 BECMG 0918/0921 15005KT SCT019 TEMPO 1000/1006 -SHRA BKN018 BECMG 1009/1012 14010KT SCT022",
"2016-01-08T11:00:00.000Z": "TAF HKMO 081100Z 0812/0918 13010KT 9999 SCT022 BECMG 0818/0821 22004KT FEW022 TEMPO 0900/0906 -SHRA BKN018 BECMG 0909/0912 14010KT SCT023 BECMG 0915/0918 15010KT FEW022",
"2016-01-08T05:00:00.000Z": "TAF HKMO 080500Z 0806/0912 18010KT 9999 SCT020 BECMG 0809/0812 14010KT WSCT024 BECMG 0818/0821 18005KT SCT021 TEMPO 0900/0906 -SHRA FEW019 SCT080 BECMG 0909/0912 15010KT WSCT025"
}
}
}
}

NRPL expressions

Evaluate

GET https://wxt.navlost.eu/api/v1/nrpl/{expr}
POST https://wxt.navlost.eu/api/v1/nrpl/{expr}
POST https://wxt.navlost.eu/api/v1/nrpl

Processes an NRPL expression.

This endpoint accepts indistinctly GET or POST verbs. The expression to be processed consists of the concatentation of the contents of the {expr} part of the URL plus the request body (in case of POST requests). Either {expr} or the request body may be empty. If both are present, {expr} is evaluated first (which is handy for setting variables or pre-loading the stack).

Variables

There are two kinds of predefined global variables in the underlying NRPL service:

Type Read Write Description
Control variables Control certain query parameters, such as epoch and location
Information variables Retrieve data, such as weather element values, relative to the control variables

These are the currently recognised control variables and their functions:

Variable Purpose Example Default value
lat Set / retrieve the latitude 45.52 !lat 0
lon Set / retrieve the longitude 3.7 !lon 0
ele Set / retrieve the elevation "A2000" !ele "GND"
epoch Set / retrieve the epoch @2016-01-01T03:30Z@ !epoch Current epoch

The information variables match the name property of the elements available at the list of forecast items endpoint.

Return value

Content-Type: application/json

This endpoint returns an array with the contents of the NRPL stack after the expression has been evaluated.

Examples

This example retrieves the current temperature, in degrees Celsius, Oslo Gardermoen and Pemba (Mozambique) airports:

GET https://wxt.navlost.eu/api/v1/nrpl/60.202584!lat;11.084127!lon;$TMP;274.15-;-12.991575!lat;40.524191!lon;$TMP;274.15-

Possible response:

[-3.185148103171059,25.581541089734742]

Same example, but we also return the current timestamp:

GET https://wxt.navlost.eu/api/v1/nrpl/60.202584!lat;11.084127!lon;$TMP;274.15-;-12.991575!lat;40.524191!lon;$TMP;274.15-;$epoch

Possible response:

[-3.175974323564617,25.575446341123666,"2016-01-01T01:32:20.743Z"]

A more involved example, using a POST request:

# Let us create a file in the current directory
# This program takes pairs of coordinates from
# the stack and retrieves the current temperature,
# relative humidity, and wind at the given location.
# For each location, the data is put into an object.
# At the end, it puts all the resulting objects in
# the stack.
cat >tmp_rh_wind.nrpl << 'EOF'
NEWSET !!results § Create a new set to store the results
« DEPTH 2 GE » § Loop while at least two elements in stack
«
!lon § Set the longitude
!lat § Set the latitude
$TMP § Get temperature
273.15 - § Convert from Kelvin to degrees Celsius
"temp" § Tag for temperature value
OBJECT § Create an empty object
SET § Set the property "temp" to the TMP value
$RH § Get relative humidity
"rel_humidity" § Tag
ROT § Bring the object to the bottom of the stack
SET § Add the relative humidity
$UGRD $VGRD HYPOT § Get the wind vector (in m/s)
3.6 * 1.852 / § Convert to knots
"wind_speed" § Tag
ROT
SET
$lon "longitude" ROT SET § Add the longitude…
$lat "latitude" ROT SET § …and latitude…
$epoch "epoch" ROT SET § …and the epoch…
$ele "elevation" ROT SET § …and elevation to the object
$$results SUNION !!results § Add to results set
» WHILE
$$results SET→ DROP § Explode set
EOF

# Let us run the file above. We enter a couple of locations
# in the URL (Gardermoen and Pemba, as in another example).
curl -s -H "Content-Type: text/plain" -u user:passwd \
--data-binary @./tmp_rh_wind.nrpl \
"https://wxt.navlost.eu/api/v1/nrpl/60.202584;11.084127;-12.991575;40.524191"

Possible result:

[
{
"temp": -1.895226133333324,
"rel_humidity": 65.13758222222226,
"wind_speed": 3.028918625087354,
"longitude": 11.08,
"latitude": 60.2,
"epoch": "2016-01-01T03:08:56.680Z",
"elevation": "GND"
},
{
"temp": 3.4770222222222174,
"rel_humidity": 74.85111111111111,
"wind_speed": 1.3053894285283745,
"longitude": 3.5,
"latitude": 43.5,
"epoch": "2016-01-01T03:08:56.680Z",
"elevation": "GND"
}
]

Note that this example, like any other NRPL expression, may be run directly off the URL via a GET request, if the user is willing to put up with a certain amount of unwieldiness. The GET equivalent to the above (minus comments, for brevity) would be:

curl -u user:password 'https://wxt.navlost.eu/api/v1/nrpl/60.202584;11.084127;-12.991575;40.524191;NEWSET;!!results;%C2%ABDEPTH;2;GE%C2%BB%C2%AB!lon;!lat;$TMP;273.15-;%22temp%22;OBJECT;SET;$RH;%22rel_humidity%22;ROT;SET;$UGRD;$VGRD;HYPOT;3.6%C3%971.852%C3%B7;%22wind_speed%22;ROT;SET;$lon%22longitude%22ROT;SET;$lat%22latitude%22ROT;SET;$epoch%22epoch%22ROT;SET;$ele%22elevation%22ROT;SET;$$results;SUNION;!!results%C2%BBWHILE;$$results;SET%E2%86%92;DROP'