ASTRA OS
FeaturesUse CasesPricingDocsBlog

Documentation

Getting StartedAuthenticationUnified SearchScene DetailsAsset ResolverProcessingData SourcesSDKs
Getting StartedAuthenticationUnified SearchScene DetailsAsset ResolverProcessingData SourcesSDKs
SDKs & Libraries

SDKs & Code Examples

Integrate ASTRA OS into your application using any HTTP client. Below are complete examples in Python, JavaScript/TypeScript, and cURL for every major API operation. Official SDKs are on the roadmap.

SDK Availability

Python

Planned

pip install astraos — Official Python SDK with type hints and async support.

JavaScript / TypeScript

Planned

npm install @astraos/sdk — TypeScript SDK for Node.js and browser environments.

REST API

Available

Use any HTTP client with the examples below. The REST API is the primary interface for all integrations.

Python Examples

Search for satellite scenes

search_scenes.py
import requests
API_KEY = "astra_sk_live_your_key_here"
BASE = "https://astraos.cloud/api/v1"
headers = {"Authorization": f"Bearer {API_KEY}"}
"color: #6b7280"># Search for Sentinel-2 scenes over San Francisco
response = requests.get(
f"{BASE}/search",
headers=headers,
params={
"bbox": "-122.5,37.5,-122.0,38.0",
"datetime": "2025-01-01/2025-02-01",
"collections": "sentinel-2-l2a",
"cloud_cover_lt": 20,
"limit": 5,
},
)
data = response.json()
print(f"Found {data[&"color: #6b7280">#39;context']['matched']} scenes")
for scene in data["features"]:
props = scene["properties"]
print(f" {scene[&"color: #6b7280">#39;id']}")
print(f" Date: {props[&"color: #6b7280">#39;datetime']}")
print(f" Cloud: {props[&"color: #6b7280">#39;eo:cloud_cover']}%")
print(f" Bands: {list(scene[&"color: #6b7280">#39;assets'].keys())}")
print()

Get scene details and download bands

scene_detail.py
import requests
API_KEY = "astra_sk_live_your_key_here"
BASE = "https://astraos.cloud/api/v1"
headers = {"Authorization": f"Bearer {API_KEY}"}
scene_id = "sentinel-2:S2B_MSIL2A_20250115T184929"
"color: #6b7280"># Get full scene metadata
scene = requests.get(
f"{BASE}/scenes/{scene_id}",
headers=headers,
).json()
print(f"Platform: {scene[&"color: #6b7280">#39;properties']['platform']}")
print(f"Cloud cover: {scene[&"color: #6b7280">#39;properties']['eo:cloud_cover']}%")
"color: #6b7280"># Resolve red and NIR band COG URLs
assets = requests.get(
f"{BASE}/assets",
headers=headers,
params={
"scene_id": scene_id,
"bands": "red,nir",
"format": "cog",
},
).json()
for band_name, asset in assets["assets"].items():
print(f"{band_name}: {asset[&"color: #6b7280">#39;href'][:80]}...")

Submit an NDVI processing job

ndvi_job.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"># Submit NDVI 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 {job[&"color: #6b7280">#39;job_id']} submitted (status: {job['status']})")
"color: #6b7280"># 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']}")
if job["status"] == "completed":
print(f"Result: {job[&"color: #6b7280">#39;result']['href']}")
else:
print(f"Failed: {job.get(&"color: #6b7280">#39;error', 'Unknown error')}")

JavaScript / TypeScript Examples

Search for satellite scenes

search_scenes.ts
const API_KEY = "astra_sk_live_your_key_here";
const BASE = "https://astraos.cloud/api/v1";
const headers = { Authorization: `Bearer ${API_KEY}` };
"color: #6b7280">// Search for Sentinel-2 scenes over San Francisco
const params = new URLSearchParams({
bbox: "-122.5,37.5,-122.0,38.0",
datetime: "2025-01-01/2025-02-01",
collections: "sentinel-2-l2a",
cloud_cover_lt: "20",
limit: "5",
});
const res = await fetch(`${BASE}/search?${params}`, { headers });
const data = await res.json();
console.log(`Found ${data.context.matched} scenes`);
data.features.forEach((scene) => {
console.log(` ${scene.id}`);
console.log(` Date: ${scene.properties.datetime}`);
console.log(` Cloud: ${scene.properties["eo:cloud_cover"]}%`);
console.log(` Bands: ${Object.keys(scene.assets).join(", ")}`);
});

Get scene details and resolve assets

scene_detail.ts
const API_KEY = "astra_sk_live_your_key_here";
const BASE = "https://astraos.cloud/api/v1";
const headers = { Authorization: `Bearer ${API_KEY}` };
const sceneId = "sentinel-2:S2B_MSIL2A_20250115T184929";
"color: #6b7280">// Get full scene metadata
const sceneRes = await fetch(`${BASE}/scenes/${sceneId}`, { headers });
const scene = await sceneRes.json();
console.log("Platform:", scene.properties.platform);
console.log("Cloud cover:", scene.properties["eo:cloud_cover"] + "%");
"color: #6b7280">// Resolve red and NIR band COG URLs
const assetParams = new URLSearchParams({
scene_id: sceneId,
bands: "red,nir",
format: "cog",
});
const assetRes = await fetch(`${BASE}/assets?${assetParams}`, { headers });
const assets = await assetRes.json();
Object.entries(assets.assets).forEach(([band, asset]) => {
console.log(`${band}: ${asset.href}`);
});

Submit an NDVI processing job

ndvi_job.ts
const API_KEY = "astra_sk_live_your_key_here";
const BASE = "https://astraos.cloud/api/v1";
const headers = { Authorization: `Bearer ${API_KEY}` };
"color: #6b7280">// Submit NDVI 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 ${job.job_id} submitted (status: ${job.status})`);
"color: #6b7280">// 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}`);
}
if (job.status === "completed") {
console.log(`Result: ${job.result.href}`);
} else {
console.error(`Failed: ${job.error?.message}`);
}

cURL Quick Reference

Copy-paste these commands into your terminal. Replace the API key with your own from the dashboard.

Search

terminal
curl "https:"color: #6b7280">//astraos.cloud/api/v1/search?bbox=-122.5,37.5,-122.0,38.0&datetime=2025-01-01/2025-02-01&limit=5" \
-H "Authorization: Bearer astra_sk_live_your_key_here"

Scene Details

terminal
curl "https://astraos.cloud/api/v1/scenes/sentinel-2:S2B_MSIL2A_20250115T184929" \
-H "Authorization: Bearer astra_sk_live_your_key_here"

Resolve Assets

terminal
curl "https:"color: #6b7280">//astraos.cloud/api/v1/assets?scene_id=sentinel-2:S2B_MSIL2A_20250115T184929&bands=red,nir&format=cog" \
-H "Authorization: Bearer astra_sk_live_your_key_here"

Submit Processing Job

terminal
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"]}'

Poll Job Status

terminal
curl "https://astraos.cloud/api/v1/process/job_abc123" \
-H "Authorization: Bearer astra_sk_live_your_key_here"

Error Handling

All API errors return a consistent JSON structure. Check the HTTP status code and the error.code field to handle specific error types programmatically.

error_response.json
{
"error": {
"code": "VALIDATION_ERROR",
"message": "bbox parameter is required. Expected format: west,south,east,north",
"details": {
"parameter": "bbox",
"received": null
}
}
}
HTTP StatusError CodeDescription
400VALIDATION_ERRORInvalid or missing request parameters
401UNAUTHORIZEDMissing or invalid API key
403FORBIDDENKey does not have access to this resource
404NOT_FOUNDScene or job not found
429RATE_LIMITEDToo many requests. Check Retry-After header.
← Data SourcesBack to Getting Started →
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.