ASTRA OS
FeaturesUse CasesPricingDocsBlog

Documentation

Getting StartedAuthenticationUnified SearchScene DetailsAsset ResolverProcessingData SourcesSDKs
Getting StartedAuthenticationUnified SearchScene DetailsAsset ResolverProcessingData SourcesSDKs
Processing

Processing API

Run server-side analytics on satellite imagery. Submit processing jobs for NDVI computation, change detection, and more. Jobs run asynchronously and results are delivered as COG files with a download URL.

Async Job Architecture

Processing jobs follow a submit-then-poll pattern. You submit a job definition, receive a job ID, and poll for status until the job completes.

1
Submit -- POST /api/v1/process with the operation type, scene IDs, and parameters. Returns a job_id immediately.
2
Poll -- GET /api/v1/process/{jobId} to check job status. Status progresses: queuedprocessingcompleted
3
Download -- When status is completed, the response includes a result object with a pre-signed download URL for the output file.

Submit a Job

POST/api/v1/process

Requires authentication. Send a JSON body with the operation type and input scenes.

Request Body

FieldTypeRequiredDescription
operationstringRequiredThe processing operation. One of: ndvi, change_detection
scene_idsstring[]RequiredArray of scene IDs to process. NDVI requires 1 scene; change detection requires exactly 2 (before and after).
paramsobjectOptionalOperation-specific parameters. See individual operation docs below.
webhook_urlstringOptionalURL to receive a POST callback when the job completes. The callback body includes the full job status response.

Operations

ndvi

Normalized Difference Vegetation Index

Computes NDVI from the red and NIR bands of a single scene. Output is a single-band COG with values ranging from -1.0 to 1.0. Bands are automatically resolved from the scene metadata.

ndvi_request.json
{
"operation": "ndvi",
"scene_ids": ["sentinel-2:S2B_MSIL2A_20250115T184929"],
"params": {
"colormap": "rdylgn"
}
}
ParamDefaultDescription
colormapnoneOptional colormap to apply. Options: rdylgn, viridis, greens. If omitted, output is raw float values.
change_detection

Change Detection

Compares two scenes of the same area at different times to detect changes. Requires exactly 2 scene IDs (before and after). Output is a classified change map with categories: no change, vegetation gain, vegetation loss, built-up gain, water change.

change_detection_request.json
{
"operation": "change_detection",
"scene_ids": [
"sentinel-2:S2B_MSIL2A_20240715T184929",
"sentinel-2:S2B_MSIL2A_20250115T184929"
],
"params": {
"threshold": 0.15,
"bands": ["red", "nir", "swir16"]
}
}
ParamDefaultDescription
threshold0.1Minimum spectral difference to classify as a change (0.0 - 1.0). Lower values detect more subtle changes.
bands["red","nir"]Bands to use for the comparison. More bands improve classification accuracy but increase processing time.

Complete Example: NDVI

Submit an NDVI job, poll for completion, and download the result.

cURL

terminal
"color: #6b7280"># Step 1: Submit the job
curl -X POST "https://astraos.cloud/api/v1/process" \
-H "Authorization: Bearer astra_sk_live_your_key_here" \
-H "Content-Type: application/json" \
-d &"color: #6b7280">#39;{
"operation": "ndvi",
"scene_ids": ["sentinel-2:S2B_MSIL2A_20250115T184929"],
"params": { "colormap": "rdylgn" }
}&"color: #6b7280">#39;
"color: #6b7280"># Response: { "job_id": "job_abc123", "status": "queued", ... }
"color: #6b7280"># Step 2: Poll for status
curl "https://astraos.cloud/api/v1/process/job_abc123" \
-H "Authorization: Bearer astra_sk_live_your_key_here"
"color: #6b7280"># Response when complete:
"color: #6b7280"># { "job_id": "job_abc123", "status": "completed", "result": { "href": "https://..." } }

Python

