🦷 Dental SOAP API

Transform audio recordings into structured SOAP medical notes

Overview

The Dental SOAP API processes audio recordings from dental consultations and returns structured SOAP (Subjective, Objective, Assessment, Planning) notes along with transcription and optional dentist evaluation.

Base URL: https://dentalaidavid.ftp.sh/api/v1

Authentication

All API requests require authentication using an API key. Include your API key in the request header:

X-API-Key: dsk_your_api_key_here
Keep your API key secure! Never expose it in client-side code or public repositories.

Endpoints

POST /soap

Process audio and generate SOAP notes

Headers

Name Value Required
X-API-Key Your API key Required
Content-Type multipart/form-data Required

Request Body

Field Type Description
audio File Audio file (WAV, MP3, WebM, OGG, FLAC, M4A). Max 20MB.

Example Request (cURL)

curl -X POST https://dentalaidavid.ftp.sh/api/v1/soap \
  -H "X-API-Key: dsk_your_api_key" \
  -F "audio=@recording.wav"

Success Response (200)

{
  "success": true,
  "data": {
    "transcription": "Pasien mengeluh gigi belakang kanan bawah sakit sejak 3 hari...",
    "soap": {
      "subjective": "Pasien mengeluh nyeri pada gigi posterior kanan bawah...",
      "objective": "Gigi 46 tampak karies profunda...",
      "assessment": "Pulpitis irreversible gigi 46",
      "planning": "1. Perawatan saluran akar gigi 46..."
    },
    "dentist_evaluation": {
      "has_conversation": true,
      "score": 85,
      "comment": "Dokter menunjukkan empati yang baik...",
      "improvement": "Dapat lebih menjelaskan prosedur..."
    }
  },
  "usage": {
    "used_today": 5,
    "daily_limit": 100
  }
}

Error Responses

Code Error Description
401 UNAUTHORIZED Invalid or missing API key
400 INVALID_REQUEST No audio file or invalid format
400 FILE_TOO_LARGE Audio file exceeds 20MB
400 NO_SPEECH_DETECTED No speech or voice detected in the audio
429 RATE_LIMIT Daily limit exceeded
500 PROCESSING_ERROR Failed to process audio

GET /usage

Check your API usage statistics

Headers

Name Value Required
X-API-Key Your API key Required

Example Request

curl -X GET https://dentalaidavid.ftp.sh/api/v1/usage.php \
  -H "X-API-Key: dsk_your_api_key"

Success Response (200)

{
  "success": true,
  "data": {
    "plan": "unlimited",
    "daily_limit": "unlimited",
    "usage": {
      "requests_today": 5,
      "requests_this_month": 42,
      "requests_total": 150,
      "minutes_today": 12.5,
      "minutes_this_month": 95.3,
      "minutes_total": 320.8
    }
  }
}

Code Examples

Python

import requests

url = "https://dentalaidavid.ftp.sh/api/v1/soap"
headers = {"X-API-Key": "dsk_your_api_key"}

with open("recording.wav", "rb") as audio_file:
    response = requests.post(url, headers=headers, files={"audio": audio_file})
    
data = response.json()
print(data["data"]["soap"]["subjective"])

JavaScript (Node.js)

const FormData = require('form-data');
const fs = require('fs');
const axios = require('axios');

const form = new FormData();
form.append('audio', fs.createReadStream('recording.wav'));

const response = await axios.post('https://dentalaidavid.ftp.sh/api/v1/soap', form, {
    headers: {
        'X-API-Key': 'dsk_your_api_key',
        ...form.getHeaders()
    }
});

console.log(response.data.data.soap);

PHP

$ch = curl_init('https://dentalaidavid.ftp.sh/api/v1/soap');

curl_setopt_array($ch, [
    CURLOPT_POST => true,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => ['X-API-Key: dsk_your_api_key'],
    CURLOPT_POSTFIELDS => ['audio' => new CURLFile('recording.wav')]
]);

$response = curl_exec($ch);
$data = json_decode($response, true);

echo $data['data']['soap']['subjective'];

JavaScript SDK (Recommended)

The easiest way to integrate - just add our SDK and your users can record directly from your website!

Benefits: No audio file handling needed. Users click record, speak, and get SOAP notes automatically.

Quick Start (3 lines of code!)

<!-- 1. Add the SDK -->
<script src="https://dentalaidavid.ftp.sh/sdk/dental-soap.js"></script>

<!-- 2. Add a button -->
<button id="recordBtn">🎤 Record SOAP</button>

<!-- 3. Initialize -->
<script>
DentalSOAP.init({
    apiKey: 'dsk_your_api_key',
    buttonId: 'recordBtn',
    onSuccess: function(data) {
        console.log('SOAP:', data.data.soap);
        console.log('Transcription:', data.data.transcription);
    },
    onError: function(error) {
        alert('Error: ' + error.message);
    }
});
</script>

Complete Widget (Auto-renders UI)

Let the SDK create the entire UI for you:

<div id="soap-widget"></div>

<script src="https://dentalaidavid.ftp.sh/sdk/dental-soap.js"></script>
<script>
DentalSOAP.init({ apiKey: 'dsk_your_api_key' });
DentalSOAP.createWidget('soap-widget');
</script>

SDK Options

Option Type Description
apiKey string Required Your API key
buttonId string ID of button to bind for recording
onSuccess function Callback when SOAP is generated successfully
onError function Callback when an error occurs
onRecordStart function Callback when recording starts
onRecordStop function Callback when recording stops
onProcessing function Callback when audio is being processed

Response Data Structure

{
  "success": true,
  "data": {
    "transcription": "Full transcription text...",
    "soap": {
      "subjective": "...",
      "objective": "...",
      "assessment": "...",
      "planning": "..."
    },
    "dentist_evaluation": {
      "has_conversation": true,
      "score": 85,
      "comment": "...",
      "improvement": "..."
    }
  }
}

Support

For questions or issues, contact us at daveldede@gmail.com