{"openapi":"3.1.0","info":{"title":"Earth to Date API","description":"Satellite imagery API with clean subprocess architecture.\n\n## View names (the `view` path parameter)\n\nShared across every endpoint that takes `view` (`/v2/download_aoi`, `/download_shapefile`, tile endpoints, …).\n\n## ⚠️ Coordinate order — latitude first\n\n`/v2/download_aoi/{lat_min,lon_min,lat_max,lon_max}/{date}/{days_back}/{max_clouds}/{view}?apikey=…`\n\nThe bbox is **latitude first**: `lat_min,lon_min,lat_max,lon_max` — NOT lon-first.\n`lat` ∈ [-90, 90], `lon` ∈ [-180, 180], and each `min` ≤ its `max`.\n\n- Examples: N. China `34,113,40,120`; Morges (CH) `46.42,6.60,46.46,6.66`.\n- If a latitude is out of [-90, 90] but valid as a longitude, the request is rejected with **HTTP 400** (\"coordinates look reversed\"). Out-of-range or min>max coords also give 400.\n- A **404** means no data for that date/area — usually a date/coverage gap, so the body suggests trying another date or a larger `days_back`. Only when a lat/lon swap can't be ruled out by range (both longitudes also ≤ 90) does it additionally suggest checking coordinate order.\n\n## Request size limits\n\nTo keep each request fast, `/v2/download_aoi` caps the area per call (over the limit → **HTTP 413**). Split larger jobs into tiles.\n\n- **Super-res / FR views** (`sr`, `s2rr`, `s2fr`, `s2gt`, `s2r5m`, `s2r2m`, all `*fr` reconstructions incl. thermal/SAR/Landsat FR, **pollution** and **night-light** FR): limited to **50 megapixels of output** — cost scales with output pixels, not ground area. The equivalent max AOI by output resolution:\n\n  | Output res | Max AOI |\n  |------------|---------|\n  | 50 cm (`sr`)            | ~12 km²       |\n  | 1 m (`s2rr`, `s2fr`, `s2gt`) | 50 km²        |\n  | 2 m (`s2r2m`)           | 200 km²       |\n  | 5 m (`s2r5m`)           | 1250 km²      |\n  | 7.5 m (thermal FR)      | ~2800 km²     |\n  | 500 m (night-light)     | ~12,000,000 km²   |\n  | 1.4 km (pollution)      | ~98,000,000 km²   |\n\n  So the coarse FR layers (pollution / night-light) allow whole continents but reject a single whole-world request.\n\n- **Coarse sensors** (thermal `lsthb10/11_tci`, CBERS, Landsat `ls15/ls5`, DEM, GLO-30): limited to **1000 km²** per request.\n- **Sentinel-2 10 m and spectral indices**: no size limit.\n\n### Sentinel-2 sensors (grammar: `{sensor}_{suffix}`)\n\n`suffix` is either `tci` (true-color RGB) or a band visualization / spectral index — see the two lists below.\n\n| Sensor   | Resolution | Notes                                       |\n|----------|------------|---------------------------------------------|\n| `s2`     | 10m        | Sentinel-2 native L2A                       |\n| `s2r2m`  | 2m         | Reconstructed (fused + deterministic 2× upscale) |\n| `sr`     | 50cm       | Super-resolution                            |\n| `s2dr`   | 2m         | Derived-Resolution (spectral only)          |\n| `s2rr`   | 1m         | Refined Reality (visual only)               |\n| `s2fr`   | 1m         | Fidelity Reconstruction (faithful, visual only for now: `s2fr_tci`) |\n| `s2gt`   | 1m         | S2 1m Grounded (ground-truth-trained, visual only: `s2gt_tci`) |\n| `s2r5m`  | 5m         | Derived 5m (non-linear gamma/sat TCI)       |\n| `s2nar5m`| 5m         | Derived 5m, Non-Adaptive Reconstruction (linear ESA TCI) |\n\nExamples: `s2_tci`, `s2_ndvi`, `s2r2m_tci`, `s2r2m_ndvi`, `sr_tci`, `sr_ndvi`.\n\n### Band visualizations (RGB combinations)\n\n| Suffix          | Bands                  | Purpose                   |\n|-----------------|------------------------|---------------------------|\n| `_natural`      | Red-Green-Blue         | True color                |\n| `_veganalysis`  | NIR-Red-Green          | Vegetation / false-color  |\n| `_cropsoil`     | NIR-SWIR-Red           | Crop / soil moisture      |\n| `_vegstress`    | SWIR-NIR-Red           | Vegetation stress         |\n| `_vegmoisture`  | SWIR-NIR-Green         | Vegetation + moisture     |\n| `_geology`      | SWIR-NIR-Blue          | Geological features       |\n| `_urban`        | NIR-SWIR-Blue          | Urban / rock              |\n| `_water`        | NIR-Red-Blue           | Water bodies              |\n| `_watercontent` | SWIR-Red-Green         | Water content             |\n| `_atmosphere`   | NIR-Green-Blue         | Atmospheric haze          |\n| `_burnscar`     | SWIR2-NIR-Red          | Burn scars                |\n| `_snow`         | SWIR-Red-Green         | Snow / ice                |\n| `_bathymetric`  | Red-Green-Blue         | Bathymetric (shallow water)|\n| `_drought`      | SWIR2-SWIR1-Red        | Drought                   |\n\n### Spectral indices (single-band scalar maps)\n\n| Suffix     | Name / Description                              |\n|------------|--------------------------------------------------|\n| `_ndvi`    | NDVI — Vegetation health                        |\n| `_ndwi`    | NDWI — Surface water content                    |\n| `_ndmi`    | NDMI — Canopy moisture                          |\n| `_savi`    | SAVI — Soil-adjusted vegetation                 |\n| `_msavi`   | MSAVI — Modified SAVI                           |\n| `_msavi2`  | MSAVI2 — Second-order MSAVI                     |\n| `_osavi`   | OSAVI — Optimized SAVI                          |\n| `_tsavi`   | TSAVI — Transformed SAVI                        |\n| `_evi`     | EVI — Enhanced vegetation                       |\n| `_evi2`    | EVI2 — Two-band EVI                             |\n| `_nbr`     | NBR — Burn ratio                                |\n| `_nbr2`    | NBR2 — Alternative burn ratio                   |\n| `_ndre`    | NDRE — Red-edge NDVI                            |\n| `_ndre2`   | NDRE variant (different red-edge band)          |\n| `_ndre3`   | NDRE variant (different red-edge band)          |\n| `_rendvi`  | RENDVI — Red-edge normalized difference         |\n| `_cire`    | CIRE — Chlorophyll index, red-edge              |\n| `_cire2`   | CIRE variant                                    |\n| `_cire3`   | CIRE variant                                    |\n| `_cig`     | CIG — Chlorophyll index, green                  |\n| `_gndvi`   | GNDVI — Green NDVI                              |\n| `_rvi`     | RVI — Ratio VI (NIR/Red)                        |\n| `_dvi`     | DVI — Difference VI                             |\n| `_rdvi`    | RDVI — Renormalized DVI                         |\n| `_pvi`     | PVI — Perpendicular VI                          |\n| `_ipvi`    | IPVI — Infrared percentage VI                   |\n| `_grvi`    | GRVI — Green-Red VI                             |\n| `_sr`      | SR — Simple ratio                               |\n| `_sr2`     | SR2 — Simple ratio variant                      |\n| `_sipi`    | SIPI — Structure-insensitive pigment            |\n| `_ari`     | ARI — Anthocyanin reflectance                   |\n| `_cri1`    | CRI1 — Carotenoid reflectance                   |\n| `_cri2`    | CRI2 — Carotenoid reflectance variant           |\n| `_mcari`   | MCARI — Modified chlorophyll absorption         |\n| `_tcari`   | TCARI — Transformed chlorophyll absorption      |\n| `_mre`     | MRE — Modified red edge                         |\n| `_tre`     | TRE — Transformed red edge                      |\n| `_mtvi`    | MTVI — Modified triangular VI                   |\n| `_mtvi2`   | MTVI2 — Modified triangular VI 2                |\n| `_tvi`     | TVI — Triangular VI                             |\n| `_ndsi`    | NDSI — Normalized difference soil               |\n| `_bsi`     | BSI — Bare soil                                 |\n| `_lai`     | LAI — Leaf area index                           |\n| `_cwc`     | CWC — Canopy water content (g/m²)               |\n| `_mineralclass` | Mineral classification (permission-gated)  |\n\n### Landsat\n\n| View          | Resolution | Notes                                                                         |\n|---------------|------------|-------------------------------------------------------------------------------|\n| `ls15_tci`    | 15m        | Pansharpened Landsat (L7/L8/L9 real pan; L4/L5 native 30m)                    |\n| `ls5_tci`     | 5m         | Upscaled from 15m                                                             |\n| `ls15fr_tci`  | 7.5m       | Fidelity Reconstruction ×2 of 15m pansharpened Landsat 8/9 (all bands, real pan) |\n| `ls30fr_tci`  | 15m        | Fidelity Reconstruction ×2 of native 30m Landsat 4/5/7 (deep archive)         |\n\n### Landsat thermal (TIRS, L8/L9)\n\nBrightness temperature, colorized (local temperature stretch). TIRS is natively ~100m.\n\n| View             | Resolution | Notes                                           |\n|------------------|------------|-------------------------------------------------|\n| `lsthb10_tci`    | 30m grid   | Band 10 (10.9µm), NASA 30m resampling of ~100m  |\n| `lsthb11_tci`    | 30m grid   | Band 11 (12.0µm)                                |\n| `lsthb10fr_tci`  | 25m        | Fidelity Reconstruction ×4 of true 100m B10     |\n| `lsthb11fr_tci`  | 25m        | Fidelity Reconstruction ×4 of true 100m B11     |\n\n### Combined Sentinel-2 + Landsat\n\n| View        | Resolution | Notes                                                                           |\n|-------------|------------|---------------------------------------------------------------------------------|\n| `r5m_tci`   | 5m         | Auto-selects S2 (5m derived) or Landsat (5m) per date for best temporal coverage |\n\n### PlanetScope\n\n| View        | Resolution | Notes                        |\n|-------------|------------|------------------------------|\n| `ps_tci`    | 3m         | Native PlanetScope tile      |\n| `psrr_tci`  | 1.9m       | Refined Reality super-res x2 |\n\n### Sentinel-1 SAR\n\nBackscatter intensity (logarithmic, colorized). The `tci` suffix produces an\n8-bit display-ready PNG. SAR penetrates clouds and works day/night.\n\n| View          | Resolution | Polarization | Notes                 |\n|---------------|------------|--------------|-----------------------|\n| `s1vv_tci`    | 10m        | VV           | Native raw Sentinel-1 |\n| `s1vh_tci`    | 10m        | VH           | Native raw Sentinel-1 |\n| `s1vvfr_tci`  | 2.5m       | VV           | Fidelity Reconstruction (fp32 x4) |\n| `s1vhfr_tci`  | 2.5m       | VH           | Fidelity Reconstruction (fp32 x4) |\n\n### Night light (VIIRS Black Marble)\n\nThe `nightlight125m_*` views are the Fidelity Reconstruction ×4 of the 500m VIIRS data (125m).\n\n| View                       | Resolution | Visualization                                           |\n|----------------------------|------------|---------------------------------------------------------|\n| `nightlight125m_tci`       | 125m (FR ×4) | Grayscale light intensity                             |\n| `nightlight125m_darkened`  | 125m (FR ×4) | Grayscale terrain, darkened where no light            |\n| `nightlight125m_lighted`   | 125m (FR ×4) | Grayscale terrain, golden highlights where lights are |\n| `nightlight500m_tci`       | 500m       | Grayscale light intensity                               |\n| `nightlight500m_darkened`  | 500m       | Grayscale terrain, darkened where no light              |\n| `nightlight500m_lighted`   | 500m       | Grayscale terrain, golden highlights where lights are   |\n\n### Air pollution (Sentinel-5P)\n\nGases: `no2`, `so2`, `co`, `ch4`, `hcho`, `aer_ai` (aerosol index); omit the gas for the combined view.\nNative data is ~5.5km; the Fidelity Reconstruction ×4 gives ~1.4km.\n\n| View                          | Endpoint                                 | Notes                                                    |\n|-------------------------------|------------------------------------------|----------------------------------------------------------|\n| `pollution_{gas}_overlay`     | `/pollution/{view}/{zoom}/{x}/{y}`       | Native-resolution colorized overlay (RGBA PNG tiles)      |\n| `pollution_overlay`           | `/pollution/{view}/{zoom}/{x}/{y}`       | Combined (all gases) native overlay                       |\n| `pollution_{gas}_geotiff`     | `/pollution/{view}/{zoom}/{x}/{y}`       | Real values, float32 GeoTIFF (no reconstruction)          |\n| `pollutionfr_{gas}`           | `/v2/download_aoi`, `/v2/{view}/…`       | Fidelity Reconstruction ×4 overlay (display only)         |\n| `pollutionfr`                 | `/v2/download_aoi`, `/v2/{view}/…`       | Combined FR ×4 overlay                                    |\n\nPoint values: `/pollution_value?lat=…&lon=…&gas=…` (native, never reconstructed).\n\n### High-value analytics & composite indexes (2m reconstructed)\n\nEach of these is a complete high-value analytics product or a complex\ncomposite index built on top of `s2r2m` — not a plain single-band index.\n\n| View                              | Description                                                     |\n|-----------------------------------|-----------------------------------------------------------------|\n| `s2r2m_soilsalinity`              | Soil salinity score (0–100)                                     |\n| `s2r2m_soilsalinityclass`         | Soil salinity categorical classes                               |\n| `s2r2m_soilsalinityconfidence`    | Model confidence for the soil-salinity estimate                 |\n| `s2r2m_biomassgrassland`          | Grassland biomass (kg/ha) — pasture / rangeland focus           |\n| `s2r2m_soilmoisture`              | Surface soil-moisture estimate                                  |\n| `s2r2m_bgwaterleak`               | Subsurface / background water-leak warnings                     |\n| `s2r2m_mineralmap`                | Mineral map (permission-gated)                                  |\n| `s2r2m_mineralclass`              | Mineral classification (permission-gated)                       |\n\n### Elevation\n\n| View  | Resolution                             | Notes                                                         |\n|-------|----------------------------------------|---------------------------------------------------------------|\n| `dem` | 1m spatial, 0.5–1m vertical accuracy   | ETD's own elevation dataset (not SRTM/ALOS)                   |\n\n### Other views\n\n| View            | Description                                              |\n|-----------------|----------------------------------------------------------|\n| `flood`         | Flood simulation                                         |\n| `s2_scl`        | Sentinel-2 Scene Classification Layer (cloud/shadow/etc) |\n| `changes_tci`   | Change detection between two dates                       |\n\n## Cloudless basemap — integration guide\n\nQuarterly, worldwide, cloudless Sentinel-2 mosaic, served from\n`https://basemap.earthtodate.com`. Web Mercator (EPSG:3857), JPEG tiles on the\nstandard `{z}/{x}/{y}` grid. **CORS:** every response (including 404s) sends\n`Access-Control-Allow-Origin: *`.\n\n**Layers**\n\n| Layer        | Resolution | Zoom levels | Notes                       |\n|--------------|------------|-------------|-----------------------------|\n| `tci_clean`  | 10m        | 14          | Native true-color; single zoom |\n| `sr5m_clean` | 5m         | 14–16       | Derived resolution          |\n| `sr_clean`   | 2.5m       | 14–16       | Super-resolution            |\n\nTiles are 256×256 (`tci_clean` renders ~194px, scaled onto the 256 grid). For a\nsmooth multi-zoom basemap use `sr5m_clean` or `sr_clean`; `tci_clean` is z14 only.\n\nPick ONE of the three integration methods below.\n\n### 1. XYZ / WebTileLayer (simplest — recommended)\n\nTemplate (standard Google/OSM XYZ scheme):\n\n    https://basemap.earthtodate.com/tiles/s2/{layer}/{z}/{x}/{y}.jpg\n\n`{layer}` = `tci_clean` | `sr5m_clean` | `sr_clean`. Example tile:\n`https://basemap.earthtodate.com/tiles/s2/sr5m_clean/14/2617/6329.jpg`\n\n- **Leaflet:** `L.tileLayer('https://basemap.earthtodate.com/tiles/s2/sr5m_clean/{z}/{x}/{y}.jpg', {minZoom:14, maxZoom:16, maxNativeZoom:16, tileSize:256})`\n- **OpenLayers:** `new ol.source.XYZ({url:'https://basemap.earthtodate.com/tiles/s2/sr_clean/{z}/{x}/{y}.jpg', minZoom:14, maxZoom:16})`\n- **MapLibre / Mapbox (raster source):** `{type:'raster', tiles:['https://basemap.earthtodate.com/tiles/s2/sr_clean/{z}/{x}/{y}.jpg'], tileSize:256, minzoom:14, maxzoom:16}`\n- **ArcGIS JS API (WebTileLayer):** `new WebTileLayer({urlTemplate:'https://basemap.earthtodate.com/tiles/s2/sr5m_clean/{level}/{col}/{row}.jpg'})` — ArcGIS `{level}/{col}/{row}` = `z/x/y`.\n\nDo **not** add this URL as an \"ArcGIS tiled map **service**\" — it is XYZ, not a REST service (that triggers a `?f=json` probe). Use WebTileLayer/XYZ here, or method 2.\n\n### 2. ArcGIS tiled MapServer (for Esri \"Add layer from URL\")\n\nA tiled-`MapServer` facade is exposed per layer:\n\n    https://basemap.earthtodate.com/tiles/s2/tci_clean/MapServer\n    https://basemap.earthtodate.com/tiles/s2/sr5m_clean/MapServer\n    https://basemap.earthtodate.com/tiles/s2/sr_clean/MapServer\n\n- **Service metadata:** `…/MapServer?f=json` → ArcGIS tiled-service descriptor\n  (WebMercator `wkid 102100`/`3857`, 256×256, JPEG, `singleFusedMapCache:true`,\n  LODs 14–16; `tci_clean` LOD 14 only).\n- **Tiles:** `…/MapServer/tile/{level}/{row}/{col}` (Esri order: level=z, row=y, col=x).\n  Example: `https://basemap.earthtodate.com/tiles/s2/sr_clean/MapServer/tile/14/6329/2617`\n- **Usage:** in ArcGIS Online / Pro / JS API, *Add layer from URL* → paste a\n  `…/MapServer` URL → add as an ArcGIS Server (tiled) web service.\n\nPrefer `sr5m_clean` or `sr_clean` (zoom 14–16); `tci_clean` is single-zoom.\n\n### 3. Embed the interactive viewer (no GIS integration)\n\nDrop the ready-made viewer into an `<iframe>` (tiles load internally as images —\nno CORS or tile wiring needed on your page; the host sets no `X-Frame-Options`):\n\n    <iframe src=\"https://basemap.earthtodate.com/?lat=37.82&lon=-122.48&zoom=13\"\n            style=\"width:100%;height:100%;border:0\"></iframe>\n\nOptional query params: `lat`, `lon`, `zoom`. The in-page button cycles 10m → 5m → 2.5m.\n","version":"3.1.0"},"paths":{"/pollution_geocode":{"get":{"summary":"Pollution Geocode","description":"Incremental place-name search -> top 10 [{name,lat,lon}]. Uses Photon (komoot, OSM-based)\nwhich is built for autocomplete; Nominatim public forbids autocomplete use and rate-limits.","operationId":"pollution_geocode_pollution_geocode_get","parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string","title":"Q"},"examples":{"example":{"summary":"San Francisco","value":"San Francisco"}}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/pollution_value":{"get":{"summary":"Pollution Value","description":"Current S5P reading(s) + units at a point. gas omitted/'combined' -> all 6 gases.","operationId":"pollution_value_pollution_value_get","parameters":[{"name":"lat","in":"query","required":true,"schema":{"type":"number","title":"Lat"},"examples":{"example":{"summary":"37.77","value":37.77}}},{"name":"lon","in":"query","required":true,"schema":{"type":"number","title":"Lon"},"examples":{"example":{"summary":"-122.42","value":-122.42}}},{"name":"gas","in":"query","required":false,"schema":{"type":"string","title":"Gas"},"examples":{"example":{"summary":"no2","value":"no2"}}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/pollution/{view}/{zoom}/{tile_x}/{tile_y}":{"get":{"summary":"Get Pollution Overlay","description":"Low-zoom transparent RGBA pollution OVERLAY tiles (S5P global store).\nSeparate from /v2 (which stays S2 z12-21). Continental scale: zoom 1-9.","operationId":"get_pollution_overlay_pollution__view___zoom___tile_x___tile_y__get","parameters":[{"name":"view","in":"path","required":true,"schema":{"type":"string","title":"View"},"examples":{"example":{"summary":"pollution_no2_overlay","value":"pollution_no2_overlay"}}},{"name":"zoom","in":"path","required":true,"schema":{"type":"integer","title":"Zoom"},"examples":{"example":{"summary":"6","value":6}}},{"name":"tile_x","in":"path","required":true,"schema":{"type":"integer","title":"Tile X"},"examples":{"example":{"summary":"10","value":10}}},{"name":"tile_y","in":"path","required":true,"schema":{"type":"integer","title":"Tile Y"},"examples":{"example":{"summary":"24","value":24}}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/{view}/{zoom}/{tile_x}/{tile_y}":{"get":{"summary":"Get Tile V2","description":"Get satellite tile using tile.py - Main API endpoint\n\nArgs:\n    view: Product view type (s2_tci, sr_tci, etc.)\n    zoom: Tile zoom level (14-18 only)\n    tile_x: Tile X coordinate\n    tile_y: Tile Y coordinate\n    end_date: Target date in YYYY-MM-DD format\n    days_back: Days to search backwards\n    max_clouds: Maximum cloud coverage percentage\n    before: Before date for change detection","operationId":"get_tile_v2_v2__view___zoom___tile_x___tile_y__get","parameters":[{"name":"view","in":"path","required":true,"schema":{"type":"string","title":"View"},"examples":{"s2rr_tci":{"summary":"s2rr_tci — 1 m Refined Reality (true color)","value":"s2rr_tci"},"s2r5m_tci":{"summary":"s2r5m_tci — 5 m true color","value":"s2r5m_tci"},"s2r5m_ndvi":{"summary":"s2r5m_ndvi — 5 m NDVI","value":"s2r5m_ndvi"}}},{"name":"zoom","in":"path","required":true,"schema":{"type":"integer","title":"Zoom"},"examples":{"example":{"summary":"16","value":16}}},{"name":"tile_x","in":"path","required":true,"schema":{"type":"integer","title":"Tile X"},"examples":{"example":{"summary":"10473","value":10473}}},{"name":"tile_y","in":"path","required":true,"schema":{"type":"integer","title":"Tile Y"},"examples":{"example":{"summary":"25325","value":25325}}},{"name":"end_date","in":"query","required":false,"schema":{"type":"string","title":"End Date"},"examples":{"example":{"summary":"2026-10-12","value":"2026-10-12"}}},{"name":"days_back","in":"query","required":false,"schema":{"type":"integer","title":"Days Back"},"description":"(default: 15)","examples":{"example":{"summary":"30","value":30}}},{"name":"max_clouds","in":"query","required":false,"schema":{"type":"integer","title":"Max Clouds"},"description":"(default: 20)","examples":{"example":{"summary":"20","value":20}}},{"name":"months","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Months"}},{"name":"prior_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prior Date"}},{"name":"before","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Before"}},{"name":"file","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File"}},{"name":"planet_apikey","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Planet Apikey"}},{"name":"apikey","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Apikey"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/dem_at_lat_lon":{"get":{"summary":"Dem At Lat Lon","description":"Get DEM elevation at a specific lat/lon point.\nReturns elevation from all 5 free DEM sources plus the fused result.","operationId":"dem_at_lat_lon_dem_at_lat_lon_get","parameters":[{"name":"lat","in":"query","required":true,"schema":{"type":"number","description":"Latitude","title":"Lat"},"description":"Latitude","examples":{"example":{"summary":"37.9235","value":37.9235}}},{"name":"lon","in":"query","required":true,"schema":{"type":"number","description":"Longitude","title":"Lon"},"description":"Longitude","examples":{"example":{"summary":"-122.5965","value":-122.5965}}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/los":{"get":{"summary":"Line Of Sight","description":"Terrain line-of-sight over the BaseDEM2 DSM.\n\nWalks the sight line between two points (each lifted `height` m above the DSM\nsurface at its location) and returns the first terrain blockage, accounting\nfor Earth curvature. Returns {\"blocked\": bool, \"blocked_at\": {lat,lon,elevation}|null}.","operationId":"line_of_sight_los_get","parameters":[{"name":"from_lat","in":"query","required":true,"schema":{"type":"number","description":"Observer latitude","title":"From Lat"},"description":"Observer latitude","examples":{"example":{"summary":"37.9235","value":37.9235}}},{"name":"from_lon","in":"query","required":true,"schema":{"type":"number","description":"Observer longitude","title":"From Lon"},"description":"Observer longitude","examples":{"example":{"summary":"-122.5965","value":-122.5965}}},{"name":"from_height","in":"query","required":true,"schema":{"type":"number","description":"Observer height above ground surface (m)","title":"From Height"},"description":"Observer height above ground surface (m)","examples":{"example":{"summary":"2","value":2}}},{"name":"to_lat","in":"query","required":true,"schema":{"type":"number","description":"Target latitude","title":"To Lat"},"description":"Target latitude","examples":{"example":{"summary":"37.7552","value":37.7552}}},{"name":"to_lon","in":"query","required":true,"schema":{"type":"number","description":"Target longitude","title":"To Lon"},"description":"Target longitude","examples":{"example":{"summary":"-122.4528","value":-122.4528}}},{"name":"to_height","in":"query","required":true,"schema":{"type":"number","description":"Target height above ground surface (m)","title":"To Height"},"description":"Target height above ground surface (m)","examples":{"example":{"summary":"10","value":10}}},{"name":"curvature","in":"query","required":false,"schema":{"type":"string","description":"'refraction' (4/3 Earth), 'sphere', or 'flat'","title":"Curvature"},"description":"'refraction' (4/3 Earth), 'sphere', or 'flat' (default: refraction)","examples":{"example":{"summary":"refraction","value":"refraction"}}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/history_snapshot":{"get":{"summary":"History Snapshot","description":"Generate agricultural field history snapshot or serve the HTML interface\n\nArgs:\n    title: Title for the snapshot (required for image generation)\n    bbox: Bounding box as min_lat,min_lon,max_lat,max_lon (required for image generation)\n    unit: Time unit (week|month|quarter|year), defaults to quarter\n    start: Start date as yyyy-mm-dd, defaults to today\n    count: Number of time periods, defaults to 12, max 25\n    views: Comma-separated list of views (up to 3), defaults to s2rr_tci","operationId":"history_snapshot_history_snapshot_get","parameters":[{"name":"title","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"examples":{"example":{"summary":"Presidio","value":"Presidio"}}},{"name":"bbox","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bbox"},"examples":{"example":{"summary":"37.792,-122.482,37.810,-122.448","value":"37.792,-122.482,37.810,-122.448"}}},{"name":"unit","in":"query","required":false,"schema":{"type":"string","pattern":"^(week|month|quarter|year)$","title":"Unit"},"description":"(default: quarter)","examples":{"example":{"summary":"quarter","value":"quarter"}}},{"name":"start","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}],"title":"Start"}},{"name":"count","in":"query","required":false,"schema":{"type":"integer","maximum":25,"minimum":1,"title":"Count"},"description":"(default: 12)","examples":{"example":{"summary":"4","value":4}}},{"name":"views","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Views"},"description":"(default: s2rr_tci)","examples":{"example":{"summary":"s2rr_tci","value":"s2rr_tci"}}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/download_aoi/{bbox_lat_lon}/{date_str}/{days_back}/{max_clouds}/{view}":{"get":{"summary":"Download Aoi V2","description":"Download Area of Interest - V2 API format\n\nArgs:\n    bbox_lat_lon: Bounding box as \"lat_min,lon_min,lat_max,lon_max\" (LATITUDE FIRST)\n    date_str: Target date in YYYY-MM-DD format\n    days_back: Days to search backwards\n    max_clouds: Maximum cloud coverage percentage\n    view: Product view type","operationId":"download_aoi_v2_v2_download_aoi__bbox_lat_lon___date_str___days_back___max_clouds___view__get","parameters":[{"name":"bbox_lat_lon","in":"path","required":true,"schema":{"type":"string","title":"Bbox Lat Lon"},"examples":{"example":{"summary":"37.792,-122.482,37.810,-122.448","value":"37.792,-122.482,37.810,-122.448"}}},{"name":"date_str","in":"path","required":true,"schema":{"type":"string","title":"Date Str"},"examples":{"example":{"summary":"2026-10-12","value":"2026-10-12"}}},{"name":"days_back","in":"path","required":true,"schema":{"type":"integer","title":"Days Back"},"examples":{"example":{"summary":"30","value":30}}},{"name":"max_clouds","in":"path","required":true,"schema":{"type":"integer","title":"Max Clouds"},"examples":{"example":{"summary":"20","value":20}}},{"name":"view","in":"path","required":true,"schema":{"type":"string","title":"View"},"examples":{"s2rr_tci":{"summary":"s2rr_tci — 1 m Refined Reality (true color)","value":"s2rr_tci"},"s2r5m_tci":{"summary":"s2r5m_tci — 5 m true color","value":"s2r5m_tci"},"s2r5m_ndvi":{"summary":"s2r5m_ndvi — 5 m NDVI","value":"s2r5m_ndvi"}}},{"name":"months","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Months"}},{"name":"prior_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prior Date"}},{"name":"caption","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Caption"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/dates/{lat_lon}/{view}/{date_str}/{days_back}/{max_clouds}":{"get":{"summary":"Get Available Dates","description":"Get list of available satellite imagery dates for a specific location.\n\nArgs:\n    lat_lon: Location as 'latitude,longitude'\n    view: Product name (e.g., s2_tci, sr_tci)\n    date_str: End date in YYYY-MM-DD format\n    days_back: Days to search back from end date\n    max_clouds: Maximum cloud coverage percentage (0-100)\n    source: Data source - \"s2\" for Sentinel-2 (default) or \"ps\" for PlanetScope\n\nReturns:\n    JSON array of available dates","operationId":"get_available_dates_dates__lat_lon___view___date_str___days_back___max_clouds__get","parameters":[{"name":"lat_lon","in":"path","required":true,"schema":{"type":"string","title":"Lat Lon"},"examples":{"example":{"summary":"37.80,-122.47","value":"37.80,-122.47"}}},{"name":"view","in":"path","required":true,"schema":{"type":"string","title":"View"},"examples":{"example":{"summary":"s2_tci","value":"s2_tci"}}},{"name":"date_str","in":"path","required":true,"schema":{"type":"string","title":"Date Str"},"examples":{"example":{"summary":"2026-10-12","value":"2026-10-12"}}},{"name":"days_back","in":"path","required":true,"schema":{"type":"integer","title":"Days Back"},"examples":{"example":{"summary":"365","value":365}}},{"name":"max_clouds","in":"path","required":true,"schema":{"type":"integer","title":"Max Clouds"},"examples":{"example":{"summary":"20","value":20}}},{"name":"source","in":"query","required":false,"schema":{"type":"string","default":"s2","title":"Source"}},{"name":"planet_apikey","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Planet Apikey"}},{"name":"include_safe","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Safe"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/download_shapefile/{date_str}/{days_back}/{max_clouds}/{view}":{"post":{"summary":"Download Shapefile","description":"Download a satellite image cropped to an uploaded shapefile.\n\n**Body:** raw shapefile bytes — `.shp`, `.zip` (shapefile or KMZ-as-zip),\n`.geojson`, `.kml`, or `.kmz`. LineString geometries are auto-closed\ninto polygons. Pixels outside the polygon are masked.\n\nAppend `_geotiff` to the view to get a GeoTIFF (multi-band, masked with\nnodata outside the shape); otherwise a PNG with alpha=0 outside.\n\nLogged AOI usage reflects the polygon area, not the bbox.\n\nFor the `view` parameter syntax, see the **View names** section at the\ntop of this API's documentation.","operationId":"download_shapefile_download_shapefile__date_str___days_back___max_clouds___view__post","parameters":[{"name":"date_str","in":"path","required":true,"schema":{"type":"string","title":"Date Str"},"examples":{"example":{"summary":"2026-10-12","value":"2026-10-12"}}},{"name":"days_back","in":"path","required":true,"schema":{"type":"integer","title":"Days Back"},"examples":{"example":{"summary":"30","value":30}}},{"name":"max_clouds","in":"path","required":true,"schema":{"type":"integer","title":"Max Clouds"},"examples":{"example":{"summary":"20","value":20}}},{"name":"view","in":"path","required":true,"schema":{"type":"string","title":"View"},"examples":{"example":{"summary":"s2_tci","value":"s2_tci"}}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/mineralmap":{"get":{"summary":"Mineralmap Endpoint","description":"Produce mineral maps for an area of interest.\n\nReturns a zip file containing mineral mapping outputs for each date:\n- primary/: tci, geology_composite, sabins, classification, ecai\n- secondary/: pca, iron, mixed_iron","operationId":"mineralmap_endpoint_mineralmap_get","parameters":[{"name":"aoi","in":"query","required":true,"schema":{"type":"string","description":"Bounding box as 'lat_min,lon_min,lat_max,lon_max' (max 100 sq km)","title":"Aoi"},"description":"Bounding box as 'lat_min,lon_min,lat_max,lon_max' (max 100 sq km)","examples":{"example":{"summary":"40.505,-112.170,40.535,-112.135","value":"40.505,-112.170,40.535,-112.135"}}},{"name":"end_date","in":"query","required":true,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"End date YYYY-MM-DD","title":"End Date"},"description":"End date YYYY-MM-DD","examples":{"example":{"summary":"2026-10-12","value":"2026-10-12"}}},{"name":"image_count","in":"query","required":false,"schema":{"type":"integer","maximum":12,"minimum":1,"description":"Number of images","title":"Image Count"},"description":"Number of images (default: 1)","examples":{"example":{"summary":"1","value":1}}},{"name":"days_gap","in":"query","required":false,"schema":{"type":"integer","maximum":365,"minimum":7,"description":"Days between images","title":"Days Gap"},"description":"Days between images (default: 90)","examples":{"example":{"summary":"90","value":90}}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"x-examples-date":"2026-10-12"}