Overview

The BugLens API provides programmatic access to our AI-powered identification engine. Send an image and receive a structured JSON identification response for insects, spiders, plants, flowers, or bug bites.

✅ REST API JSON Responses HTTPS Only

Authentication

Contact us at api@buglens.app to obtain an API key for production use.

// Include in request headers
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

POST /api/identify

Submit an image for AI identification. The image should be base64-encoded.

// Request body
{ "tool": "insect", // insect|spider|plant|flower|bugbite "imageData": "BASE64_STRING", "mediaType": "image/jpeg", // image/jpeg|image/png|image/webp "location": "Austin, TX", // optional "environment": "Garden" // optional }

Response Format

{ "commonName": "Monarch Butterfly", "scientificName": "Danaus plexippus", "confidence": 94, "dangerLevel": "Harmless", "dangerColor": "green", "habitat": "Open fields, meadows, roadsides", "geographicRange": "North America, Central America", "size": "3.5-4 inch wingspan", "diet": "Nectar (adult), Milkweed (larva)", "lifeCycle": "Egg → Caterpillar → Chrysalis → Adult", "safetyNotes": "Completely harmless to humans", "description": "The monarch butterfly is..." }

Rate Limits

Free Tier
10 req/day
No API key required
Developer
500 req/day
API key required
Enterprise
Unlimited
Contact us

JavaScript Example

const response = await fetch('https://buglens.app/api/identify', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ tool: 'insect', imageData: base64String, mediaType: 'image/jpeg' }) }); const result = await response.json(); console.log(result.commonName); // "Monarch Butterfly"