API reference

CropGraph API.

Base URL: https://api.cropgraph.com No auth 60 req / min per IP Returns JSON
GET /api/zone #

USDA hardiness zone, climate type, frost dates, season length for a coordinate.

ParamRequiredDescription
latrequiredLatitude in decimal degrees. Range -90..90.
lngrequiredLongitude 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"
}
GET /api/planting #

What to plant right now at a given coordinate. Returns the planting plan, each suggestion enriched with companions and antagonists.

ParamRequiredDescription
latrequiredLatitude
lngrequiredLongitude
dateoptionalISO date (YYYY-MM-DD). Defaults to today UTC.
climateoptionalOverride climate. One of maritime, mediterranean, continental, humid_subtropical, arid, semi_arid.
categoryoptionalRestrict by category. One of vegetable, herb, fruit, flower, cover-crop, root, legume.
include_indooroptionaltrue to include indoor-only crops.

Example

curl "https://api.cropgraph.com/api/planting?lat=48.118&lng=-123.43&category=vegetable"
GET /api/crop/:slug #

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" }
  ]
}
GET /api/companions/:slug #

Companions and antagonists for one crop, with cited mechanisms and strengths.

Example

curl "https://api.cropgraph.com/api/companions/tomato"
GET /api/check #

Look up the directed relationship between two crops. Returns { "found": false } if no edge exists in either direction.

ParamRequiredDescription
arequiredCrop slug or name
brequiredCrop slug or name

Example

curl "https://api.cropgraph.com/api/check?a=tomato&b=basil"
GET /api/plan #

Bed compatibility report for a group of crops. Surfaces every pairwise relationship (deduplicated) plus warnings for antagonist hubs.

ParamRequiredDescription
cropsrequiredComma-separated slugs. Minimum two.

Example

curl "https://api.cropgraph.com/api/plan?crops=tomato,basil,marigold,carrot"
GET /api/crops #

Filter and list crops by category, season, and zone.

ParamRequiredDescription
categoryoptionalOne of: vegetable, herb, fruit, flower, cover-crop, root, legume.
seasonoptionalOne of: cool, warm, perennial, biennial.
zoneoptionalUSDA zone like 8b.
limitoptionalInteger 1..1000. Default 100.

Example

curl "https://api.cropgraph.com/api/crops?category=herb&zone=8b"
GET /api/rotation/:slug #

Rotation family, year-gap, follow-with families, never-follow families, and citation for one crop.

ParamRequiredDescription
slugrequiredCrop 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": "…"
}
GET /api/rotation-check #

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.

ParamRequiredDescription
sequencerequiredComma-separated crop slugs in planting order. Minimum two.

Example

curl "https://api.cropgraph.com/api/rotation-check?sequence=tomato,bush-bean,sweet-corn,cabbage"
GET /api/succession/:slug #

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.

ParamRequiredDescription
slugrequiredCrop slug, primary crop, or chain slug (path segment), e.g. lettuce-leaf.

Example

curl "https://api.cropgraph.com/api/succession/lettuce-leaf"
GET /api/succession-plan #

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.

ParamRequiredDescription
croprequiredCrop slug, primary crop, or chain slug.
latrequiredLatitude in decimal degrees.
lngrequiredLongitude in decimal degrees.
climateoptionalOverride the detected climate type. One of: maritime, mediterranean, continental, humid_subtropical, arid, semi_arid.
yearoptional4-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"
GET /api/pests/:slug #

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.

ParamRequiredDescription
slugrequiredCrop slug (path segment), e.g. tomato.

Example

curl "https://api.cropgraph.com/api/pests/tomato"
GET /api/pest/:slug #

Full detail for one pest or disease across every crop it affects, including aggregated severities and regions.

ParamRequiredDescription
slugrequiredPest or disease slug (path segment), e.g. tomato-hornworm.

Example

curl "https://api.cropgraph.com/api/pest/tomato-hornworm"
GET /api/soil #

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.

ParamRequiredDescription
latrequiredLatitude in decimal degrees. SSURGO covers the United States and its territories; points outside US coverage return 404.
lngrequiredLongitude 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"
}
GET /api/garden-plan #

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.

ParamRequiredDescription
latrequiredLatitude in decimal degrees.
lngrequiredLongitude in decimal degrees.
cropsrequiredComma-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.
yearoptional4-digit year for the planting plan. Defaults to the current year.
climateoptionalOverride the auto-detected climate type. One of maritime, mediterranean, continental, humid_subtropical, arid, semi_arid.
include_soiloptionalPass false to skip the SSURGO upstream call (faster responses, no soil block). Defaults to true.
previous_cropsoptionalComma-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."
}
GET /api/gdd #

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.

ParamRequiredDescription
croprequiredCrop slug or common name (matched via findCrop). Must have a GDD model curated; otherwise 404.
latrequiredLatitude in decimal degrees.
lngrequiredLongitude in decimal degrees.
plant_daterequiredISO date YYYY-MM-DD the seed or transplant goes in the ground.
climateoptionalOverride 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).

SurfaceCall
RESTGET /api/rotation/:slug, GET /api/rotation-check?sequence=...
npmgetRotationAdvice(slug), checkRotationSequence(slugs[]), getRotationPartners(slug) from @cropgraph/core
MCPget_rotation_advice, check_rotation_sequence from @cropgraph/mcp
CLIcropgraph 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.

SurfaceCall
RESTGET /api/succession/:slug (frost-relative), GET /api/succession-plan?crop=&lat=&lng= (concrete ISO dates)
npmgetSuccessionChain(slug), getSuccessionPlan({ slug, zone, climateType?, year? }), listSuccessionChains(category?) from @cropgraph/core
MCPget_succession_chain, get_succession_plan from @cropgraph/mcp
CLIcropgraph 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.

SurfaceCall
RESTGET /api/pests/:slug (per-crop list), GET /api/pest/:slug (per-pest detail across affected crops)
npmgetPestsByCrop(slug), getPestDetail(pestSlug), getOrganicManagement(crop, pest), getCropsAffected(pestSlug), searchPests(query), getPestsWithDeterrents(slug) from @cropgraph/core
MCPget_crop_pests, get_pest_detail from @cropgraph/mcp
CLIcropgraph 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
}
StatusCodes
400MISSING_PARAMETER, INVALID_PARAMETER, INVALID_COORDINATES
404NOT_FOUND
405METHOD_NOT_ALLOWED
429RATE_LIMITED
500INTERNAL_ERROR

Rate limits

60 requests per minute per IP. No API key required.

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:

Every crop record carries its source citation. If a relationship is unsourced, it does not ship.