Overview
The BugLens API provides programmatic access to our AI-powered identification engine. Send an image and receive a structured JSON identification response.
The API endpoint is available at /.netlify/functions/identify (POST). Contact api@buglens.app for enterprise API keys.
POST /identify
// Request body
{
"tool": "insect", // insect|spider|plant|flower|bugbite
"imageData": "BASE64_STRING",
"mediaType": "image/jpeg",
"location": "Austin, TX", // optional
"environment": "Garden" // optional
}
JavaScript Example
const response = await fetch('/.netlify/functions/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);