Skip to main content
This guide walks through the complete analysis lifecycle: uploading a video, monitoring progress, and retrieving different levels of result data.

Video requirements

Before uploading, make sure your video meets these constraints:
ConstraintLimit
File size30 MB maximum
Duration10 seconds maximum
FormatMP4, MOV, AVI
Record at 30 fps or higher for best results. The runner should be clearly visible and occupy a significant portion of the frame.

Analysis types

Choose the analysis type based on the camera position:
Camera is positioned to the side of the runner. Set analysis_type=side_view.Produces:
  • Overall biomechanical score (0 — 1)
  • Running metrics: speed, step length, cadence, ground contact time, time of flight, duty factor
  • Overstride analysis with angle and score
  • Foot landing classification per step (rearfoot, midfoot, forefoot)
  • Joint angles: ankle, knee, hip, shoulder, elbow
  • Running style classification with confidence percentage

Parameters

ParameterTypeRequiredDefaultDescription
videofileYesVideo file to analyze
analysis_typestringYesside_viewside_view or back_view
heightnumberNo170Runner height in centimeters
weightnumberNo70Runner weight in kilograms
pacestringConditionalRunning pace MM:SS. Required when treadmill=true. Auto-calculated for overground running.
languagestringNoenResult language: en, fr, de, zh, ko, pt, es, it, ja
treadmillbooleanNofalseWhether the runner is on a treadmill
full_bodybooleanNotrueFull body analysis (back view only). Set false for pronation only.

Lifecycle

Status progression

StatusHTTP codeMeaning
pending200Analysis is queued, waiting for a processing slot.
analyzing202Processing is underway. The percentage field shows progress.
success200Analysis is complete. Full results are available.
failed400Analysis could not be completed. No results available.

Polling strategy

Poll the results endpoint every 3 — 5 seconds. Most analyses complete within 10 — 30 seconds depending on video length and server load.
import time
import requests

def wait_for_analysis(video_id: str, api_key: str, interval: float = 3.0) -> dict:
    """Poll until analysis completes or fails."""
    url = f"https://api.ochy.com/analysis/{video_id}/results"
    while True:
        response = requests.get(url, params={"apiKey": api_key})
        data = response.json()

        if data["status"] in ("success", "failed"):
            return data

        time.sleep(interval)

Result levels

Once the status is success, you can access three levels of data:
The results endpoint returns everything in a single call: status, signed URLs (thumbnail and annotated video), and the biomechanical_analysis object containing scores, metrics, and classifications.Use this when you need a complete snapshot of the analysis.
Structured numerical metrics without media URLs. Ideal when you need to process or display specific values.Side view includes: metrics, overstride, foot_landing, joint_angles, running_styles, and total_score.Back view includes: gait_cycle with stance means per leg (pronation, hip adduction, knee adduction, pelvic drop) and step-by-step data.
Frame-by-frame position data for every anatomical landmark detected. Includes video_input_information (resolution, FPS, duration) and a frames object keyed by frame number.Use this for custom visualizations, overlays, or your own biomechanical models.

Error handling

Common errors during the analysis workflow:
ErrorCodeStatusWhen
File too largefile_too_large413Video exceeds 30 MB
Video too long400Video exceeds 10 seconds
Invalid file typeinvalid_file_type400Unsupported extension
Not completed400Requesting calculated/raw data before success
Insufficient creditsinsufficient_credits402No credits remaining
Not found404Invalid analysis_id