CropGraph API.
USDA hardiness zone, climate type, frost dates, season length for a coordinate.
| Param | Required | Description |
|---|---|---|
| lat | required | Latitude in decimal degrees. Range -90..90. |
| lng | required | Longitude in decimal degrees. Range -180..180. |
Example
curl "https://api.cropgraph.com/api/zone?lat=48.118&lng=-123.43"
{
"coordinates": { "lat": 48.118, "lng": -123.43 },
"zone": { "zone": "8b", "zoneNumber": 8, "subzone": "b", "minTempF": 15, "maxTempF": 20 },
"frostDates": { "zone": "8b", "lastSpring": "04-15", "firstFall": "11-10", "seasonDays": 209 },
"seasonDays": 209,
"climateType": "maritime"
}
What to plant right now at a given coordinate. Returns the planting plan, each suggestion enriched with companions and antagonists.
| Param | Required | Description |
|---|---|---|
| lat | required | Latitude |
| lng | required | Longitude |
| date | optional | ISO date (YYYY-MM-DD). Defaults to today UTC. |
| climate | optional | Override climate. One of maritime, mediterranean, continental, humid_subtropical, arid, semi_arid. |
| category | optional | Restrict by category. One of vegetable, herb, fruit, flower, cover-crop, root, legume. |
| include_indoor | optional | true to include indoor-only crops. |
Example
curl "https://api.cropgraph.com/api/planting?lat=48.118&lng=-123.43&category=vegetable"
Full crop detail plus companions and antagonists. Slug is matched against crop slug, common name, scientific name, or alias. Returns 404 if no match.
Example
curl "https://api.cropgraph.com/api/crop/tomato"
{
"crop": { "slug": "tomato", "commonName": "Tomato", "scientificName": "Solanum lycopersicum" },
"companions": [
{ "crop": "tomato", "companion": "basil", "type": "beneficial", "mechanism": "pest_repellent", "strength": "strong" }
],
"antagonists": [
{ "crop": "tomato", "companion": "fennel-herb", "type": "antagonist" }
]
}
Companions and antagonists for one crop, with cited mechanisms and strengths.
Example
curl "https://api.cropgraph.com/api/companions/tomato"
Look up the directed relationship between two crops. Returns { "found": false } if no edge exists in either direction.
| Param | Required | Description |
|---|---|---|
| a | required | Crop slug or name |
| b | required | Crop slug or name |
Example
curl "https://api.cropgraph.com/api/check?a=tomato&b=basil"
Bed compatibility report for a group of crops. Surfaces every pairwise relationship (deduplicated) plus warnings for antagonist hubs.
| Param | Required | Description |
|---|---|---|
| crops | required | Comma-separated slugs. Minimum two. |
Example
curl "https://api.cropgraph.com/api/plan?crops=tomato,basil,marigold,carrot"
Filter and list crops by category, season, and zone.
| Param | Required | Description |
|---|---|---|
| category | optional | One of: vegetable, herb, fruit, flower, cover-crop, root, legume. |
| season | optional | One of: cool, warm, perennial, biennial. |
| zone | optional | USDA zone like 8b. |
| limit | optional | Integer 1..1000. Default 100. |
Example
curl "https://api.cropgraph.com/api/crops?category=herb&zone=8b"
Fuzzy search across slug, common name, scientific name, and aliases.
| Param | Required | Description |
|---|---|---|
| q | required | Query string |
| limit | optional | Integer 1..100. Default 20. |
Example
curl "https://api.cropgraph.com/api/search?q=pepper"
Rotation family, year-gap, follow-with families, never-follow families, and citation for one crop.
| Param | Required | Description |
|---|---|---|
| slug | required | Crop slug from the calendar (path segment), e.g. tomato. |
Example
curl "https://api.cropgraph.com/api/rotation/tomato"
{
"slug": "tomato",
"family": "nightshades",
"scientificFamily": "Solanaceae",
"rotationYears": 3,
"followWith": ["legumes", "grasses", "alliums"],
"neverFollow": ["nightshades"],
"reason": "…",
"source": "…"
}
Validate a multi-year planting sequence. The first slug is year one, the second is year two, and so on. Returns each year's family, any violations, and an isValid flag.
| Param | Required | Description |
|---|---|---|
| sequence | required | Comma-separated crop slugs in planting order. Minimum two. |
Example
curl "https://api.cropgraph.com/api/rotation-check?sequence=tomato,bush-bean,sweet-corn,cabbage"
Frost-anchored succession chain for a crop slug or chain slug. Phases carry frost-relative day offsets; for concrete ISO dates, use /api/succession-plan.
| Param | Required | Description |
|---|---|---|
| slug | required | Crop slug, primary crop, or chain slug (path segment), e.g. lettuce-leaf. |
Example
curl "https://api.cropgraph.com/api/succession/lettuce-leaf"
Succession chain resolved to concrete ISO dates for a coordinate. Pulls the chain by crop, resolves zone and climate from lat and lng, and projects each phase against the zone's frost dates.
| Param | Required | Description |
|---|---|---|
| crop | required | Crop slug, primary crop, or chain slug. |
| lat | required | Latitude in decimal degrees. |
| lng | required | Longitude in decimal degrees. |
| climate | optional | Override the detected climate type. One of: maritime, mediterranean, continental, humid_subtropical, arid, semi_arid. |
| year | optional | 4-digit anchor year. Defaults to the current UTC year. |
Example
curl "https://api.cropgraph.com/api/succession-plan?crop=lettuce-leaf&lat=48.118&lng=-123.43"
Pests and diseases affecting a crop, sorted by severity then by pest slug. Each entry carries diagnostic symptoms, ordered organic management options, prevention notes, regions, and a citation.
| Param | Required | Description |
|---|---|---|
| slug | required | Crop slug (path segment), e.g. tomato. |
Example
curl "https://api.cropgraph.com/api/pests/tomato"
Full detail for one pest or disease across every crop it affects, including aggregated severities and regions.
| Param | Required | Description |
|---|---|---|
| slug | required | Pest or disease slug (path segment), e.g. tomato-hornworm. |
Example
curl "https://api.cropgraph.com/api/pest/tomato-hornworm"
USDA SSURGO soil profile for a coordinate. Returns the soil series, drainage class, surface texture, pH range across the profile, organic-matter level at the surface horizon, rooting depth, and a recommendations array cross-referenced with crop preferences. This is the only endpoint that calls an upstream service (USDA NRCS Soil Data Access). It is cached aggressively (one week) because SSURGO is static.
| Param | Required | Description |
|---|---|---|
| lat | required | Latitude in decimal degrees. SSURGO covers the United States and its territories; points outside US coverage return 404. |
| lng | required | Longitude in decimal degrees. |
Example
curl "https://api.cropgraph.com/api/soil?lat=48.118&lng=-123.43"
{
"coordinates": { "lat": 48.118, "lng": -123.43 },
"mukey": "73450",
"component": { "name": "Clallam", "percent": 85 },
"soilType": "Clallam gravelly sandy loam, 0 to 15 percent slopes",
"drainageClass": "Moderately well drained",
"texture": "sandy loam",
"ph": { "min": 5.8, "max": 5.8 },
"organicMatter": "moderate",
"depth": "very deep (152+ inches)",
"recommendations": ["Drains acceptably…", "Slightly acidic…"],
"source": "USDA NRCS Soil Survey Geographic Database (SSURGO), via SDA REST"
}
The killer endpoint. One call traverses every graph dimension at the requested coordinate: hardiness zone, climate type, frost dates, USDA SSURGO soil profile, climate-aware planting windows, growing-degree-day harvest prediction, succession chains, rotation families, top pests with organic management, and bed-level companion and antagonist analysis. The garden-app developer makes one call and gets the complete plan. Soil outages and unknown crops degrade gracefully so the response stays useful in every case.
| Param | Required | Description |
|---|---|---|
| lat | required | Latitude in decimal degrees. |
| lng | required | Longitude in decimal degrees. |
| crops | required | Comma-separated list of crop slugs (or common names; findCrop matches both). Up to 20 per request. Unknown slugs are returned in unknownCrops; the rest of the plan continues. |
| year | optional | 4-digit year for the planting plan. Defaults to the current year. |
| climate | optional | Override the auto-detected climate type. One of maritime, mediterranean, continental, humid_subtropical, arid, semi_arid. |
| include_soil | optional | Pass false to skip the SSURGO upstream call (faster responses, no soil block). Defaults to true. |
| previous_crops | optional | Comma-separated CSV of last year's bed sequence. When supplied, bedAnalysis.rotationConflicts flags family collisions against the current crop list. |
Example
curl "https://api.cropgraph.com/api/garden-plan?lat=48.118&lng=-123.43&crops=tomato,basil,bush-bean,carrot,kale"
{
"location": {
"coordinates": { "lat": 48.118, "lng": -123.43 },
"zone": "8b",
"zoneNumber": 8,
"climateType": "maritime",
"frostDates": { "lastSpring": "03-15", "firstFall": "11-30" },
"seasonDays": 260,
"soil": {
"soilType": "Clallam gravelly sandy loam, 0 to 15 percent slopes",
"drainageClass": "Moderately well drained",
"texture": "sandy loam",
"ph": { "min": 5.8, "max": 5.8 },
"organicMatter": "moderate"
},
"soilError": null
},
"crops": [
{
"slug": "tomato",
"commonName": "Tomato",
"category": "vegetable",
"season": "warm",
"planting": { "action": "start_indoors", "windowStart": "2026-01-04", "windowEnd": "2026-02-01", "inWindow": true },
"harvest": {
"daysToHarvest": { "min": 55, "max": 90 },
"estimatedHarvestDate": "2026-07-29",
"latestHarvestDate": "2026-09-01",
"gddBased": true,
"gddAccumulated": 1205,
"confidence": "moderate",
"baseTemp": 50,
"gddRange": { "min": 1200, "max": 1800 }
},
"succession": { "hasChain": false, "phases": 1, "summary": "Single planting, no succession needed" },
"rotation": { "family": "nightshades", "rotationYears": 3, "followWith": ["legumes", "grasses", "alliums"], "neverFollow": [] },
"pests": [
{ "pest": "late-blight", "severity": "severe", "topManagement": "Copper preventive on the 5-day forecast" },
{ "pest": "tomato-hornworm", "severity": "high", "topManagement": "Handpick + Bt spray" }
],
"soilNotes": "Slightly acidic; nightshades prefer pH 6.0 to 6.8. Add calcium (lime or gypsum) to reduce blossom end rot risk."
}
],
"unknownCrops": [],
"bedAnalysis": {
"companions": [
{ "a": "tomato", "b": "basil", "type": "beneficial", "mechanism": "pest_repellent", "strength": "strong" }
],
"antagonists": [],
"warnings": [],
"rotationConflicts": []
},
"year": 2026,
"source": "CropGraph v1.5. USDA Cooperative Extension, NRCS SSURGO, NOAA Climate Normals 1991-2020."
}
Growing-degree-day harvest prediction for a crop at a coordinate. Returns the earliest cultivar harvest date (when accumulated GDD reaches the model's min threshold), the latest cultivar harvest date (when GDD reaches max), monthly heat-unit accumulation, the base-temperature model used, and a confidence band. Falls back to NOAA Climate Normals 1991-2020 by zone and climate when no daily temperatures are supplied. 120 crops carry literature-grounded GDD models; for crops without a model, use /api/crop/:slug and the daysToHarvest field instead.
| Param | Required | Description |
|---|---|---|
| crop | required | Crop slug or common name (matched via findCrop). Must have a GDD model curated; otherwise 404. |
| lat | required | Latitude in decimal degrees. |
| lng | required | Longitude in decimal degrees. |
| plant_date | required | ISO date YYYY-MM-DD the seed or transplant goes in the ground. |
| climate | optional | Override the auto-detected climate type. One of maritime, mediterranean, continental, humid_subtropical, arid, semi_arid. |
Example
curl "https://api.cropgraph.com/api/gdd?crop=tomato&lat=48.118&lng=-123.43&plant_date=2026-05-15"
{
"crop": "tomato",
"commonName": "Tomato",
"plantDate": "2026-05-15",
"location": { "zone": "8b", "zoneNumber": 8, "climateType": "maritime" },
"gddModel": { "baseTemp": 50, "gddToMaturity": { "min": 1200, "max": 1800 } },
"prediction": {
"estimatedHarvestEarliest": "2026-08-07",
"estimatedHarvestLatest": "2026-09-13",
"monthlyGddAccumulation": [
{ "month": "May", "gdd": 136 },
{ "month": "Jun", "gdd": 390 },
{ "month": "Jul", "gdd": 558 },
{ "month": "Aug", "gdd": 558 },
{ "month": "Sep", "gdd": 169 }
],
"totalGddEarliest": 1210,
"totalGddLatest": 1811,
"confidence": "moderate"
},
"source": "NOAA Climate Normals 1991-2020, CropGraph GDD models v1.5."
}
Rotation overview
The rotation graph maps every calendar crop to one of 12 botanical families and carries family-level rotation rules (year-gap, follow-with, never-follow). It ships across @cropgraph/core (typed helpers), /api/rotation and /api/rotation-check (REST), @cropgraph/mcp (two MCP tools), and the cropgraph CLI (two subcommands).
| Surface | Call |
|---|---|
| REST | GET /api/rotation/:slug, GET /api/rotation-check?sequence=... |
| npm | getRotationAdvice(slug), checkRotationSequence(slugs[]), getRotationPartners(slug) from @cropgraph/core |
| MCP | get_rotation_advice, check_rotation_sequence from @cropgraph/mcp |
| CLI | cropgraph rotation <crop>, cropgraph rotation-check <crops...> |
Each crop is in exactly one family: nightshades (Solanaceae, 3-year gap), brassicas (Brassicaceae, 2-year), cucurbits (Cucurbitaceae, 2-year), alliums (Amaryllidaceae, 2-year), legumes (Fabaceae, 2-year self-gap), umbellifers (Apiaceae, 2-year), grasses (Poaceae, 1-year), beets/spinach/amaranth (Amaranthaceae, 2-year), composites (Asteraceae, 2-year), mints (Lamiaceae, mostly perennial), malvaceae (2-year), and a miscellaneous catch-all for perennial fruit, nuts, asparagus, rhubarb, and ornamental flowers in their own minor families.
Succession overview
Succession chains turn a single bed into a continuous-harvest schedule. The fixture carries 33 chains across greens, roots, legumes, brassicas, cucurbits, herbs, cut flowers, and cover-crop relays. Each chain has an ordered list of phases. Each phase carries a crop slug, a sow method (direct_sow / transplant / start_indoors), a cadence (intervalWeeks, or null for a single planting), a frost-anchored window (days from last spring frost), per-climate notes, and a gardener-facing prose note. It ships across @cropgraph/core, /api/succession and /api/succession-plan (REST), @cropgraph/mcp (two MCP tools), and the cropgraph CLI.
| Surface | Call |
|---|---|
| REST | GET /api/succession/:slug (frost-relative), GET /api/succession-plan?crop=&lat=&lng= (concrete ISO dates) |
| npm | getSuccessionChain(slug), getSuccessionPlan({ slug, zone, climateType?, year? }), listSuccessionChains(category?) from @cropgraph/core |
| MCP | get_succession_chain, get_succession_plan from @cropgraph/mcp |
| CLI | cropgraph succession <crop> (frost-relative), cropgraph succession <crop> --zone 8b --climate maritime (concrete dates) |
Categories cover the common succession use cases: continuous-harvest (lettuce, spinach, arugula, chard cycles), root-succession (radish, carrot, beet, turnip, daikon cadences), legume-succession (bean / pea relays), brassica-succession (broccoli, cabbage, cauliflower spring + fall), cucurbit-relay (replacement plantings against vine borer and downy mildew), herb-succession (basil, cilantro, dill cadences), flower-succession (zinnia, cosmos, sunflower for continuous cut flowers), and cover-crop-relay (winter cover into cash crop into fall cover).
Pest and disease overview
The pest-disease graph has 158 crop-to-pest edges. Each entry carries a crop slug, a pest or disease slug (kebab-case, distinct namespace), a type flag (pest or disease), a severity grade (low / moderate / high / severe), diagnostic symptoms written for a gardener with a hand lens, an ordered list of organic management options, prevention practices, regions of significance, and a citation. Management is restricted to OMRI-listed materials, biocontrols, and physical/cultural practices; conventional synthetic pesticides are intentionally out of scope. It ships across @cropgraph/core, /api/pests and /api/pest (REST), @cropgraph/mcp (two MCP tools), and the cropgraph CLI.
| Surface | Call |
|---|---|
| REST | GET /api/pests/:slug (per-crop list), GET /api/pest/:slug (per-pest detail across affected crops) |
| npm | getPestsByCrop(slug), getPestDetail(pestSlug), getOrganicManagement(crop, pest), getCropsAffected(pestSlug), searchPests(query), getPestsWithDeterrents(slug) from @cropgraph/core |
| MCP | get_crop_pests, get_pest_detail from @cropgraph/mcp |
| CLI | cropgraph pests <crop> (per-crop list), cropgraph pest-detail <pest> (full record across affected crops) |
Sources: Cornell Cooperative Extension, UC IPM Online, UF/IFAS Extension, Penn State Extension, OSU Extension, WSU Extension, Texas A&M AgriLife Extension, Rodale Encyclopedia of Organic Gardening, USDA-ARS pest profiles. Severity grades are calibrated for the gardener: severe warrants resistant cultivars and long rotations; high is significant yield loss; moderate is cosmetic or partial; low is tolerable. The fixture is curated, not exhaustive; absence of an entry is not absence of pressure.
Error shape
Every error response has the same shape:
{
"error": true,
"code": "INVALID_COORDINATES",
"message": "Latitude must be between -90 and 90",
"status": 400
}
| Status | Codes |
|---|---|
| 400 | MISSING_PARAMETER, INVALID_PARAMETER, INVALID_COORDINATES |
| 404 | NOT_FOUND |
| 405 | METHOD_NOT_ALLOWED |
| 429 | RATE_LIMITED |
| 500 | INTERNAL_ERROR |
Rate limits
60 requests per minute per IP. No API key required.
X-RateLimit-Limit: request budget (60).X-RateLimit-Remaining: budget left in the current window.X-RateLimit-Reset: unix seconds when the window resets.Retry-After: seconds to wait. Sent only on 429 responses.
Successful responses include Cache-Control: public, max-age=3600. The underlying data is static. Cache aggressively.
Data attribution
The CropGraph dataset is curated from public-domain and openly licensed sources:
- USDA Cooperative Extension publications: Cornell CALS, WSU, UC ANR, UF / IFAS, OSU, Penn State, Texas A&M.
- USDA-ARS Three Sisters research.
- Xerces Society pollinator and beneficial-insect publications.
- PRISM 2023 USDA Plant Hardiness Zone Map.
- Riotte, Carrots Love Tomatoes; Cunningham, Great Garden Companions; the Rodale Encyclopedia.
Every crop record carries its source citation. If a relationship is unsourced, it does not ship.