Cadlens is a developer API for parsing CAD files such as DWG, DXF, and DWF into preview images, structured JSON, layer metadata, and vector entities — without installing AutoCAD or any desktop software.
- Website: cadlens.co
- API Docs: cadlens.co/docs
- Pricing: cadlens.co/pricing
- Dashboard: cadlens.co/dashboard
- CAD file preview inside your web app — CAD file preview API
- DWG/DXF to structured JSON extraction — DWG to JSON API
- Layer and entity inspection for automation workflows
- AI-assisted CAD interpretation with LLMs
- Webhook-based async CAD processing pipelines
- Sign up at cadlens.co and create an account
- Go to the dashboard and generate an API key (starts with
cadl_) - Export your key:
export CADLENS_API_KEY=cadl_your_key_here
| File | Description |
|---|---|
examples/upload.sh |
Upload a CAD file, poll for completion, retrieve result |
examples/webhook.sh |
Upload with a webhook URL and example webhook payload |
examples/node.js |
Node.js upload using native fetch |
examples/python.py |
Python upload using requests |
- Upload — POST a CAD file to
/v1/parse; receive ajob_id - Poll — GET
/v1/jobs/:job_iduntilstatusisCOMPLETEDorFAILED - Retrieve — GET
/v1/jobs/:job_id/resultfor vector JSON, layers, and metadata - Preview — GET
/v1/jobs/:job_id/imagefor a presigned PNG preview URL
DWG · DXF · DWF · DWFx · DGN · PDF
Job status response (GET /v1/jobs/:job_id):
{
"id": "job_lH9k2c",
"status": "COMPLETED",
"fileName": "drawing.dwg",
"fileSize": 2048576,
"createdAt": "2026-05-15T12:00:00.000Z",
"completedAt": "2026-05-15T12:01:30.000Z",
"imageUrl": "https://s3.amazonaws.com/..."
}Result response (GET /v1/jobs/:job_id/result):
{
"schemaVersion": "2.0.0",
"parserVersion": "2.0.0",
"jobId": "job_lH9k2c",
"status": "COMPLETED",
"file": { "name": "drawing.dwg", "format": "DWG", "version": "AC1021", "units": "mm" },
"summary": {
"totalSheets": 1, "totalEntities": 142, "totalLayers": 8,
"statistics": {
"byType": { "LINE": 98, "TEXT": 30, "INSERT": 14 },
"byCategory": { "Geometry": 98, "Annotation": 30, "BlockReference": 14 }
},
"truncated": false
},
"sheets": [
{
"name": "Model", "key": "model", "index": 0,
"imageUrl": "https://s3.amazonaws.com/.../preview-0.png?...",
"entityCount": 142, "layerCount": 8,
"layers": [{ "name": "0", "color": 7, "colorHex": "#FFFFFF", "isVisible": true, "entityCount": 20 }],
"entities": [
{
"id": "1A4", "handle": "1A4", "type": "LINE", "category": "Geometry",
"layer": "0", "layout": "Model",
"geometry": { "start": { "x": 0, "y": 0 }, "end": { "x": 100, "y": 100 } },
"text": null, "reference": null,
"properties": { "colorIndex": 7, "lineType": null, "lineweight": null, "visible": true, "solid": null, "patternName": null, "patternAngle": null, "patternScale": null },
"bbox": { "minX": 0, "minY": 0, "maxX": 100, "maxY": 100 },
"metrics": { "length": 141.421356, "area": null, "perimeter": null, "vertexCount": 2 }
}
]
}
],
"parseInfo": { "durationMs": 812, "warnings": [], "errors": [] },
"imageUrl": "https://s3.amazonaws.com/.../preview-0.png?...",
"imageUrls": ["https://s3.amazonaws.com/.../preview-0.png?..."]
}Entities use the Schema v2 envelope: spatial coordinates live under entity.geometry
(per-type fields, original precision), with sibling text (TEXT/MTEXT), reference
(INSERT block name), properties, and always-present computed bbox and metrics
(null values where not applicable).
When you supply a webhookUrl on upload, Cadlens POSTs this to your endpoint on completion:
{
"eventId": "550e8400-e29b-41d4-a716-446655440000",
"sequence": 1,
"event": "job.completed",
"jobId": "job_lH9k2c",
"status": "COMPLETED",
"timestamp": "2026-05-15T12:01:30.000Z",
"result": {
"schemaVersion": "2.0.0",
"imageUrl": "https://s3.amazonaws.com/...",
"imageUrls": ["https://s3.amazonaws.com/..."],
"file": { "name": "drawing.dwg", "format": "DWG", "version": "AC1021", "units": "mm" },
"summary": { "totalSheets": 1, "totalEntities": 142, "totalLayers": 8, "truncated": false },
"sheets": [ /* same structure as GET /result */ ]
}
}Webhook events: job.processing · job.completed · job.failed
Add these topics to this repo for discovery:
cad dwg dxf cad-parser dwg-parser cad-api engineering-api aec developer-tools construction-tech