ndvi_example.py
import requests
import time
API_KEY = "astra_sk_live_your_key_here"
BASE = "https://astraos.cloud/api/v1"
headers = {"Authorization": f"Bearer {API_KEY}"}
"color: #6b7280"># Step 1: Submit the job
job = requests.post(
f"{BASE}/process",
headers={**headers, "Content-Type": "application/json"},
json={
"operation": "ndvi",
"scene_ids": ["sentinel-2:S2B_MSIL2A_20250115T184929"],
"params": {"colormap": "rdylgn"},
},
).json()
print(f"Job submitted: {job[&"color: #6b7280">#39;job_id']} (status: {job['status']})")
"color: #6b7280"># Step 2: Poll until complete
while job["status"] in ("queued", "processing"):
time.sleep(3)
job = requests.get(
f"{BASE}/process/{job[&"color: #6b7280">#39;job_id']}",
headers=headers,
).json()
print(f" Status: {job[&"color: #6b7280">#39;status']}")
"color: #6b7280"># Step 3: Download result
if job["status"] == "completed":
url = job["result"]["href"]
print(f"Downloading NDVI result from: {url}")
import urllib.request
urllib.request.urlretrieve(url, "ndvi_output.tif")
print("Saved to ndvi_output.tif")
else:
print(f"Job failed: {job.get(&"color: #6b7280">#39;error', {}).get('message', 'Unknown error')}")

JavaScript

ndvi_example.js
const API_KEY = "astra_sk_live_your_key_here";
const BASE = "https://astraos.cloud/api/v1";
const headers = { Authorization: `Bearer ${API_KEY}` };
"color: #6b7280">// Step 1: Submit the job
const submitRes = await fetch(`${BASE}/process`, {
method: "POST",
headers: { ...headers, "Content-Type": "application/json" },
body: JSON.stringify({
operation: "ndvi",
scene_ids: ["sentinel-2:S2B_MSIL2A_20250115T184929"],
params: { colormap: "rdylgn" },
}),
});
let job = await submitRes.json();
console.log(`Job submitted: ${job.job_id} (status: ${job.status})`);
"color: #6b7280">// Step 2: Poll until complete
while (job.status === "queued" || job.status === "processing") {
await new Promise((r) => setTimeout(r, 3000));
const pollRes = await fetch(`${BASE}/process/${job.job_id}`, { headers });
job = await pollRes.json();
console.log(` Status: ${job.status}`);
}
"color: #6b7280">// Step 3: Use the result
if (job.status === "completed") {
console.log(`Result URL: ${job.result.href}`);
} else {
console.error(`Job failed: ${job.error?.message}`);
}

Poll Job Status

GET/api/v1/process/{jobId}

Returns the current status and metadata for a processing job.

job_status_response.json
1{
2 "job_id": "job_abc123",
3 "status": "completed",
4 "operation": "ndvi",
5 "scene_ids": ["sentinel-2:S2B_MSIL2A_20250115T184929"],
6 "created_at": "2025-01-15T19:00:00Z",
7 "completed_at": "2025-01-15T19:00:12Z",
8 "duration_ms": 12340,
9 "result": {
10 "href": "https://storage.astraos.cloud/jobs/job_abc123/ndvi_output.tif?sig=...",
11 "type": "image/tiff; application=geotiff; profile=cloud-optimized",
12 "file:size": 8388608,
13 "expires_at": "2025-01-16T19:00:00Z"
14 }
15}

Job Statuses

StatusDescription
queuedJob is in the queue waiting to be picked up by a worker.
processingJob is currently being executed. Input data has been fetched and computation is running.
completedJob finished successfully. The result field contains the output download URL.
failedJob encountered an error. The error field contains a code and message describing the failure.
← Asset ResolverData Sources →
ASTRA OS

The Operating System for Earth Observation Data.

Product

  • Features
  • Pricing
  • Use Cases
  • Changelog

Developers

  • Documentation
  • API Reference
  • SDKs
  • Status

Company

  • About
  • Blog
  • Careers
  • Contact

Legal

  • Privacy
  • Terms
  • Security

© 2026 ASTRA OS. All rights reserved.