DEV Community

Karan Shah
Karan Shah

Posted on

I crammed 11 manufacturing calculators into one API in a day (Day 4 of 60)

Day 4 of building 60 commercial APIs in 60 days. Today's ship is the biggest one yet by endpoint count: Manufacturing Toolbox - eleven manufacturing calculators behind one key.

Why this one

Every print-shop SaaS, CNC quoting tool, and maker marketplace rebuilds the same calculators from scratch: STL volume to quote, G-code to print time, feeds & speeds tables, ISO fit lookups, tolerance stackups. None of it is hard, all of it is tedious, and the reference data lives in scattered PDFs and machinist forums.

So I bundled them:

  • STL to instant quote: volume (signed tetrahedra), surface area, mass, print time, cost breakdown, suggested price
  • STL printability check: watertight?, non-manifold edges, shells, thin-wall heuristic, 0-100 score
  • G-code analyzer: accurate time (reads PrusaSlicer/Cura/Bambu/Orca estimates), filament grams, cost, per-feature time split
  • CNC cost estimate with batch curves
  • Feeds & speeds: RPM, chip load, feed, depth-of-cut ranges
  • ISO 286 fits: /v1/cnc/fits/25/H7g6 gives hole +21/0 um, shaft -7/-20 um, clearance fit (computed from the ISO formulas, matches the handbook)
  • Thread specs: tap drill, stress area, tightening torque by bolt class
  • Tolerance stackups: worst-case + RSS with contributor ranking
  • Injection molding + PCB estimates
  • Materials DB: 60+ alloys/steels/plastics

The two design decisions that mattered

1. Caller-configurable economics. A quote API is useless if it assumes MY machine rate. Every dollar figure ($/kg, $/kWh, machine rate, margin) can be overridden per request, and the response echoes an assumptions block so integrators can display exactly what was used.

2. Honest accuracy labels. The STL quote is +/-20% heuristic - the response says so and points you at the G-code endpoint, which uses the slicer's own embedded time estimate when present. CNC/molding/PCB return ranges, not fake precision.

Stack

Same as Days 2-3: one Supabase Edge Function (Deno, TypeScript, zero npm dependencies - the STL parser, G-code parser and ISO 286 math are all hand-rolled), stateless, nothing stored. Deployed and sold through RapidAPI.

Free tier: 100 requests/month. Pro $19, higher tiers with overages.

Try it on RapidAPI


This is Day 4 of "60 APIs in 60 Days" - building commercial APIs in public. Day 1 was federal contract intel, Day 2 email+phone validation, Day 3 backend plumbing for vibe-coded apps. Follow along if you want the wins AND the faceplants.

Top comments (0)