The CADLens REST API accepts DWG files (AutoCAD R14 through 2025) and returns a complete, machine-readable description of the drawing: entity geometry, layer metadata, drawing extents, and a PNG preview. No AutoCAD license, no ODA setup, no conversion pipeline to maintain.
DWG is AutoCAD's native binary format and has never been publicly documented by Autodesk. Every version of the format — R14, 2000, 2004, 2007, 2010, 2013, 2018, 2021, 2024, 2025 — uses a different binary structure. Building reliable DWG parsing means either licensing a commercial SDK or maintaining a reverse-engineered reader against a moving target.
CADLens handles this for you. Submit a DWG file; receive clean JSON. The conversion and parsing infrastructure runs on our end.
Common use cases for DWG parsing via the API:
Authentication is an API key in the Authorization: Bearer header. The base URL is https://api.cadlens.co/v1.
Step 1 — Upload the DWG file:
POST /v1/parse
Content-Type: multipart/form-data
Authorization: Bearer <api_key>
file=<your-drawing.dwg>
// Response
{ "jobId": "job_01hw..." }Add wait=true as a query parameter for files under roughly 2 MB to receive the full result in the same response. For larger files, the job is queued and typically completes within 30 seconds on standard plans.
Step 2 — Poll for completion (or use a webhook):
GET /v1/jobs/job_01hw...
Authorization: Bearer <api_key>
// Response
{
"jobId": "job_01hw...",
"status": "COMPLETED", // PENDING | PROCESSING | COMPLETED | FAILED
"fileName": "floor-plan.dwg",
"fileSize": 284521,
"createdAt": "2024-10-14T09:12:00Z",
"completedAt": "2024-10-14T09:12:08Z"
}Pass webhook_url in the initial upload to receive a POST callback when the job completes — no polling required.
Step 3 — Fetch the result:
GET /v1/jobs/job_01hw.../result Authorization: Bearer <api_key>
The result schema is versioned at 2024-01. Every field below is present for a successful DWG parse:
{
"jobId": "job_01hw...",
"status": "COMPLETED",
"metadata": {
"units": "mm",
"boundingBox": { "width": 4200, "height": 2970 }
},
"layersJson": [
{ "name": "WALLS", "colorHex": "#ffffff", "entityCount": 142 },
{ "name": "DIMENSIONS", "colorHex": "#00ff00", "entityCount": 38 },
{ "name": "TEXT", "colorHex": "#ff0000", "entityCount": 21 }
],
"vectorJson": [
{
"type": "POLYLINE",
"layer": "WALLS",
"closed": true,
"vertices": [
{ "x": 0, "y": 0 },
{ "x": 4200, "y": 0 },
{ "x": 4200, "y": 2970 },
{ "x": 0, "y": 2970 }
]
}
],
"imageUrl": "https://cdn.cadlens.co/results/job_01hw.../preview.png?..."
}DWG is the most complex format CADLens supports. A few constraints apply:
Free tier includes 50 parse requests per month. No credit card required.