Plantfo
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.
Viewing readonly version of main branch: v4View latest version
A REST API that provides detailed plant information using OpenAI's GPT model.
- Get comprehensive plant information by name
- Structured JSON response with 8 key plant characteristics
- Powered by OpenAI GPT-4o-mini for accurate plant data
Returns API information and usage instructions.
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" }
Health check endpoint that returns API status.
The API returns appropriate HTTP status codes:
200
: Success400
: 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.
# 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
- 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