API Access
This guide demonstrates how to access Jua's weather forecasts through our REST API.
Setting up Authentication
All API requests require authentication using the X-API-Key header in the format {API_KEY_ID}:{API_SECRET}. Here's how to set it up:
API_KEY_ID = os.environ["JUA_API_KEY_ID"]
API_SECRET = os.environ["JUA_API_SECRET"]
AUTH_HEADER = {"X-API-Key": f"{API_KEY_ID}:{API_SECRET}"}X-API-Key: your_api_key_id:your_api_secretThe examples below assume you have already set up the AUTH_HEADER as shown above.
Check forecast availability and timing
To check which forecast hours are currently available, use this API endpoint:
requests.get("https://api.jua.ai/v1/forecasting/ept1_5/forecasts/latest", headers=AUTH_HEADER).json()GET /v1/forecasting/{model_name}/forecasts/latest
X-API-Key: your_api_key_id:your_api_secretWhich will return the following fields:
forecast_url: A link to the specific forecast.model_id: The model that was used to generate the forecast.init_time: The initial conditions timestamp.available_forecasted_hours: The number of hours, after the init_time, that have been forecasted.available_variables: The available variables for this forecast.
Forecast Data
Single Point Request
Our REST API gives access to the forecast at a single point:
For more information about available models and endpoints, please see our Release Notes.
By default, this request will return all available variables and only the first 24 hours of the forecast. Here is an example of requesting a single variable for a longer time range:
Multiple Points Request
If you're interested in more than one location, use the POST endpoint to retrieve up to 25 locations in a single request:
Response Notes
The server returns the nearest available points to what have been requested. For example, if you request (48.857, 2.352), it will return the values at (48.829, 2.351). The
returned_latlonfield lists the actual returned locations.If you request more hours than what is currently available from the latest forecast (because the forecast is currently disseminating), then the response will contain all of the available data only.
The variables and units are documented in:
Real-World Example
Get 100m wind speed at 4 locations in Germany
If you have any further questions, please have a look at our FAQ or reach out to us at [email protected].
Last updated