PlantNet API Setup Guide
Getting Your PlantNet API Key
PlantNet is a powerful plant identification API that uses millions of plant observations.
Step 1: Register for API Access
Go to PlantNet API Portal
Click on "Sign Up" or "Create an Account"
Fill in your registration details:
- Email address
- Password
- Name
- Organization (can be personal/student)
- Purpose (educational, research, commercial)
Verify your email address through the confirmation link
Step 2: Get Your API Key
Log in to PlantNet My Account
Navigate to the "API Keys" section
Click "Create New API Key" or "Generate API Key"
Choose your plan:
- Free Plan: 500 requests per day
- Paid Plans: Higher limits for commercial use
Copy your API key (format:
2a10xxxxxxxxxxxxxxxxxxxxxxxx)
Step 3: Configure Your Project
- Create a
.envfile in thegreenai/directory (if it doesn't exist):
# OpenRouter API Key (existing)
OPENROUTER_API_KEY=your_openrouter_key_here
# PlantNet API Key (new)
PLANTNET_API_KEY=your_plantnet_api_key_here
- IMPORTANT: Never commit your
.envfile to version control!
Add to .gitignore:
.env
*.env
Step 4: Test Your API Key
You can test your PlantNet API key using curl:
curl -X GET "https://my-api.plantnet.org/v2/identify/all?api-key=YOUR_API_KEY&images=https://bs.plantnet.org/image/o/12345.jpg"
Or use our built-in test endpoint (after integration):
curl -X GET "http://localhost:8000/test/plantnet"
PlantNet API Features
Available Projects (Flora)
For MCC Campus (India), the most relevant projects are:
k-indian-subcontinent- Indian Subcontinent flora (7,469 species) [Currently used]k-world-flora- World flora (82,920 species) - Broadest coverageuseful- Useful plants (5,519 species)k-western-indian-ocean- Western Indian Ocean (10,453 species)
Other popular projects:
weurope- Western Europek-northern-africa- Northern Africak-eastern-asia- Eastern Asiak-china- Chinak-australia- Australia- Plus 70+ more regional projects
To change the project, edit line 180 in api.py:
api_url = f"https://my-api.plantnet.org/v2/identify/k-indian-subcontinent"
Request Limits
- Free Tier: 500 requests/day
- Rate Limit: ~1 request per second
- Image Format: JPEG, PNG
- Max File Size: 5MB per image
API Response Structure
{
"query": {
"project": "all",
"images": ["image1_url"]
},
"results": [
{
"score": 0.95467,
"species": {
"scientificNameWithoutAuthor": "Rosa canina",
"scientificName": "Rosa canina L.",
"genus": "Rosa",
"family": "Rosaceae",
"commonNames": ["Dog Rose", "Briar Rose"]
},
"images": [...]
}
]
}
Integration Benefits
PlantNet API adds:
- β Access to 77M+ plant observations
- β Worldwide plant database
- β Multiple image analysis
- β Common names in multiple languages
- β Family and genus classification
- β Geographic distribution data
Troubleshooting
Common Issues
Error: "Invalid API Key"
- Check your API key is correctly copied
- Ensure no extra spaces in the .env file
- Verify the key is active in PlantNet dashboard
Error: "Quota Exceeded"
- Free tier limit reached (500/day)
- Wait 24 hours or upgrade to paid plan
Error: "Image too large"
- Resize images to under 5MB
- Compress JPEG quality
Error: "No result found"
- Plant may not be in database
- Try different image angles
- Use fallback to BioCLIP model
Support
- PlantNet Documentation: https://my.plantnet.org/doc
- API Support: contact@plantnet.org
- Project Issues: GitHub Issues
Cost Estimates
| Plan | Requests/Day | Monthly Cost |
|---|---|---|
| Free | 500 | $0 |
| Basic | 5,000 | ~β¬10 |
| Pro | 50,000 | ~β¬50 |
| Enterprise | Custom | Contact |
Last updated: February 2026