API Reference / Get a stream sample's picture
API Reference

Get a stream sample's picture

GET/api/v1/live/sessions/{id}/frames/{seq}

Stream sessions: the JPEG of a recent sample (entries with frame: true). Only the last 90 or so samples keep their picture.

Path parameters#

Parameter Type Description
id required integer Session id.
seq required integer The sample's seq.

Responses#

200#

The picture.

Body: image/jpeg.

401#

Missing, unknown, revoked or expired API key, or the account is not active.

{
  "error": "unauthorized",
  "message": "The API key is not valid."
}

403#

The key may not do this: a read key on a write endpoint, or a restricted key.

{
  "error": "forbidden",
  "message": "This API key does not have write permission"
}

404#

No such session or frame, or the picture is no longer kept.

{
  "error": "not_found",
  "message": "That frame is no longer kept."
}

429#

Too many requests in a minute. Wait Retry-After seconds. See Rate limits.

Header Retry-After: Seconds to wait.

{
  "error": "too_many_requests",
  "message": "Too many requests. Try again in a minute."
}

Request

curl -X GET https://api.detectivision.ai/api/v1/live/sessions/{id}/frames/{seq} \
  -H "Api-Key: $DETECTIVISION_API_KEY"
import os, requests

r = requests.get(
    "https://api.detectivision.ai/api/v1/live/sessions/{id}/frames/{seq}",
    headers={"Api-Key": os.environ["DETECTIVISION_API_KEY"]},
)
print(r.status_code, r.json())
const res = await fetch("https://api.detectivision.ai/api/v1/live/sessions/{id}/frames/{seq}", {
  method: "GET",
  headers: {
    "Api-Key": process.env.DETECTIVISION_API_KEY,
  },
});
console.log(res.status, await res.json());