# Best Shot

The "Best shot" algorithm is intended to choose the most high-quality and well-tuned frame with a face from a video record. This algorithm works as a part of the [liveness](https://doc.ozforensics.com/oz-knowledge/guides/developer-guide/api/oz-api/basic-scenarios/liveness) analysis, so here, we describe only the best shot part.

{% hint style="info" %}
Please note: historically, some instances are configured to allow Best Shot only for certain gestures.
{% endhint %}

### Processing steps

1\. Initiate the analysis similar to [Liveness](https://doc.ozforensics.com/oz-knowledge/guides/developer-guide/api/oz-api/basic-scenarios/liveness/..#processing-steps), but make sure that `extract_best_shot` is set to `true` as shown below:&#x20;

{% code title="request body" %}

```javascript
{
  "analyses": [{
    "type": "quality",
    "source_media": ["1111aaaa-11aa-11aa-11aa-111111aaaaaa"], // // optional; omit to include all media from the folder
    "params" : {
      "extract_best_shot": true // the mandatory part for the best shot analysis
    }
  }]
}
```

{% endcode %}

If you want to use a webhook for response, add it to the payload at this step, as described [here](https://doc.ozforensics.com/oz-knowledge/guides/developer-guide/api/oz-api/use-cases/using-a-webhook-to-get-results).

2\. Check and interpret results in the same way as for the pure [Liveness](https://doc.ozforensics.com/oz-knowledge/guides/developer-guide/api/oz-api/basic-scenarios/liveness/..#processing-steps) analysis.

3\. The URL to the best shot is located in the `results_media -> output_images -> original_url` response.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://doc.ozforensics.com/oz-knowledge/guides/developer-guide/api/oz-api/basic-scenarios/liveness/best-shot.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
