En

API usage

Introduction

The Frogcast API provides a simple, standard way to integrate your forecast data into your system. The API respects REST semantics, uses JSON to encode objects, and is based on the HTTPS standard.  

Authentification

Frogcast uses simple token-based authentication. Your API token has the same privileges as your user account, so be sure to keep it secret! You can authenticate with this token in the HTTP authorization token header.

All API requests must be authenticated and made via HTTPS.

Your personal token is

Here's a example of what should set in your header:

Authorization: token 

Forecasts

Retrieving forecasts with the API is very straight forward.
In this section, you'll get ready-to-go examples in Python, JS and CURL.

To retrieve your latest forecast, you must make a GET request to the following URL:

https://api.frogcast.com/api/v1/forecast/

There are different parameters to customize your query:
Required parameters:
latitude* numeric (double):
  • in degrees and decimal degrees (-90° to +90°) example : 45.369
longitude* numeric (double):
  •  in degrees and decimal degrees (-180° to +180°) example : 8.369
fields* (str): default is all fields you can specify the list of fields separated by a ',' for example: ghi_p20,ghi_p80

Optional parameters:
data_format (str) from the list below:
  • split (default): orginal format of the api
  • records: fully detailed record with name of field ans value for each time step
  • tight: tight version of the data that can be used for data vizualisation
precision (int):
  • default = 2
horizon (int):
  • default = 21600 ie 15 days
time_step (int):
  • default = 1
  • interval (in minutes) between each forecast series
date_time_format (str):
  • default is in ISO 8601 UTC format, like "2022-01-01T00:00:00Z"
  • you can also specify "time_stamp" to get unix time stamp
time_stamp_unit (str):
  • to be specified only if the unix time stamp format is requested
  • default is "s" for get unix time stamp in seconds, but you can specify "ms" to get your data in milliseconds

Here is an example in Python:

import requests

parameters = {'horizon':2880}

url = 'https://api.frogcast.com/api/v1/forecast/'

requests.get(url=url,params=parameters,headers=headers).json()

Here is an example in JS:

var myInit = { method: 'GET',
headers: myHeaders }; 

var myRequest = new Request(https://api.frogcast.com/api/v1/forecast/,myInit)

fetch(myRequest,myInit)

  .then(response => response.json())

Here is an example in CURL:

Weather fields

Category

Short name

Long name

dESCRIPTION

All weather variables are associated with percentiles (or quantiles) ranging from 10 to 100.
So you can fetch all the quantiles of any variable.

Example for temperature : t2m,t2m_p10,t2m_p20,t2m_p30,t2m_p40,t2m_p50,t2m_p60,t2m_p70,t2m_p80,t2m_p90

Try it !

URL

https://api.frogcast.com/api/v1/forecast/

Headers

Authorization token:

xxxx-xxxx-xxxx-xxxx

Reveal

Copy

Copied

QUERY PARAMETERS

latitude:

longitude:

fields:

data_format:

precision:

horizon:

time_step:

lAST Results

Copy

Copied

[]