Loading...
Animal Detect logo

Getting started with API

Use Animal Detect API to programmatically access our AI model powers in your applications.

1. Generate an API key

Navigate to the API tab in your Animal Detect account settings. Generate a new API key. Copy it and use it in your application. Keep the API keys secure and do not expose them in frontend or open-source projects. We recommend storing API keys in environment variables of your project.

API Key creation guide

2. Authenticate requests

All API requests must be authenticated with your API key. You can do this by including the key in the Authorization header of your requests like this:

Authorization: Bearer YOUR_API_KEY

3. Send your first API Request

Send one image to /api/v1/detect endpoint and inspect the returned annotations. This endpoints finds animals on your image and labels them.

cURL
curl -X POST "https://www.animaldetect.com/api/v1/detect" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "image=@/path/to/image.jpg" \
  -F "threshold=0.2" \
  -F "country=USA"

You can try all endpoints in the interactive playground to test the API.