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
Plannedpip install astraos — Official Python SDK with type hints and async support.
JavaScript / TypeScript
Plannednpm install @astraos/sdk — TypeScript SDK for Node.js and browser environments.
REST API
AvailableUse 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 requestsAPI_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 Franciscoresponse = 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;context39;][39;matched39;]} scenes")for scene in data["features"]: props = scene["properties"] print(f" {scene[&"color: #6b7280">#39;id39;]}") print(f" Date: {props[&"color: #6b7280">#39;datetime39;]}") print(f" Cloud: {props[&"color: #6b7280">#39;eo:cloud_cover39;]}%") print(f" Bands: {list(scene[&"color: #6b7280">#39;assets39;].keys())}") print()Get scene details and download bands
scene_detail.py
import requestsAPI_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 metadatascene = requests.get( f"{BASE}/scenes/{scene_id}", headers=headers,).json()print(f"Platform: {scene[&"color: #6b7280">#39;properties39;][39;platform39;]}")print(f"Cloud cover: {scene[&"color: #6b7280">#39;properties39;][39;eo:cloud_cover39;]}%")"color: #6b7280"># Resolve red and NIR band COG URLsassets = 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;href39;][:80]}...")Submit an NDVI processing job
ndvi_job.py
import requestsimport timeAPI_KEY = "astra_sk_live_your_key_here"BASE = "https://astraos.cloud/api/v1"headers = {"Authorization": f"Bearer {API_KEY}"}"color: #6b7280"># Submit NDVI jobjob = 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_id39;]} submitted (status: {job[39;status39;]})")"color: #6b7280"># Poll until completewhile job["status"] in ("queued", "processing"): time.sleep(3) job = requests.get( f"{BASE}/process/{job[&"color: #6b7280">#39;job_id39;]}", headers=headers, ).json() print(f" Status: {job[&"color: #6b7280">#39;status39;]}")if job["status"] == "completed": print(f"Result: {job[&"color: #6b7280">#39;result39;][39;href39;]}")else: print(f"Failed: {job.get(&"color: #6b7280">#39;error39;, 39;Unknown error39;)}")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 Franciscoconst 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 metadataconst 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 URLsconst 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 jobconst 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 completewhile (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"]}39;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 Status | Error Code | Description |
|---|---|---|
| 400 | VALIDATION_ERROR | Invalid or missing request parameters |
| 401 | UNAUTHORIZED | Missing or invalid API key |
| 403 | FORBIDDEN | Key does not have access to this resource |
| 404 | NOT_FOUND | Scene or job not found |
| 429 | RATE_LIMITED | Too many requests. Check Retry-After header. |