Multiple5 min4 steps
Generate Visit Summaries
Consolidate a patient’s visit history into a comprehensive summary for referrals, pre-visit prep, or patient timelines.
1
Structure your visit history
The visit summary endpoint accepts an array of past visit objects. Each visit includes the date, provider, and either a structured SOAP note or a free-text summary. Notes are not stored past the configured expiry, so you provide the visit data directly.
JSON
# Visit history array structure
[
{
"visit_date": "2026-01-15",
"provider": "Dr. Sarah Chen",
"summary": "Annual wellness visit. A1C 6.8%, well controlled on metformin. Renewed prescriptions. Referred for annual eye exam."
},
{
"visit_date": "2026-02-20",
"provider": "Dr. Sarah Chen",
"soap_note": {
"assessment": "E11.65 Type 2 DM with hyperglycemia. I10 Essential hypertension.",
"plan": "Started lisinopril 10mg daily. Diet counseling provided."
}
},
{
"visit_date": "2026-03-18",
"provider": "Dr. James Park",
"summary": "Urgent visit for persistent cough x 10 days. Chest X-ray clear. Diagnosed acute bronchitis. Prescribed benzonatate and albuterol inhaler PRN."
}
]2
Request a visit summary
Send a POST request to
/v1/visit-summary with the visits array. You can optionally specify the focus field to tailor the summary for a specific clinical area.Python
import os
import requests
api_key = os.environ["SOAPNOTEAPI_KEY"]
visits = [
{
"visit_date": "2026-01-15",
"provider": "Dr. Sarah Chen",
"summary": "Annual wellness visit. A1C 6.8%, well controlled on metformin. Renewed prescriptions. Referred for annual eye exam.",
},
{
"visit_date": "2026-02-20",
"provider": "Dr. Sarah Chen",
"soap_note": {
"assessment": "E11.65 Type 2 DM with hyperglycemia. I10 Essential hypertension.",
"plan": "Started lisinopril 10mg daily. Diet counseling provided.",
},
},
{
"visit_date": "2026-03-18",
"provider": "Dr. James Park",
"summary": "Urgent visit for persistent cough x 10 days. CXR clear. Dx acute bronchitis. Rx benzonatate and albuterol PRN.",
},
]
response = requests.post(
"https://api.soapnoteapi.com/v1/visit-summary",
headers={
"Authorization": f"Bearer {api_key}",
"Content-Type": "application/json",
},
json={
"visits": visits,
"focus": "diabetes management",
},
)
result = response.json()
print(result["summary"])3
Parse the summary response
The response includes a consolidated narrative summary, an active problems list, current medications, and a timeline of key events.
JSON
# Visit summary response
{
"summary": "62-year-old female with type 2 diabetes (A1C 6.8%) on metformin, newly diagnosed hypertension on lisinopril, and recent acute bronchitis (resolved). Diabetes well controlled per January labs. Blood pressure management initiated in February with lisinopril 10mg. Most recent visit in March was for acute bronchitis, treated symptomatically.",
"key_findings": [
"A1C 6.8% — diabetes well controlled on metformin",
"Hypertension newly diagnosed, started lisinopril 10mg",
"Acute bronchitis (resolved) — treated symptomatically"
],
"active_diagnoses": [
{ "code": "E11.65", "description": "Type 2 DM with hyperglycemia" },
{ "code": "I10", "description": "Essential hypertension" }
]
}4
Use cases
Visit summaries work well for several clinical workflows: Referral letters to give specialists a concise patient history. Pre-visit prep so providers can review a patient before their appointment. Patient timelines for care coordination across multiple providers. Care gap analysis to identify overdue screenings or follow-ups.
JavaScript
// Node.js: Generate a referral-oriented summary
const response = await fetch("https://api.soapnoteapi.com/v1/visit-summary", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.SOAPNOTEAPI_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
focus: "diabetes management",
visits: [
{
visit_date: "2026-01-15",
provider: "Dr. Sarah Chen",
summary: "Annual wellness visit. A1C 6.8%, well controlled on metformin.",
},
{
visit_date: "2026-02-20",
provider: "Dr. Sarah Chen",
soap_note: {
assessment: "E11.65 Type 2 DM with hyperglycemia. I10 Essential hypertension.",
plan: "Started lisinopril 10mg daily. Diet counseling provided.",
},
},
],
}),
});
const result = await response.json();
console.log("Summary:", result.summary);
console.log("Key findings:", result.key_findings);
console.log("Active diagnoses:", result.active_diagnoses);Ready to start building?
Get a free API key and $10 in credit — no credit card required.
Get your free API keyNext steps
Python5 min
Generate a SOAP Note with Python
Install the requests library, send a transcript, and receive a structured SOAP note in five minutes.
Node.js5 min
Generate a SOAP Note with Node.js
Use the built-in fetch API to generate a structured SOAP note with zero dependencies.
Multiple5 min
Add Billing Codes to SOAP Notes
Include ICD-10 and CPT codes alongside your SOAP note to streamline clinical billing workflows.