Skip to main content
Guides

Weather Minutecast

Estimated reading time: 20 minutes

In this guide you will learn how to get the minutecast weather forecast at a desired location.

Setup

First, get an API key token, see the Getting Started guide.

Weather Minutecast entry point

URL: https://weather.magiclaneapis.com/v1/MinuteCast

EXAMPLE

These are complete working examples in several different languages, showing how to use the weather REST API. You can try them right now.

Linux terminal / Windows command prompt:

curl "https://weather.magiclaneapis.com/v1/MinuteCast" -X POST -H "Content-Type: application/json" -H "Authorization: YOUR_API_KEY_TOKEN" -d @payload.json

Linux note - do not use @~/payload.json instead of @/home/user/payload.json because ~ does not resolve due to the @ ; use only relative path @payload.json or absolute path @/home/user/payload.json

where

payload.json is a text file containing the following:

complete payload.json file - coords , one or more semicolon ; separated latitude,longitude coordinate pairs - the weather will be returned for each one separately;

{
"coords": "43.0, 2.0; 42.6, 2.5; 42.3, 3.111"
}

In a linux terminal you can also send the request directly from the command line, without a file, like this: (this method does not work on windows)

curl "https://weather.magiclaneapis.com/v1/MinuteCast" -X POST -H "Content-Type: application/json" -H "Authorization: YOUR_API_KEY_TOKEN" -d \
'{
...
}'

The only difference is the added backslash after -d, and then the filename @/home/user/payload.json is replaced with the contents of the json file, starting with the next line - note that a single quote ‘ is added before the leading curly brace { and after the trailing curly brace } to enclose the file contents in single quotes - no backslashes are needed between the single quotes.

REQUEST PARAMETER DEFINITIONS

Request body schema: application/json

keyvalue
coords
(mandatory
parameter)
A list of ; (semicolon) separated latitude,longitude coordinate pairs - the weather will be returned for each separately. Example: “43,2; 42.6,2.5; 42.3,3.1”
Type: string

RESPONSE

MinuteCast results

Each result item is given in a JSON block as shown below.

In the above examples, 3 coordinate pairs were requested, so the result shows the weather for each of the 3 locations specified. The coordinates are latitude, longitude (degrees). The date timestamp field is the UNIX time in seconds since 1 January 1970 at 00:00. Sunrise and Sunset times are also in UNIX time, as is the (most recent) UpdateTime .

{
"PrecipitationNow": "Currently raining",
"PrecipitationStart": 10,
"PrecipitationStop": 30,
"PrecipitationBreakIn": 14,
"PrecipitationBreakLastsFor": 5,
"Intensity": 2,
"Message": "No data in foreseeable future!"
}