curl --request POST \
--url https://api.verdant-ai.com/api/v1/data/requests \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"variables": [
"air_temperature_max"
],
"region": {
"bbox": [
142.3,
-34.45,
142.4,
-34.35
],
"crs": "EPSG:4326"
},
"period": {
"start": "2003-01-01",
"end": "2003-01-01"
},
"temporal_resolution": "daily",
"spatial_resolution": "native",
"units": {
"air_temperature_max": "degC"
},
"data_class": "interpolated_observation",
"format": "json",
"missing_policy": "preserve",
"source_preference": "silo"
}
'import requests
url = "https://api.verdant-ai.com/api/v1/data/requests"
payload = {
"variables": ["air_temperature_max"],
"region": {
"bbox": [142.3, -34.45, 142.4, -34.35],
"crs": "EPSG:4326"
},
"period": {
"start": "2003-01-01",
"end": "2003-01-01"
},
"temporal_resolution": "daily",
"spatial_resolution": "native",
"units": { "air_temperature_max": "degC" },
"data_class": "interpolated_observation",
"format": "json",
"missing_policy": "preserve",
"source_preference": "silo"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
variables: ['air_temperature_max'],
region: {bbox: [142.3, -34.45, 142.4, -34.35], crs: 'EPSG:4326'},
period: {start: '2003-01-01', end: '2003-01-01'},
temporal_resolution: 'daily',
spatial_resolution: 'native',
units: {air_temperature_max: 'degC'},
data_class: 'interpolated_observation',
format: 'json',
missing_policy: 'preserve',
source_preference: 'silo'
})
};
fetch('https://api.verdant-ai.com/api/v1/data/requests', 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.verdant-ai.com/api/v1/data/requests",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'variables' => [
'air_temperature_max'
],
'region' => [
'bbox' => [
142.3,
-34.45,
142.4,
-34.35
],
'crs' => 'EPSG:4326'
],
'period' => [
'start' => '2003-01-01',
'end' => '2003-01-01'
],
'temporal_resolution' => 'daily',
'spatial_resolution' => 'native',
'units' => [
'air_temperature_max' => 'degC'
],
'data_class' => 'interpolated_observation',
'format' => 'json',
'missing_policy' => 'preserve',
'source_preference' => 'silo'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.verdant-ai.com/api/v1/data/requests"
payload := strings.NewReader("{\n \"variables\": [\n \"air_temperature_max\"\n ],\n \"region\": {\n \"bbox\": [\n 142.3,\n -34.45,\n 142.4,\n -34.35\n ],\n \"crs\": \"EPSG:4326\"\n },\n \"period\": {\n \"start\": \"2003-01-01\",\n \"end\": \"2003-01-01\"\n },\n \"temporal_resolution\": \"daily\",\n \"spatial_resolution\": \"native\",\n \"units\": {\n \"air_temperature_max\": \"degC\"\n },\n \"data_class\": \"interpolated_observation\",\n \"format\": \"json\",\n \"missing_policy\": \"preserve\",\n \"source_preference\": \"silo\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
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.verdant-ai.com/api/v1/data/requests")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"variables\": [\n \"air_temperature_max\"\n ],\n \"region\": {\n \"bbox\": [\n 142.3,\n -34.45,\n 142.4,\n -34.35\n ],\n \"crs\": \"EPSG:4326\"\n },\n \"period\": {\n \"start\": \"2003-01-01\",\n \"end\": \"2003-01-01\"\n },\n \"temporal_resolution\": \"daily\",\n \"spatial_resolution\": \"native\",\n \"units\": {\n \"air_temperature_max\": \"degC\"\n },\n \"data_class\": \"interpolated_observation\",\n \"format\": \"json\",\n \"missing_policy\": \"preserve\",\n \"source_preference\": \"silo\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.verdant-ai.com/api/v1/data/requests")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"variables\": [\n \"air_temperature_max\"\n ],\n \"region\": {\n \"bbox\": [\n 142.3,\n -34.45,\n 142.4,\n -34.35\n ],\n \"crs\": \"EPSG:4326\"\n },\n \"period\": {\n \"start\": \"2003-01-01\",\n \"end\": \"2003-01-01\"\n },\n \"temporal_resolution\": \"daily\",\n \"spatial_resolution\": \"native\",\n \"units\": {\n \"air_temperature_max\": \"degC\"\n },\n \"data_class\": \"interpolated_observation\",\n \"format\": \"json\",\n \"missing_policy\": \"preserve\",\n \"source_preference\": \"silo\"\n}"
response = http.request(request)
puts response.read_body{
"status": "ready",
"cache": "hit",
"datasetVersion": "<string>",
"rowCount": 123,
"links": {
"self": "<string>",
"query": "<string>",
"dataset": "<string>"
}
}{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "queued",
"coverageDigest": "<string>",
"target": {},
"datasetVersion": "<string>",
"error": {
"reason": "<string>"
},
"createdAt": "<string>",
"updatedAt": "<string>",
"links": {
"self": "<string>",
"query": "<string>",
"dataset": "<string>"
},
"cache": "miss",
"created": true,
"job": {
"status": "<string>",
"attempts": 0,
"maxAttempts": 0
},
"events": [
{
"event": "<string>",
"details": {},
"at": "<string>"
}
]
}{
"error": "<string>",
"message": "<string>",
"issues": [
{
"code": "<string>",
"path": [
"<string>"
],
"message": "<string>"
}
]
}{
"error": "<string>",
"message": "<string>",
"issues": [
{
"code": "<string>",
"path": [
"<string>"
],
"message": "<string>"
}
]
}{
"error": "<string>",
"message": "<string>",
"issues": [
{
"code": "<string>",
"path": [
"<string>"
],
"message": "<string>"
}
]
}{
"error": "<string>",
"message": "<string>",
"issues": [
{
"code": "<string>",
"path": [
"<string>"
],
"message": "<string>"
}
]
}{
"error": "<string>",
"message": "<string>",
"issues": [
{
"code": "<string>",
"path": [
"<string>"
],
"message": "<string>"
}
]
}{
"error": "<string>",
"message": "<string>",
"issues": [
{
"code": "<string>",
"path": [
"<string>"
],
"message": "<string>"
}
]
}Request data, acquiring a cache miss
Get data that may not be published yet. Published coverage returns ready (free). An identical acquisition already running returns its request (free). Otherwise the request is acquired from the source for a fixed MPP price: the first call returns a payment challenge, and the paid retry returns a request ID and receipt. Poll the request until ready, then query. Requests outside source coverage are rejected before any charge. Over HTTP the challenge is a 402 with WWW-Authenticate: Payment (Stripe shared payment token); retry with Authorization: Payment and keep the same credential for any retry. Then POST the same body to /api/v1/data/query once ready.
curl --request POST \
--url https://api.verdant-ai.com/api/v1/data/requests \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"variables": [
"air_temperature_max"
],
"region": {
"bbox": [
142.3,
-34.45,
142.4,
-34.35
],
"crs": "EPSG:4326"
},
"period": {
"start": "2003-01-01",
"end": "2003-01-01"
},
"temporal_resolution": "daily",
"spatial_resolution": "native",
"units": {
"air_temperature_max": "degC"
},
"data_class": "interpolated_observation",
"format": "json",
"missing_policy": "preserve",
"source_preference": "silo"
}
'import requests
url = "https://api.verdant-ai.com/api/v1/data/requests"
payload = {
"variables": ["air_temperature_max"],
"region": {
"bbox": [142.3, -34.45, 142.4, -34.35],
"crs": "EPSG:4326"
},
"period": {
"start": "2003-01-01",
"end": "2003-01-01"
},
"temporal_resolution": "daily",
"spatial_resolution": "native",
"units": { "air_temperature_max": "degC" },
"data_class": "interpolated_observation",
"format": "json",
"missing_policy": "preserve",
"source_preference": "silo"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
variables: ['air_temperature_max'],
region: {bbox: [142.3, -34.45, 142.4, -34.35], crs: 'EPSG:4326'},
period: {start: '2003-01-01', end: '2003-01-01'},
temporal_resolution: 'daily',
spatial_resolution: 'native',
units: {air_temperature_max: 'degC'},
data_class: 'interpolated_observation',
format: 'json',
missing_policy: 'preserve',
source_preference: 'silo'
})
};
fetch('https://api.verdant-ai.com/api/v1/data/requests', 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.verdant-ai.com/api/v1/data/requests",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'variables' => [
'air_temperature_max'
],
'region' => [
'bbox' => [
142.3,
-34.45,
142.4,
-34.35
],
'crs' => 'EPSG:4326'
],
'period' => [
'start' => '2003-01-01',
'end' => '2003-01-01'
],
'temporal_resolution' => 'daily',
'spatial_resolution' => 'native',
'units' => [
'air_temperature_max' => 'degC'
],
'data_class' => 'interpolated_observation',
'format' => 'json',
'missing_policy' => 'preserve',
'source_preference' => 'silo'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.verdant-ai.com/api/v1/data/requests"
payload := strings.NewReader("{\n \"variables\": [\n \"air_temperature_max\"\n ],\n \"region\": {\n \"bbox\": [\n 142.3,\n -34.45,\n 142.4,\n -34.35\n ],\n \"crs\": \"EPSG:4326\"\n },\n \"period\": {\n \"start\": \"2003-01-01\",\n \"end\": \"2003-01-01\"\n },\n \"temporal_resolution\": \"daily\",\n \"spatial_resolution\": \"native\",\n \"units\": {\n \"air_temperature_max\": \"degC\"\n },\n \"data_class\": \"interpolated_observation\",\n \"format\": \"json\",\n \"missing_policy\": \"preserve\",\n \"source_preference\": \"silo\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
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.verdant-ai.com/api/v1/data/requests")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"variables\": [\n \"air_temperature_max\"\n ],\n \"region\": {\n \"bbox\": [\n 142.3,\n -34.45,\n 142.4,\n -34.35\n ],\n \"crs\": \"EPSG:4326\"\n },\n \"period\": {\n \"start\": \"2003-01-01\",\n \"end\": \"2003-01-01\"\n },\n \"temporal_resolution\": \"daily\",\n \"spatial_resolution\": \"native\",\n \"units\": {\n \"air_temperature_max\": \"degC\"\n },\n \"data_class\": \"interpolated_observation\",\n \"format\": \"json\",\n \"missing_policy\": \"preserve\",\n \"source_preference\": \"silo\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.verdant-ai.com/api/v1/data/requests")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"variables\": [\n \"air_temperature_max\"\n ],\n \"region\": {\n \"bbox\": [\n 142.3,\n -34.45,\n 142.4,\n -34.35\n ],\n \"crs\": \"EPSG:4326\"\n },\n \"period\": {\n \"start\": \"2003-01-01\",\n \"end\": \"2003-01-01\"\n },\n \"temporal_resolution\": \"daily\",\n \"spatial_resolution\": \"native\",\n \"units\": {\n \"air_temperature_max\": \"degC\"\n },\n \"data_class\": \"interpolated_observation\",\n \"format\": \"json\",\n \"missing_policy\": \"preserve\",\n \"source_preference\": \"silo\"\n}"
response = http.request(request)
puts response.read_body{
"status": "ready",
"cache": "hit",
"datasetVersion": "<string>",
"rowCount": 123,
"links": {
"self": "<string>",
"query": "<string>",
"dataset": "<string>"
}
}{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "queued",
"coverageDigest": "<string>",
"target": {},
"datasetVersion": "<string>",
"error": {
"reason": "<string>"
},
"createdAt": "<string>",
"updatedAt": "<string>",
"links": {
"self": "<string>",
"query": "<string>",
"dataset": "<string>"
},
"cache": "miss",
"created": true,
"job": {
"status": "<string>",
"attempts": 0,
"maxAttempts": 0
},
"events": [
{
"event": "<string>",
"details": {},
"at": "<string>"
}
]
}{
"error": "<string>",
"message": "<string>",
"issues": [
{
"code": "<string>",
"path": [
"<string>"
],
"message": "<string>"
}
]
}{
"error": "<string>",
"message": "<string>",
"issues": [
{
"code": "<string>",
"path": [
"<string>"
],
"message": "<string>"
}
]
}{
"error": "<string>",
"message": "<string>",
"issues": [
{
"code": "<string>",
"path": [
"<string>"
],
"message": "<string>"
}
]
}{
"error": "<string>",
"message": "<string>",
"issues": [
{
"code": "<string>",
"path": [
"<string>"
],
"message": "<string>"
}
]
}{
"error": "<string>",
"message": "<string>",
"issues": [
{
"code": "<string>",
"path": [
"<string>"
],
"message": "<string>"
}
]
}{
"error": "<string>",
"message": "<string>",
"issues": [
{
"code": "<string>",
"path": [
"<string>"
],
"message": "<string>"
}
]
}Body
The same request body as /api/v1/data/query. Format does not change what is acquired.
Data meaning is independent of representation and delivery. JSON (default) and CSV are returned inline. Bbox order: west,south,east,north; no antimeridian crossing. Date bounds inclusive; at most 31 days and 10,000 cells; actual coverage must pass resolve. dataset_version pins reproducibility.
Response
Cache hit: published coverage already satisfies the request (free).