Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

Queries

Focus mode
Queries - Amazon Textract

When provided a query, Amazon Textract provides a specialized response object. This object repeats the question back to the user along with the alias for the question. It then provides the confidence Amazon Textract has with the answer, a location of the answer on the page, and the text answer to the question. If no answer is found, this response element is kept blank.

Detected queries are returned as Block objects in the responses from AnalyzeDocument and GetDocumentAnalysis. You can use the FeatureTypes input parameter to retrieve information about key-value pairs, tables, or Queries. For general information about how a document is represented by Block objects, see Text Detection and Document Analysis Response Objects.

The following shows a diagram of how a query response is represented in Block objects.

Diagram showing a query and two responses flowing from a page, with one response redirecting to an answer.

Following is an example for a query response as part of a full response of document analysis.

{ "BlockType": "QUERY", "Id": "77cfbd28-168a-40fc-9c8a-863ba3066bd2", "Relationships": [ { "Type": "ANSWER", "Ids": [ "21396475-27ee-4da7-965b-f7631ef60fcc" ] } ], "Query": { "Text": "What is the patient first name?", "Alias": "PATIENT_FIRST_NAME" } }, { "BlockType": "QUERY_RESULT", "Confidence": 1.0, "Text": "ALEJANDRO", "Id": "21396475-27ee-4da7-965b-f7631ef60fcc" }

We have compiled a list of example queries for common documents in the Example Queries document.

PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.