Fishial Recognition API Reference

Developer-facing reference for authentication, image recognition, and feedback submission.

Overview

The Fishial Recognition API lets you:

  1. Obtain a short-lived bearer token
  2. Submit an image for fish recognition
  3. Optionally send feedback about the recognition result

The API uses JSON for authentication and feedback requests. Image recognition requests send raw binary image data in the request body.

Base URL

https://api-recognition.fishial.ai

Authentication

Create access token

Obtain a short-lived bearer token required for most API requests.

Endpoint

POST /v2/auth

Content-Type

Content-Type: application/json

Request body

{
  "client_id": "YOUR_CLIENT_ID",
  "client_secret": "YOUR_CLIENT_SECRET"
}

Fields

Success response

{
  "token_type": "Bearer",
  "access_token": "eyJhbGciOiJIUzI1NiJ9..."
}

Notes

Example

curl --request POST \
  --url https://api-recognition.fishial.ai/v2/auth \
  --header 'Content-Type: application/json' \
  --data '{
    "client_id": "YOUR_CLIENT_ID",
    "client_secret": "YOUR_CLIENT_SECRET"
  }'

Image Recognition

Recognize fish in an image

Scan an image and return detected fish objects with candidate species matches.

Endpoint

POST /v2/recognize

Authorization

Authorization: Bearer YOUR_ACCESS_TOKEN

Request body

Content-Type

You may send the image MIME type directly:

Content-Type: image/jpeg

or use a generic binary type:

Content-Type: application/octet-stream

Both are accepted according to the current docs.

Supported formats

Raster

Vector

Not supported

Limits

Success response

{
  "ok": true,
  "queryToken": "QUERY_TOKEN",
  "objects": [
    {
      "shape": [12.4, 40.1, 20.2, 38.6, 28.9, 45.0],
      "bbox": [12, 38, 90, 120],
      "species": [
        {
          "id": "SPECIES_UUID",
          "certainty": 0.97
        }
      ]
    }
  ],
  "definitions": {
    "SPECIES_UUID": {
      "commonName": "Mahi-mahi",
      "scientificName": "Coryphaena hippurus",
      "imageUrl": "https://..."
    }
  }
}

Response fields

Example

curl --request POST \
  --url https://api-recognition.fishial.ai/v2/recognize \
  --header "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  --header "Content-Type: image/jpeg" \
  --data-binary @fish.jpg

Recognition Options

Recognition options are passed as custom HTTP headers on the /v2/recognize request.

Header value restrictions

Header values should use only:

Avoid:

Detection quality headers

Fishial-Fish-Detection-Threshold

Controls fish detection sensitivity.

Example:

Fishial-Fish-Detection-Threshold: 0.5

Fishial-Fish-Shape-Max-Points

Controls the maximum number of points in the detected fish polygon.

Example:

Fishial-Fish-Shape-Max-Points: 64

Portal Collection Headers

These headers apply only when the image is being uploaded to a Fishial Portal collection. They are not described as general-purpose recognition parameters.

Privacy

Fishial-Face-Obfuscation

Blurs detected human faces. The source docs note that this may partially blur fish if a face is too close.

Example:

Fishial-Face-Obfuscation: true

Image licensing metadata

Fishial-Image-License-Code

Allowed values include:

Fishial-Image-License-Url

License URL, primarily relevant when using Custom.

Fishial-Image-License-Author

Name of the image author.

Fishial-Image-License-Source

Text or URL describing where the image came from.

Fishial-Image-License-Notice

Additional copyright information.

Additional metadata

Fishial-Image-Tags

Comma-separated list of tags.

Examples:

Fishial-Image-Tags: wow,a,tag

Creates three tags.

Fishial-Image-Tags: wow a tag

Creates one tag.

Fishial-Location-Lat-Lon

Observation coordinates in decimal degrees.

Example:

Fishial-Location-Lat-Lon: -55.260, -67.886

User Feedback

Submit feedback for a recognition result

Send user feedback about a recognition response.

Endpoint

POST /v2/feedback

Authorization

Authorization: Bearer YOUR_ACCESS_TOKEN

Content-Type

Content-Type: application/json

Request body

{
  "queryToken": "QUERY_TOKEN",
  "objectIndex": 0,
  "opinion": "Disagree",
  "suggestedSpeciesName": "Yellowfin tuna",
  "suggestedSpeciesID": "SPECIES_UUID"
}

Fields

Success response

{
  "ok": true
}

Notes

Example

curl --request POST \
  --url https://api-recognition.fishial.ai/v2/feedback \
  --header "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  --header "Content-Type: application/json" \
  --data '{
    "queryToken": "QUERY_TOKEN",
    "objectIndex": 0,
    "opinion": "Agree"
  }'

Error Responses

Unless otherwise noted, errors follow this schema:

{
  "ok": false,
  "error": "ERROR_CODE",
  "message": "Human-readable description"
}

Fields

Some server-side 5xx responses may not follow this schema or may not be valid JSON.

General error codes

Recognition error codes

Feedback error codes


Minimal Integration Flow

1. Get a token

curl --request POST \
  --url https://api-recognition.fishial.ai/v2/auth \
  --header 'Content-Type: application/json' \
  --data '{
    "client_id": "YOUR_CLIENT_ID",
    "client_secret": "YOUR_CLIENT_SECRET"
  }'

2. Recognize an image

curl --request POST \
  --url https://api-recognition.fishial.ai/v2/recognize \
  --header "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  --header "Content-Type: image/jpeg" \
  --data-binary @fish.jpg

3. Send feedback

curl --request POST \
  --url https://api-recognition.fishial.ai/v2/feedback \
  --header "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  --header "Content-Type: application/json" \
  --data '{
    "queryToken": "QUERY_TOKEN",
    "objectIndex": 0,
    "opinion": "Unsure"
  }'