# Plant Health Analyzer (`saadithya/plant-health-analyzer`) Actor

Plant Health Analyzer uses AI vision to analyze plant images and detect signs of stress, disease, or nutrient issues. It provides easy-to-understand health insights and care suggestions to help plants grow healthier. For informational purposes only.

- **URL**: https://apify.com/saadithya/plant-health-analyzer.md
- **Developed by:** [Aadhithya](https://apify.com/saadithya) (community)
- **Categories:** AI, Agents
- **Stats:** 10 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.01 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## 🌱 Plant Health Analyzer

An AI-powered plant disease detector that analyzes plant images to identify health issues, provide diagnoses, and suggest appropriate treatments. The actor uses computer vision and plant pathology knowledge to examine plant symptoms and offer actionable recommendations for plant care.

### Overview

The Plant Health Analyzer leverages advanced AI vision models to examine plant images and identify potential health issues, diseases, or nutrient deficiencies. It analyzes visual symptoms such as discoloration, spots, wilting, and other plant abnormalities, then provides professional diagnoses and treatment recommendations.

### How It Works

1. **Provide Plant Image**: Supply a clear image of a plant showing symptoms via URL
2. **Ask Questions (Optional)**: Include specific questions about plant issues or care
3. **AI Analysis**: The system examines visible plant symptoms using computer vision
4. **Professional Diagnosis**: Plant pathology analysis identifies potential issues
5. **Treatment Recommendations**: Receive actionable care suggestions and solutions

### Input Parameters

The actor accepts the following input:

- `imageUrl`: Public URL of the plant image to analyze (required)
- `question`: Optional specific question about the plant issue or care instructions
- `openaiApiKey`: Your OpenAI API key (optional, will use platform secrets if not provided)
- `model`: Vision-capable model (e.g. 'gpt-4o-mini', 'gpt-4o')
- `testMode`: Enable test mode for auto-testing with sample data (defaults to false)

*Note: Either `imageUrl` or `imageKey` is required*

### Output

The actor returns a comprehensive plant health analysis including:

- `plantIssues`: Object containing descriptions of identified plant problems
  - `symptoms`: Description of visible symptoms and their locations
  - `severity`: Assessment of issue severity (mild, moderate, severe)
  - `affectedAreas`: Which parts of the plant are affected
- `diagnosis`: Professional assessment of potential diseases or conditions
- `treatment`: Recommended treatment options and care instructions
- `prevention`: Tips to prevent similar issues in the future
- `questionAnswer`: Specific answer to user's question (if provided)

### Example Use Cases

- Diagnosing plant diseases and health issues
- Identifying nutrient deficiencies
- Getting treatment recommendations for sick plants
- Learning proper plant care techniques
- Preventing plant problems before they worsen
- Garden and farming advisory support

### Quick Start

1. Capture a clear photo of your plant showing symptoms (ensure good lighting and focus)
2. Make the image publicly accessible via URL
3. Provide your OpenAI API key (as input or platform secret)
4. Run the actor with your plant image URL
5. Receive professional plant health analysis and treatment recommendations

### Sample Input

```json
{
  "imageUrl": "https://example.com/my-plant-photo.jpg",
  "question": "What's wrong with my tomato plant leaves?",
  "openaiApiKey": "your-openai-api-key-here",
  "model": "gpt-4o-mini",
  "testMode": false
}
```

### Sample Output

```json
{
  "plantIssues": {
    "symptoms": "Yellowing leaves with brown spots, wilting lower leaves",
    "severity": "moderate",
    "affectedAreas": "leaves, stem base"
  },
  "diagnosis": "Likely fungal infection (early blight) combined with possible nutrient deficiency",
  "treatment": "1. Remove affected leaves immediately. 2. Apply fungicide spray weekly. 3. Improve soil drainage. 4. Add balanced fertilizer.",
  "prevention": "Ensure proper spacing, water at base not leaves, rotate crops annually, maintain soil health",
  "questionAnswer": "The yellowing with brown spots on lower leaves indicates early blight fungus. Remove affected parts and treat with copper-based fungicide."
}
```

### Benefits

- **Visual Plant Analysis**: Uses AI vision models to identify plant health issues accurately
- **Professional Diagnosis**: Provides expert-level plant pathology assessments
- **Actionable Treatment**: Offers specific, practical care recommendations
- **Preventive Guidance**: Helps prevent future plant health problems
- **Question Support**: Answers specific user questions about plant care
- **Easy to Use**: Requires only a plant image URL and optional API key
- **Scientific Approach**: Based on established plant pathology principles

### Safety & Compliance

⚠️ **Important Safety Features**:

- **Educational Purpose**: Designed for plant care education and guidance
- **Professional Recommendations**: Based on established horticultural practices
- **Non-Medical**: Does not replace professional agricultural consultation
- **General Guidance**: Provides general care advice, not specific medical treatment
- **Clear Limitations**: Acknowledges when professional help is needed
- **Responsible Advice**: Recommends consulting experts for serious issues

### Responsible AI Usage

This actor follows responsible AI practices by:

1. **Clear Positioning**: Explicitly plant care-focused
2. **Professional Standards**: Follows established horticultural practices
3. **Transparent Limitations**: Acknowledges when expert consultation is needed
4. **User Protection**: Prevents potentially harmful plant treatments
5. **Educational Aspect**: Promotes proper plant care knowledge

### Monetization

The actor can be configured with pay-per-event pricing:

- Event name: `plant-analysis`
- Suggested price: $0.05 per successful analysis
- Triggered only when plant issues are successfully detected
- Configurable through Apify platform billing settings

### Important Disclaimer

**This AI-generated plant analysis is for educational and advisory purposes only. It does not replace professional agricultural or botanical consultation. Serious plant health issues should be evaluated by qualified horticulturists or plant pathologists.**

Plant care recommendations are based on general horticultural principles and may not address all specific conditions. Always research local conditions and consult experts for critical plant health decisions.

# Actor input Schema

## `testMode` (type: `boolean`):

Enable test mode for auto-testing with sample plant data (no imageUrl required)

## `imageUrl` (type: `string`):

Public URL of the plant image showing symptoms to analyze

## `question` (type: `string`):

Optional question about plant issues, care instructions, or specific concerns

## `openaiApiKey` (type: `string`):

Your OpenAI API key for plant analysis (will use platform secrets if not provided)

## `model` (type: `string`):

Vision-capable model for plant analysis

## Actor input object example

```json
{
  "testMode": true,
  "model": "gpt-4o-mini"
}
```

# Actor output Schema

## `overview` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("saadithya/plant-health-analyzer").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("saadithya/plant-health-analyzer").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call saadithya/plant-health-analyzer --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,saadithya/plant-health-analyzer"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/24y5bGUe9IRmw0cat/builds/PSc2Pj4ZBr5w5pRxa/openapi.json
