← Back to IsWeed.com

🌿 IsWeed API

RESTful API for AI-powered plant identification with 99.2% accuracy. Integrate cannabis vs herbs detection into your applications.

REST API GPT-4o Vision 99.2% Accuracy Free Tier Available

📋 API Overview

The IsWeed.com API provides AI-powered plant identification with a focus on cannabis detection. Built on GPT-4o Vision technology for maximum accuracy.

Base URL

Production API Base URL
https://api.isweed.com

Key Features

🎯

99.2% Accuracy

Advanced AI model trained specifically for plant identification with exceptional precision.

Real-time Analysis

Get instant results in 2-5 seconds with our optimized processing pipeline.

🔒

Privacy First

Images are processed and immediately deleted. No data retention or training usage.

📊

Detailed Results

Comprehensive analysis including confidence scores, plant types, and key features.

🔑 Authentication

Currently, the IsWeed.com API is free to use without authentication for educational purposes.

Current Access

The API is currently open for educational and research purposes. No API key is required.

Future Authentication (Coming Soon)

We're developing an API key system for production use. To get notified when it's available:

Contact for API Access
Email: [email protected] Subject: API Access Request Include: - Your use case - Expected monthly volume - Company/project details

Request Headers (Future)

Authorization Header
Authorization: Bearer YOUR_API_KEY Content-Type: multipart/form-data

🔗 API Endpoints

Complete reference for all available API endpoints and their usage.

GET Health Check

Check API status and system health

Endpoint

Request URL
GET /api/health

Response

Successful Response
{ "status": "healthy", "message": "Backend is running and OpenAI API key is configured", "timestamp": "2025-06-13T12:00:00.000Z", "server": { "name": "IsWeed.com Backend", "version": "1.0.0", "startTime": "2025-06-13T10:00:00.000Z" }, "services": { "openai": "connected", "uptime": 7200 } }
Error Response
{ "status": "error", "message": "Service unavailable", "timestamp": "2025-06-13T12:00:00.000Z" }

POST Analyze Plant Image

Upload an image for AI-powered plant identification

Endpoint

Request URL
POST /api/analyze

Request Parameters

Parameter Type Required Description
image File Required Plant image file (JPG, PNG, WebP, GIF). Max 10MB.
filename String Optional Original filename for reference
timestamp String Optional ISO timestamp for analysis

Request Example

cURL Request
curl -X POST https://api.isweed.com/api/analyze \ -F "image=@plant_photo.jpg" \ -F "filename=plant_photo.jpg" \ -H "Content-Type: multipart/form-data"
JavaScript (Fetch API)
const formData = new FormData(); formData.append('image', imageFile); formData.append('filename', imageFile.name); const response = await fetch('https://api.isweed.com/api/analyze', { method: 'POST', body: formData }); const result = await response.json(); console.log(result);
Python (requests)
import requests with open('plant_photo.jpg', 'rb') as f: files = {'image': f} data = {'filename': 'plant_photo.jpg'} response = requests.post( 'https://api.isweed.com/api/analyze', files=files, data=data ) result = response.json() print(result)

Response

Successful Analysis Response
{ "isWeed": false, "confidence": 92, "analysis": "This appears to be a sweet basil plant (Ocimum basilicum). The leaves show the characteristic ovate shape with smooth edges and opposite arrangement typical of basil. The serration pattern is absent, which distinguishes it from cannabis. Confidence: 92%", "plantType": "Sweet Basil (Ocimum basilicum)", "keyFeatures": [ "ovate shaped leaves", "smooth edges", "opposite leaf arrangement" ], "warnings": [], "metadata": { "analysisId": "abc123def", "timestamp": "2025-06-13T12:00:00.000Z", "processingTime": 2847, "fileInfo": { "originalName": "plant_photo.jpg", "mimeType": "image/jpeg", "size": 1024000, "sizeKB": 1000 }, "model": "gpt-4o" } }
Error Response
{ "error": "No image file provided", "code": "NO_FILE", "analysisId": "abc123def" }

Response Fields

Field Type Description
isWeed Boolean True if identified as cannabis, false otherwise
confidence Number Confidence percentage (0-100)
analysis String Detailed botanical analysis from AI
plantType String Identified plant species name
keyFeatures Array List of notable plant characteristics
warnings Array Any warnings about identification accuracy
metadata Object Analysis metadata and processing info

GET Server Information

Get API server information and capabilities

Request URL
GET /api/info
Response
{ "name": "IsWeed.com Backend", "version": "1.0.0", "description": "AI-powered plant identification backend", "endpoints": { "health": "/api/health", "analyze": "/api/analyze", "info": "/api/info" }, "capabilities": [ "Plant identification", "Cannabis detection", "Image analysis", "Botanical assessment" ] }

🚀 Live API Demo

Test the API directly in your browser. Upload an image to see the analysis in real-time.

📸

Drop an image here or click to browse

JPG, PNG, WebP, GIF • Max 10MB

API Response:

⏱️ Rate Limits

API usage limits to ensure fair access and system stability.

10

Analysis Requests

Per 5 minutes

100

General Requests

Per 15 minutes

10MB

Max File Size

Per image upload

60s

Request Timeout

Maximum processing time

Rate Limit Headers

All API responses include rate limit information in headers:

Response Headers
X-RateLimit-Limit: 10 X-RateLimit-Remaining: 8 X-RateLimit-Reset: 1640995200

Rate Limit Exceeded Response

429 Too Many Requests
{ "error": "Too many analysis requests. Please wait before analyzing more images.", "retryAfter": 300 }

⚠️ Error Codes

Complete reference for API error codes and troubleshooting.

HTTP Status Codes

400 Bad Request

The request was invalid. Common causes:

  • No image file provided (NO_FILE)
  • File too large (FILE_TOO_LARGE)
  • Invalid file type (INVALID_FILE_TYPE)
  • Empty file (EMPTY_FILE)

401 Unauthorized

Invalid API key or authentication failed (INVALID_API_KEY)

403 Forbidden

CORS policy violation or access forbidden (CORS_ERROR)

429 Too Many Requests

Rate limit exceeded (RATE_LIMITED)

500 Internal Server Error

Server error occurred (INTERNAL_ERROR)

503 Service Unavailable

Unable to connect to AI service (NETWORK_ERROR)

Error Response Format

Standard Error Response
{ "error": "Human-readable error message", "code": "ERROR_CODE", "analysisId": "abc123def", "timestamp": "2025-06-13T12:00:00.000Z" }

📦 SDKs & Integrations

Official SDKs and community integrations for popular programming languages.

Official SDKs (Coming Soon)

📜

JavaScript/Node.js

npm install @isweed/api-client

🐍

Python

pip install isweed-api

🦀

Rust

cargo add isweed-api

Java

Maven & Gradle support

Community Examples

Find example implementations and integrations in our GitHub repository:

GitHub Repository
https://github.com/isweed/api-examples

Contact & Support

For API questions, feature requests, or integration support: