Skip to main content
POST
/
api
/
v2
/
documents
/
extract
Python
import os
from samplehc import SampleHealthcare

client = SampleHealthcare(
    api_key=os.environ.get("SAMPLEHC_API_KEY"),  # This is the default and can be omitted
)
response = client.v2.documents.extract(
    documents=[{
        "id": "id",
        "file_name": "fileName",
    }],
    prompt="prompt",
    response_json_schema={
        "foo": "bar"
    },
)
print(response.async_result_id)
{
  "asyncResultId": "<string>"
}

Body

application/json
documents
object[]
required

An array of documents to extract data from.

responseJsonSchema
object
required

A JSON schema defining the structure of the desired extraction output.

prompt
string
required

A prompt guiding the extraction process.

reasoningEffort
enum<string>

Optional control over the reasoning effort for extraction.

Available options:
low,
medium,
high
model
enum<string>
default:reasoning-3-mini

The model to use for extraction.

Available options:
reasoning-3-mini,
reasoning-3,
base-5,
base-5-mini,
base-5-nano
priority
enum<string>
default:interactive

The priority of the extraction task. Non-interactive is lower priority.

Available options:
interactive,
non-interactive
ocrEnhance
object

OCR enhancement configuration for figure and text analysis.

Response

Accepted. Advanced extraction process initiated.

Accepted. Advanced extraction process initiated.

asyncResultId
string
required

The ID to track the asynchronous extraction task.