Fire and Smoke Detection API Docs

Integrate real-time computer vision fire and smoke detection directly into your applications using our RESTful JSON APIs.

Authentication

Currently, the Detectium API is in public preview and does not require authentication keys. Rate limits are applied per IP address automatically.

GET

/api/v1/models

Returns a list of available object detection models. You can specify these model IDs when making prediction requests to choose whether to detect fire, smoke, etc.

cURL Example
curl -X 'GET' \
  'https://smoke.api.dev.iot.detectium.io/api/v1/models' \
  -H 'accept: application/json'
Response Schema (200 OK)
{
  "models": [
    {
      "id": "fire-latest",
      "name": "Fire Model",
      "version": "latest"
    },
    {
      "id": "smoke-latest",
      "name": "Smoke Model",
      "version": "latest"
    }
  ]
}
POST

/api/v1/predict

Uploads an image via `multipart/form-data` and returns a comprehensive JSON object containing detection summaries, image metadata, and a list of all bounding boxes.

Parameters
Name Type Description
image File The image file to analyze (JPEG, PNG, WEBP).
model_name String (Optional) The ID of the model to use (e.g. fire-latest, smoke-latest). Defaults to fire-latest. See List Models for available models.
Note: In the examples below, you must set IMAGE_PATH to the path of your own image file.
cURL Example
# 1. Download a sample image if you don't have one
curl -o sample.jpg https://smoke.api.dev.iot.detectium.io/static/default.jpg

# 2. Set the path to the image you want to analyze
IMAGE_PATH="sample.jpg"

# 3. Analyze the image
curl -X 'POST' \
  'https://smoke.api.dev.iot.detectium.io/api/v1/predict' \
  -H 'accept: application/json' \
  -H 'Content-Type: multipart/form-data' \
  -F "image=@$IMAGE_PATH" \
  -F "model_name=fire-latest"
Python Example
import requests

# 1. Download a sample image if you don't have one
sample_url = "https://smoke.api.dev.iot.detectium.io/static/default.jpg"
with open("sample.jpg", "wb") as f:
    f.write(requests.get(sample_url).content)

# 2. Set the path to the image you want to analyze
IMAGE_PATH = "sample.jpg"
url = "https://smoke.api.dev.iot.detectium.io/api/v1/predict"

# 3. Analyze the image
with open(IMAGE_PATH, "rb") as image_file:
    response = requests.post(url, files={"image": image_file}, data={"model_name": "fire-latest"})

print(response.json())
Response Schema (200 OK)
{
  "summary": {
    "total_detections": 2,
    "flame_count": 1,
    "smoke_count": 1,
    "highest_confidence": 0.89
  },
  "metadata": {
    "width": 640,
    "height": 480,
    "format": "JPEG"
  },
  "predictions": [
    {
      "xmin": 120.5,
      "ymin": 80.2,
      "xmax": 340.1,
      "ymax": 250.8,
      "confidence": 0.89,
      "class": 1,
      "name": "flame"
    }
  ]
}
POST

/api/v1/predict/image

Uploads an image via `multipart/form-data` and returns a raw JPEG image binary with bounding boxes directly drawn on it. Useful for quick visual debugging or simple frontend integrations.

Parameters
Name Type Description
image File The image file to analyze (JPEG, PNG, WEBP).
model_name String (Optional) The ID of the model to use (e.g. fire-latest, smoke-latest). Defaults to fire-latest.
cURL Example
# 1. Download a sample image if you don't have one
curl -o sample.jpg https://smoke.api.dev.iot.detectium.io/static/default.jpg

# 2. Set the path to the image you want to analyze
IMAGE_PATH="sample.jpg"

# 3. Analyze the image
curl -X 'POST' \
  'https://smoke.api.dev.iot.detectium.io/api/v1/predict/image' \
  -H 'accept: image/jpeg' \
  -H 'Content-Type: multipart/form-data' \
  -F "image=@$IMAGE_PATH" \
  -F "model_name=fire-latest" \
  --output result.jpg
Python Example
import requests

# 1. Download a sample image if you don't have one
sample_url = "https://smoke.api.dev.iot.detectium.io/static/default.jpg"
with open("sample.jpg", "wb") as f:
    f.write(requests.get(sample_url).content)

# 2. Set the path to the image you want to analyze
IMAGE_PATH = "sample.jpg"
url = "https://smoke.api.dev.iot.detectium.io/api/v1/predict/image"

# 3. Analyze the image
with open(IMAGE_PATH, "rb") as image_file:
    response = requests.post(url, files={"image": image_file}, data={"model_name": "fire-latest"})

with open("result.jpg", "wb") as f:
    f.write(response.content)