Overview

The Plants API provides access to the Garden.gg plant database and lets you manage plants within your plots. Browse thousands of plants by name, type, family, or growing zone, then add them to your garden plots to track their growth.

Endpoints

MethodPathDescriptionAuth Required
GET/plantsBrowse plant databaseYes
GET/plants/:idGet plant detailsYes
POST/plots/:id/plantsAdd a plant to a plotYes
PUT/plots/:plotId/plants/:idUpdate a plant in a plotYes
DELETE/plots/:plotId/plants/:idRemove a plant from a plotYes

Browse Plant Database

Search and filter the plant database.

GET /plants

Query Parameters

ParameterTypeDefaultDescription
pageinteger1Page number
per_pageinteger20Items per page (max 100)
searchstringSearch by common or botanical name
typestringFilter by type: vegetable, fruit, herb, flower, tree, shrub
familystringFilter by botanical family (e.g., Solanaceae)
zonestringFilter by compatible hardiness zone

Response 200 OK

{
  "data": [
    {
      "id": "plant_t0m4t0",
      "common_name": "Tomato",
      "botanical_name": "Solanum lycopersicum",
      "type": "vegetable",
      "family": "Solanaceae",
      "zones": ["3", "4", "5", "6", "7", "8", "9", "10", "11"],
      "days_to_germination": "5-10",
      "days_to_harvest": "60-85",
      "sun_requirement": "full_sun",
      "water_requirement": "regular",
      "spacing_cm": 60,
      "image_url": "https://cdn.garden.gg/plants/tomato.jpg"
    },
    {
      "id": "plant_b4s1l",
      "common_name": "Basil",
      "botanical_name": "Ocimum basilicum",
      "type": "herb",
      "family": "Lamiaceae",
      "zones": ["4", "5", "6", "7", "8", "9", "10"],
      "days_to_germination": "5-7",
      "days_to_harvest": "50-75",
      "sun_requirement": "full_sun",
      "water_requirement": "regular",
      "spacing_cm": 30,
      "image_url": "https://cdn.garden.gg/plants/basil.jpg"
    }
  ],
  "total": 1247,
  "page": 1,
  "per_page": 20
}

Examples

cURL

# Search for tomato varieties
curl -X GET "https://garden.gg/api/v1/plants?search=tomato&type=vegetable" \
  -H "Authorization: Bearer gg_live_your_api_key_here"

Python

import requests

headers = {"Authorization": "Bearer gg_live_your_api_key_here"}

# Search for herbs compatible with zone 6
response = requests.get(
    "https://garden.gg/api/v1/plants",
    headers=headers,
    params={"type": "herb", "zone": "6"},
)

plants = response.json()
for plant in plants["data"]:
    print(f"{plant['common_name']} ({plant['botanical_name']})")

Node.js

const params = new URLSearchParams({ search: "pepper", type: "vegetable" });

const response = await fetch(
  `https://garden.gg/api/v1/plants?${params.toString()}`,
  { headers: { Authorization: "Bearer gg_live_your_api_key_here" } }
);

const { data: plants } = await response.json();
plants.forEach((p) => console.log(`${p.common_name} — ${p.days_to_harvest} days`));

Get Plant Details

Retrieve detailed information about a specific plant from the database.

GET /plants/:id

Response 200 OK

{
  "id": "plant_t0m4t0",
  "common_name": "Tomato",
  "botanical_name": "Solanum lycopersicum",
  "type": "vegetable",
  "family": "Solanaceae",
  "zones": ["3", "4", "5", "6", "7", "8", "9", "10", "11"],
  "days_to_germination": "5-10",
  "days_to_harvest": "60-85",
  "sun_requirement": "full_sun",
  "water_requirement": "regular",
  "spacing_cm": 60,
  "planting_depth_cm": 1,
  "companion_plants": ["basil", "carrot", "marigold"],
  "avoid_planting_near": ["fennel", "brassicas"],
  "growing_tips": "Stake or cage indeterminate varieties. Prune suckers for larger fruit.",
  "image_url": "https://cdn.garden.gg/plants/tomato.jpg"
}

Add Plant to Plot

Add a plant from the database to one of your plots.

POST /plots/:plotId/plants

Path Parameters

ParameterTypeDescription
plotIdstringThe plot’s ID

Request Body

FieldTypeRequiredDescription
plant_idstringYesID from the plant database
varietystringNoSpecific variety name (e.g., “Cherokee Purple”)
planted_datestringNoDate planted in RFC 3339 format
quantityintegerNoNumber of plants (default: 1)
notesstringNoAdditional notes about this planting

Request

{
  "plant_id": "plant_t0m4t0",
  "variety": "Cherokee Purple",
  "planted_date": "2026-04-15T00:00:00Z",
  "quantity": 3,
  "notes": "Started from seed indoors on March 1"
}

Response 201 Created

{
  "id": "ppl_c3d4e5f6",
  "plot_id": "plt_m3n4o5p6",
  "plant_id": "plant_t0m4t0",
  "plant_name": "Tomato",
  "variety": "Cherokee Purple",
  "planted_date": "2026-04-15T00:00:00Z",
  "quantity": 3,
  "status": "planted",
  "notes": "Started from seed indoors on March 1",
  "created_at": "2026-03-15T10:00:00Z",
  "updated_at": "2026-03-15T10:00:00Z"
}

Examples

cURL

curl -X POST "https://garden.gg/api/v1/plots/plt_m3n4o5p6/plants" \
  -H "Authorization: Bearer gg_live_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "plant_id": "plant_t0m4t0",
    "variety": "Cherokee Purple",
    "planted_date": "2026-04-15T00:00:00Z",
    "quantity": 3
  }'

Python

import requests

response = requests.post(
    "https://garden.gg/api/v1/plots/plt_m3n4o5p6/plants",
    headers={
        "Authorization": "Bearer gg_live_your_api_key_here",
        "Content-Type": "application/json",
    },
    json={
        "plant_id": "plant_t0m4t0",
        "variety": "Cherokee Purple",
        "planted_date": "2026-04-15T00:00:00Z",
        "quantity": 3,
    },
)

plant = response.json()
print(f"Added {plant['variety']} to plot: {plant['id']}")

Node.js

const response = await fetch(
  "https://garden.gg/api/v1/plots/plt_m3n4o5p6/plants",
  {
    method: "POST",
    headers: {
      Authorization: "Bearer gg_live_your_api_key_here",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      plant_id: "plant_t0m4t0",
      variety: "Cherokee Purple",
      planted_date: "2026-04-15T00:00:00Z",
      quantity: 3,
    }),
  }
);

const plant = await response.json();
console.log(`Added ${plant.variety} to plot: ${plant.id}`);

Update Plant in Plot

Update details of a plant that has been added to a plot.

PUT /plots/:plotId/plants/:id

Request Body

FieldTypeRequiredDescription
varietystringNoVariety name
planted_datestringNoDate planted (RFC 3339)
quantityintegerNoNumber of plants
statusstringNoOne of: planted, growing, flowering, fruiting, harvesting, dormant, removed
notesstringNoAdditional notes

Response 200 OK

Returns the full updated plant object.

Remove Plant from Plot

Remove a plant record from a plot.

DELETE /plots/:plotId/plants/:id

Response 204 No Content

No response body.

Error Responses

ScenarioHTTP StatusError Code
Plant not found in database404NOT_FOUND
Plot not found404NOT_FOUND
Plant not in this plot404NOT_FOUND
Invalid plant_id400VALIDATION_ERROR
Not your plot403FORBIDDEN
Not authenticated401UNAUTHORIZED