Weather
Parse a raw weather file upload
This endpoint accepts a .csv or .xlsx (note: .xlsx is only accepted in the PlantPredict exported format).
If the parse request is successful, a response will be returned containing some of the meta-data for the weather file including the GUID (weatherFileKey) that will be used in the next steps to begin formatting the data.
EndFragment
POST
/
Weather
/
Parse
Parse a raw weather file upload
curl --request POST \
--url https://api.plantpredict.terabase.energy/Weather/Parse \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form file='@example-file'import requests
url = "https://api.plantpredict.terabase.energy/Weather/Parse"
files = { "file": ("example-file", open("example-file", "rb")) }
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('file', '<string>');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://api.plantpredict.terabase.energy/Weather/Parse', 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.plantpredict.terabase.energy/Weather/Parse",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: multipart/form-data"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.plantpredict.terabase.energy/Weather/Parse"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.plantpredict.terabase.energy/Weather/Parse")
.header("Authorization", "Bearer <token>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.plantpredict.terabase.energy/Weather/Parse")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"weatherFileInfo": {
"error": false,
"errorDescription": null,
"warningMessage": null,
"source": "Meteonorm - 40.193N - 99.715W.xlsx",
"latitude": 40.1932678,
"longitude": -99.7152252,
"elevation": 665,
"timeZone": -6,
"region": "North America",
"pLevel": 0,
"windSensorHeight": 10,
"dataProvider": 4,
"dataType": 1,
"format": 3,
"weatherDataModelVersion": "8.1.2.15989",
"customerName": "",
"stationName": "",
"stationCode": null,
"separatorType": ",",
"customSeparater": null,
"headerRowsToSkip": 3,
"startDate": "2005-01-01T00:00:00",
"endDate": "2005-12-31T23:00:00",
"timeInterval": 60,
"timestampDefinition": 2,
"columnMappings": {
"ghi": 2,
"dni": 3,
"dhi": 4,
"temp": 5,
"windspeed": 6,
"relativeHumidity": 7,
"pwat": 8,
"rain": 9,
"pressure": 10,
"dewpointTemp": 11,
"windDirection": 12,
"soilingLoss": 13,
"poai": 14
},
"fileLimitReached": false,
"rowCount": 8763,
"weatherFileKey": "8f83cecb-4080-4b84-9c52-3f99e457ef5e",
"locality": "Oxford",
"stateProvince": "Nebraska",
"stateProvinceCode": "NE",
"country": "United States",
"countryCode": "US",
"offsetMinutes": 0,
"includesLeapDays": false,
"moduleTilt": null,
"moduleAzimuth": null,
"trackingType": null,
"trackingBacktrackingType": 0,
"minimumTrackingLimitAngleD": null,
"maximumTrackingLimitAngleD": null,
"trackerPitchAngleD": null,
"trackerStowAngle": null,
"groundCoverageRatio": null
}
}{
"message": "The request is invalid.",
"modelState": {
"latitude": [
"The field Latitude must be between -90 and 90."
]
}
}"An error has occurred."⌘I
Parse a raw weather file upload
curl --request POST \
--url https://api.plantpredict.terabase.energy/Weather/Parse \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form file='@example-file'import requests
url = "https://api.plantpredict.terabase.energy/Weather/Parse"
files = { "file": ("example-file", open("example-file", "rb")) }
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('file', '<string>');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://api.plantpredict.terabase.energy/Weather/Parse', 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.plantpredict.terabase.energy/Weather/Parse",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: multipart/form-data"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.plantpredict.terabase.energy/Weather/Parse"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.plantpredict.terabase.energy/Weather/Parse")
.header("Authorization", "Bearer <token>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.plantpredict.terabase.energy/Weather/Parse")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"weatherFileInfo": {
"error": false,
"errorDescription": null,
"warningMessage": null,
"source": "Meteonorm - 40.193N - 99.715W.xlsx",
"latitude": 40.1932678,
"longitude": -99.7152252,
"elevation": 665,
"timeZone": -6,
"region": "North America",
"pLevel": 0,
"windSensorHeight": 10,
"dataProvider": 4,
"dataType": 1,
"format": 3,
"weatherDataModelVersion": "8.1.2.15989",
"customerName": "",
"stationName": "",
"stationCode": null,
"separatorType": ",",
"customSeparater": null,
"headerRowsToSkip": 3,
"startDate": "2005-01-01T00:00:00",
"endDate": "2005-12-31T23:00:00",
"timeInterval": 60,
"timestampDefinition": 2,
"columnMappings": {
"ghi": 2,
"dni": 3,
"dhi": 4,
"temp": 5,
"windspeed": 6,
"relativeHumidity": 7,
"pwat": 8,
"rain": 9,
"pressure": 10,
"dewpointTemp": 11,
"windDirection": 12,
"soilingLoss": 13,
"poai": 14
},
"fileLimitReached": false,
"rowCount": 8763,
"weatherFileKey": "8f83cecb-4080-4b84-9c52-3f99e457ef5e",
"locality": "Oxford",
"stateProvince": "Nebraska",
"stateProvinceCode": "NE",
"country": "United States",
"countryCode": "US",
"offsetMinutes": 0,
"includesLeapDays": false,
"moduleTilt": null,
"moduleAzimuth": null,
"trackingType": null,
"trackingBacktrackingType": 0,
"minimumTrackingLimitAngleD": null,
"maximumTrackingLimitAngleD": null,
"trackerPitchAngleD": null,
"trackerStowAngle": null,
"groundCoverageRatio": null
}
}{
"message": "The request is invalid.",
"modelState": {
"latitude": [
"The field Latitude must be between -90 and 90."
]
}
}"An error has occurred."