
How I Built an API That Turns Messy Text Into Clean JSON (and You Can Use It Free)
Every developer has dealt with messy unstructured text. Receipts, emails, resumes — they all contain structured data trapped in plain text. Regex is brittle. Manual parsing is tedious. I built StructureAI to solve this. One API call, any text in, clean JSON out. The Problem You get text like this: Receipt from Whole Foods 03/15/2024 Apples $3.99 Milk $5.49 Bread $4.29 Tax $1.18 Total: $14.95 Card ending 4242 You need this: { "merchant" : "Whole Foods" , "date" : "2024-03-15" , "items" : [ { "name" : "Apples" , "price" : 3.99 }, { "name" : "Milk" , "price" : 5.49 }, { "name" : "Bread" , "price" : 4.29 } ], "tax" : 1.18 , "total" : 14.95 , "payment_method" : "Card ending 4242" } Regex won't cut it. The format varies every time. The Solution: One API Call curl -X POST https://api-service-wine.vercel.app/api/extract \ -H "Content-Type: application/json" \ -H "X-API-Key: YOUR_KEY" \ -d '{ "text": "Receipt from Whole Foods 03/15/2024...", "schema": "receipt" }' That's it. The API returns str
Continue reading on Dev.to Tutorial
Opens in a new tab




