Quickstart
Quickstart
Section titled “Quickstart”From zero to your first survival prediction in under two minutes.
1. Get an API key
Section titled “1. Get an API key”Request access at canopitech.ai. You’ll receive a key that looks like:
cnpi_live_a8f2e9b1c4d7f0e3a6b9c2d5f8e1a4b7All API requests require this key in the X-API-Key header.
2. Make your first prediction
Section titled “2. Make your first prediction”Let’s predict survival for Douglas Fir planted by manual planting at a site on the western slopes of the Oregon Cascades.
curl -X POST https://api.canopitech.ai/v1/predict \ -H "X-API-Key: cnpi_live_your_api_key_here" \ -H "Content-Type: application/json" \ -d '{ "latitude": 44.12, "longitude": -122.03, "species_code": "PSME", "planting_method": "manual" }'Python
Section titled “Python”import httpx
response = httpx.post( "https://api.canopitech.ai/v1/predict", headers={"X-API-Key": "cnpi_live_your_api_key_here"}, json={ "latitude": 44.12, "longitude": -122.03, "species_code": "PSME", "planting_method": "manual" })
prediction = response.json()print(prediction)JavaScript
Section titled “JavaScript”const response = await fetch("https://api.canopitech.ai/v1/predict", { method: "POST", headers: { "X-API-Key": "cnpi_live_your_api_key_here", "Content-Type": "application/json", }, body: JSON.stringify({ latitude: 44.12, longitude: -122.03, species_code: "PSME", planting_method: "manual", }),});
const prediction = await response.json();console.log(prediction);3. Read the response
Section titled “3. Read the response”{ "site": { "latitude": 44.12, "longitude": -122.03, "matched_latitude": 44.1087, "matched_longitude": -122.0451, "match_distance_km": 1.82, "region": "pnw" }, "species_code": "PSME", "species_common_name": "Douglas Fir", "planting_method": "manual", "predictions": [ { "horizon_years": 1, "survival_probability": 0.94, "risk_factors": [ {"factor": "Vapor pressure deficit", "impact": "negative", "magnitude": 0.089}, {"factor": "Precipitation", "impact": "positive", "magnitude": 0.072}, {"factor": "Soil water capacity", "impact": "positive", "magnitude": 0.054} ] }, { "horizon_years": 3, "survival_probability": 0.87, "risk_factors": [...] }, { "horizon_years": 5, "survival_probability": 0.81, "risk_factors": [...] } ], "model": { "version": "pnw_v0_2_mycel", "codename": "mycel", "series": "Mycelium" }, "generated_at": "2026-06-25T14:30:00Z"}Here’s what you got back:
- site — Your requested coordinates plus the nearest data point Canopi matched to. The
match_distance_kmtells you how close the match is. - predictions — Survival probability at 1, 3, and 5 years. This site shows strong first-year survival (0.94) with gradual decline typical of a good planting site.
- risk_factors — The top environmental factors influencing survival at this site. Negative impacts reduce survival; positive impacts support it. Here, vapor pressure deficit (a measure of atmospheric dryness) is the primary risk.
- model — Which model version generated this prediction.
4. Compare planting methods
Section titled “4. Compare planting methods”Now try the same site with both methods compared:
curl -X POST https://api.canopitech.ai/v1/predict/compare \ -H "X-API-Key: cnpi_live_your_api_key_here" \ -H "Content-Type: application/json" \ -d '{ "latitude": 44.12, "longitude": -122.03, "species_code": "PSME" }'The /compare endpoint returns predictions for both manual planting and drone seeding, plus a method_differential showing the survival gap at each horizon. This is the question nobody else answers.
Next steps
Section titled “Next steps”- Authentication — Understand API keys and rate limits
- Predict endpoint — Full request and response reference
- How Predictions Work — What’s behind the numbers
- Species reference — All 20 available species