Skip to main content
POST
/
patients
/
{patient_id}
/
variables
/
{variable_id}
/
scrape
cURL
curl --request POST \
  --url https://backend.claros.health/patients/{patient_id}/variables/{variable_id}/scrape \
  --header 'X-API-Key: <api-key>'
{
  "id": 123,
  "name": "<string>",
  "value": "<string>",
  "note": "<string>",
  "pdf_page": 123,
  "highlight": {
    "x1": 123,
    "y1": 123,
    "x2": 123,
    "y2": 123
  }
}
This endpoint requires authentication. Include your API key in the request headers as X-API-Key.

Description

Attempts to extract a variable value from the patient’s PDF document. This endpoint uses AI-powered extraction to find and extract the value of a specific variable from the patient’s uploaded PDF.

Path Parameters

patient_id
integer
required
The ID of the patient whose PDF will be analyzed
variable_id
integer
required
The ID of the variable to extract from the PDF

Response

id
integer
The unique identifier of the patient variable
name
string
The name of the variable
value
string
The extracted value of the variable
note
string
Any additional notes about the extracted value
pdf_page
integer
The page number in the PDF where the value was found
highlight
object
The coordinates of the highlight in the PDF where the value was found

Example Response

{
  "id": 1,
  "name": "Systolic Blood Pressure",
  "value": "120",
  "note": "Extracted from visit notes",
  "pdf_page": 2,
  "highlight": {
    "x1": 100,
    "y1": 200,
    "x2": 300,
    "y2": 250
  }
}

Error Responses

400
object
Invalid request or extraction failed. The response will include an error message explaining what went wrong.
401
object
Authentication required. Make sure you’ve included a valid API key in the request headers.
404
object
Patient or variable not found. The specified patient ID or variable ID does not exist.

Notes

  • The patient must have a PDF document uploaded before using this endpoint
  • The extraction process may take a few seconds to complete
  • The accuracy of extraction depends on the quality and format of the PDF document
  • If multiple values are found, the most recent or most relevant value will be returned

Authorizations

X-API-Key
string
header
required

Path Parameters

patient_id
integer
required

ID of the patient

variable_id
integer
required

ID of the variable

Response

Variable value extracted successfully

id
integer
name
string
value
string
note
string | null
pdf_page
integer | null
highlight
object