Analyze an image
Analyzes an image by URL or by inline image bytes. Returns a list of classifications for the image and, when OCR is enabled, the text extracted from the image along with its own text analysis.
Only PNG, JPEG and WebP images are accepted, and the image must not exceed 1 MiB (1,048,576 bytes). Requests with an unsupported format or an oversized image are rejected with a 400 Bad Request.
Before diving in, we recommend reading the image taxonomy to understand the classifications returned by this endpoint.
Authorizations
API key authentication. Provide your key in the Authorization
header with the ApiKey scheme:
Body
- Option 1
- Option 2
Public URL of the image to analyze. The image must be a PNG, JPEG or WebP file no larger than 1 MiB. Only one of imageUrl or imageData can be provided.
When fetching the image, Bodyguard sends the user-agent Bodyguard-Analyze/1.0 (+https://bodyguard.ai/bot). If you allowlist Bodyguard on a CDN or firewall, match on the stable Bodyguard-Analyze product token rather than the full string — the version number and bot URL may change over time. Image fetches are not sent from a fixed set of IP addresses, so the user-agent is the signal to allowlist against.
Publication date of the image.
Base64-encoded image bytes. The image must be a PNG, JPEG or WebP file no larger than 1 MiB. Only one of imageUrl or imageData can be provided.
Response
Analysis completed.
Moderation result for an image.