Image scan (async)
Macrofy supports photo-based logging via an async scan pipeline.
1) Create a scan job
POST /scan/image
Request body:
{
"clientId": "my-app",
"contentType": "image/jpeg"
}
Response:
{
"jobId": "scan_abc123",
"uploadUrl": "https://storage.googleapis.com/..."
}
2) Upload the image
Upload the raw bytes to uploadUrl with a PUT request. (The SDK handles this for you.)
3) Poll status
GET /scan/image/:jobId
Processing:
{ "status": "processing" }
Complete:
{
"status": "complete",
"result": {
"items": [
{
"name": "Chicken bowl",
"serving": { "amount": 1, "unit": "bowl" },
"macros": { "calories": 540, "protein": 42, "carbs": 55, "fat": 18 }
}
]
}
}