I'd suggest DraftSight for this, as it's open-source, free and very well supported and documented, and has an install base in the millions.
https://www.3ds.com/products-services/draftsight-cad-software/
Caveat:
I'm no coder, I'm a tech writer/illustrator, draughter, graphic designer, 3D modeler and architectural designer, so I approach this from the power-user / designer viewpoint, I do not approach this question from the coder-how-do-I-plug-into-the-API-and-script-cool-stuff viewpoint.
I can tell you DraftSight reads and writes a range of industry-standard file formats, which do include .dwg .dxf etc, and I've just tested the .svg output and they come out perfectly on my setup on Mac OS.
I have no idea how well documented or public-facing the API is for DraftSight, but I know that there's a blogpost on the draftsigh blog by a dev team member on that topic:
http://blog.draftsight.com/2017/07/19/draftsight-api/
So hopefully this is enough info to get you started if indeed this is a good direction for you.
As a potential alternate, I can also tell you that OnShape is a rapidly-gaining-ground free-to-start, pay-to-make-big 3D engineering tool which is all in-browser based, and is wicked effective in its niche - no idea where to start on the dev side of that, but I know they've been shaking the pillars in the 3D engineering software world pretty loudly.
https://www.onshape.com/
Perhaps this will be of use if you like the look of onshape:
https://forum.onshape.com/discussions/tagged/api/p1