FeaturesTemplatesShowcaseTownie
AI
BlogDocsPricing
Log inSign up
project logo
LladPlantfo
API for AI plant info
Public
Like
Plantfo
Home
Code
3
backend
1
README.md
test.html
Branches
2
Pull requests
Remixes
History
Environment variables
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Sign up now
Code
/
README.md
Code
/
README.md
Search
6/7/2025
Viewing readonly version of main branch: v21
View latest version
README.md

Plant Information API

A REST API that provides detailed plant information using OpenAI's GPT model.

Features

  • Get comprehensive plant information by name
  • Structured JSON response with 8 key plant characteristics
  • Powered by OpenAI GPT-4o-mini for accurate plant data

API Endpoints

GET /

Returns API information and usage instructions.

GET /plant/:name

Returns detailed information about a specific plant.

Parameters:

  • name (string, required): The name of the plant to look up

Response Format:

{ "name": "Common and scientific name", "description": "Detailed description of the plant", "lightNeeds": "Light requirements", "soilNeeds": "Soil type and pH requirements", "moistureNeeds": "Watering requirements", "bloomTime": "Blooming season/months", "height": "Mature height range", "spread": "Mature spread/width range" }

Example Request:

GET /plant/rose

Example Response:

{ "name": "Rose (Rosa spp.)", "description": "Roses are woody perennial flowering plants with fragrant blooms...", "lightNeeds": "Full sun (6+ hours direct sunlight daily)", "soilNeeds": "Well-draining, fertile soil with pH 6.0-7.0", "moistureNeeds": "Regular watering, 1-2 inches per week", "bloomTime": "Late spring through fall (May-October)", "height": "1-8 feet depending on variety", "spread": "2-6 feet depending on variety" }

GET /health

Health check endpoint that returns API status.

Error Handling

The API returns appropriate HTTP status codes:

  • 200: Success
  • 400: Bad request (missing plant name)
  • 500: Server error (OpenAI API issues, parsing errors)

Error responses include descriptive error messages and may include additional debugging information.

Usage Examples

# Get information about a rose curl https://your-api-url/plant/rose # Get information about a tomato plant curl https://your-api-url/plant/tomato # Get information about a Japanese maple curl https://your-api-url/plant/japanese%20maple

Technical Details

  • Built with Hono framework
  • Uses OpenAI GPT-4o-mini model
  • Includes input validation and error handling
  • Returns structured JSON responses
  • Supports URL-encoded plant names
Go to top
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Product
FeaturesPricing
Developers
DocsStatusAPI ExamplesNPM Package Examples
Explore
ShowcaseTemplatesNewest ValsTrending ValsNewsletter
Company
AboutBlogCareersBrandhi@val.town
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.