SDK Quickstart
Submit a detection job, wait for it, and save the GeoJSON result with the Python or JavaScript SDK.
This guide runs a full detection end-to-end — submit, poll, and save the result — with the official SDKs. It takes about five minutes.
Get your free API keyYou get 500 free API credits every month during the beta. No credit card required.Prerequisites
- A SateAIs API Console account
- An API key (
sk_live_...) — see Authentication - Python ≥ 3.10, or Node.js ≥ 18
1. Install
pip install sateaisnpm install @sateais/sdk2. Set your API key
Both SDKs read the SATEAIS_API_KEY environment variable automatically, so you don't have to pass the key in code:
export SATEAIS_API_KEY=sk_live_xxxxxTip
You can also pass the key explicitly: Client(api_key="sk_live_xxxxx") in Python or new Client({ apiKey: "sk_live_xxxxx" }) in JavaScript. Keep keys out of source control.
3. Submit, wait, and save
Submit an oil slick detection by scene ID, poll until it completes, and write the GeoJSON to a file. Scene IDs come from ASF Search — filter File Type = GRD.
import json
from sateais import Client
client = Client()
# Submit the job
job = client.analyze.oilslick(scene_id="S1A_IW_GRDH_...")
print("submitted:", job.job_id)
# Poll until completion (prints status on each poll), then fetch the GeoJSON
result = client.jobs.wait(job.job_id, poll_interval=30, on_poll=lambda j: print(j.status))
# Save the result
with open("result.geojson", "w") as f:
json.dump(result, f)
print(len(result["features"]), "detections saved to result.geojson")import { writeFile } from "node:fs/promises";
import { Client } from "@sateais/sdk";
const client = new Client();
// Submit the job
const job = await client.analyze.oilslick({ scene_id: "S1A_IW_GRDH_..." });
console.log("submitted:", job.job_id);
// Poll until completion (logs status on each poll), then fetch the GeoJSON
const result = await client.jobs.wait(job.job_id, {
intervalMs: 30_000,
onPoll: (j) => console.log(j.status),
});
// Save the result
await writeFile("result.geojson", JSON.stringify(result));
console.log(result.features.length, "detections saved to result.geojson");The result is a standard GeoJSON FeatureCollection in EPSG:4326. View it on the map in the SateAIs API Console, or open the file in any GIS tool.
Detection jobs typically take 30–60 minutes. jobs.wait() blocks until the job reaches a terminal state — see How it works for runtime estimates and polling guidance.
Submitting other detections
analyze.ship and analyze.oilslick accept either a scene_id or a polygon + date. The polygon-period detections (newbuilding, disappearbuilding, timeseries) take a polygon and a date_start / date_end:
job = client.analyze.timeseries(
polygon="POLYGON((139.7 35.6, 139.8 35.6, 139.8 35.7, 139.7 35.7, 139.7 35.6))",
date_start="2026-01-01",
date_end="2026-05-01",
)const job = await client.analyze.timeseries({
polygon: "POLYGON((139.7 35.6, 139.8 35.6, 139.8 35.7, 139.7 35.7, 139.7 35.6))",
date_start: "2026-01-01",
date_end: "2026-05-01",
});See the full method list in the Python and JavaScript references.