Most CAD preview tools return an image. CADLens returns the image and the structured vector data behind it. Upload a DWG, DXF, or DWF file; receive a signed PNG preview URL and a complete machine-readable description of every entity in the drawing. One call, one result, no second parsing pass.
Standalone CAD preview generators — browser viewers, thumbnail services, raster converters — solve one problem: showing a person what a drawing looks like. They do not expose the underlying vector geometry, layer names, or entity data. If you need both a visual and the machine-readable data, you end up calling two separate services or running two separate parsing passes.
CADLens eliminates that duplication. The parse that produces the PNG is the same parse that produces the JSON. You get both outputs from a single upload with no additional cost or latency.
Any product that lets users upload CAD files needs at minimum a preview. Most also need the data. Common scenarios where both matter at once:
Authentication is an API key in the Authorization: Bearer header. The base URL is https://api.cadlens.co/v1.
Step 1 — Upload the CAD file:
POST /v1/parse
Content-Type: multipart/form-data
Authorization: Bearer <api_key>
file=<your-drawing.dwg> // or .dxf or .dwf
// Response
{ "jobId": "job_04rt..." }For files under roughly 2 MB, pass ?wait=true for a synchronous response containing the full result including imageUrl. For larger files, the job is queued; pass a webhook_url field to receive a callback when both the PNG and JSON are ready.
Step 2 — Poll for completion:
GET /v1/jobs/job_04rt...
Authorization: Bearer <api_key>
// Response
{
"jobId": "job_04rt...",
"status": "COMPLETED", // PENDING | PROCESSING | COMPLETED | FAILED
"fileName": "enclosure.dwg",
"fileSize": 127400,
"createdAt": "2024-10-14T16:30:00Z",
"completedAt": "2024-10-14T16:30:11Z"
}Step 3 — Retrieve the preview image:
GET /v1/jobs/job_04rt.../image Authorization: Bearer <api_key> // Response: signed URL included directly in the result JSON
Step 3b — Retrieve the vector data (same result endpoint):
GET /v1/jobs/job_04rt.../result Authorization: Bearer <api_key>
The imageUrl field and the vector fields (vectorJson, layersJson, metadata) are all present in the same result. Schema version 2024-01:
{
"jobId": "job_04rt...",
"status": "COMPLETED",
"metadata": {
"units": "mm",
"boundingBox": { "width": 300, "height": 200 }
},
"layersJson": [
{ "name": "BODY", "colorHex": "#ffffff", "entityCount": 12 },
{ "name": "CUTOUTS", "colorHex": "#00bfff", "entityCount": 6 },
{ "name": "TEXT", "colorHex": "#ff0000", "entityCount": 4 }
],
"vectorJson": [
{
"type": "POLYLINE",
"layer": "BODY",
"closed": true,
"vertices": [
{ "x": 0, "y": 0 },
{ "x": 300, "y": 0 },
{ "x": 300, "y": 200 },
{ "x": 0, "y": 200 }
]
},
{
"type": "CIRCLE",
"layer": "CUTOUTS",
"center": { "x": 15, "y": 15 },
"radius": 4
}
],
"imageUrl": "https://cdn.cadlens.co/results/job_04rt.../preview.png?Expires=..."
}The imageUrl is a time-limited signed URL. Download and store the image in your own storage if you need it long-term.
imageUrl is time-limited. Download to your own storage for permanent access.Free tier includes 50 parse requests per month. No credit card required.