Create Weather Data
curl --request POST \
--url https://api.example.com/weatherdataimport requests
url = "https://api.example.com/weatherdata"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/weatherdata', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/weatherdata",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/weatherdata"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/weatherdata")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/weatherdata")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyWeather Data
Create Weather Data
Create a weather data record from provided arrays
POST
/
weatherdata
Create Weather Data
curl --request POST \
--url https://api.example.com/weatherdataimport requests
url = "https://api.example.com/weatherdata"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/weatherdata', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/weatherdata",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/weatherdata"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/weatherdata")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/weatherdata")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyPOST /weatherdata
Create a weather data record by supplying hourly (or sub-hourly) weather arrays directly. This is the manual creation path — usePOST /weatherdata/fetch instead if you want the server to retrieve data from an external source like NSRDB or PVGIS.
Notes
- Requires a valid JWT with write access.
- At minimum, provide the four required irradiance and meteorological arrays:
ghi,dhi,windSpeed, andtemperature. Optional arrays includedni,relativeHumidity,poa, anddate(Unix timestamps in milliseconds). - All provided arrays must have the same length. Standard hourly datasets have 8,760 timesteps; sub-hourly datasets are also supported and auto-detected.
- Optionally link to an existing location by providing
locationId(workspace-scoped) orglobalLocationId(Snowflake ID). Returns 404 if the referenced location does not exist. weatherDataSourcedefaults to"provided"when supplying arrays directly.soilingaccepts monthly soiling factors (Jan—Dec, values 0—1) as a keyed object.- See
POST /weatherdata/fetchto create weather data from an external source instead. - See
GET /weatherdata/{weather_data_id}to retrieve the created record with full arrays.
