Skip to content

Guides

Read and filter results

Get the full result of an analysis, filter it in your own code, and what the language parameter does today.

Once an analysis is FINISHED, getVodAnalysisResults returns its full result: the video as a whole, its scenes, and the camera shots of each scene. The result format page has the shape, what an absent or UNKNOWN value means, and how the API’s answer differs from the app’s JSON download (two shapes).

The examples need bash, curl and jq, and read MEDIASEER_API_URL, MEDIASEER_API_KEY and ANALYSIS_ID from the environment; see the quickstart. The examples keep credentials off curl’s command line and ignore your curl configuration.

Fetching results through an API, CLI or MCP tool is not a browser view or download signal. With effective permission, the web app records a foreground rendered-results view once per navigation and explicit JSON-report or MP4-clip download intent. Polling, URL refreshes, retries and late opt-in do not replay a view or imply a saved download. See analytics settings.

The API has no filter: no parameter picks scenes, scene types or a time range. You get the whole result and filter it in your own code. The example keeps the scenes that start in the first half of the video:

results.sh
#!/usr/bin/env bash
#
# Gets the result of the analysis ANALYSIS_ID and keeps the scenes that start in the first half of the
# video, each with its id, title, type, start and end. The API has no filter: this happens here.
set -euo pipefail
base="${MEDIASEER_API_URL:?the API origin, without /api/v1}"
base="${base%/}/api/v1"
: "${MEDIASEER_API_KEY:?your API key}"
id="${ANALYSIS_ID:?the id of a finished analysis}"
api() { curl -q -sS -H @- "$@" <<<"X-Api-Key: $MEDIASEER_API_KEY"; }
tmp="$(mktemp -d)"
trap 'rm -rf "$tmp"' EXIT
status="$(api -o "$tmp/results.json" -w '%{http_code}' "$base/vod-analysis/$id/results")" || {
echo "results got no answer: curl exit $?" >&2
exit 1
}
if [[ "$status" != 200 ]]; then
echo "results answered $status $(jq -r '.code // empty' "$tmp/results.json" 2>/dev/null || true)" >&2
exit 1
fi
# A field without a value is left out, never null, so a scene can lack a start. Without the video's
# duration, every scene with a start is kept.
jq '.analysis
| (if .duration then .duration / 2 else infinite end) as $half
| [.scenes[]
| select(.startInSeconds != null and .startInSeconds < $half)
| {id, title, type, startInSeconds, endInSeconds}
| with_entries(select(.value != null))]' "$tmp/results.json"

Other filters work the same way over analysis.scenes, for example select(.type == "ADS") for the scenes the analysis took for advertisements. A field without a value is left out, not sent as null, so a filter has to allow for missing fields. The result doesn’t change once the analysis is FINISHED: read it once and keep it.

Translated results are not available; see result format.