Use Case Guide · CAD File Preview API

CAD preview and vector data — both, in one API call.

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.

Join the beta · Free 50/mo →Read the docs
01THE PROBLEM

Preview tools stop at the picture.

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.

02WHEN TO USE IT

Built for product teams managing CAD uploads.

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:

  • File management portals — show a thumbnail in the file browser and simultaneously index geometry for search or analysis, from a single upload event.
  • Quoting tools — display the drawing to the user for visual confirmation while extracting polyline lengths and arc counts for automated pricing in the same request.
  • Document review platforms — render a PNG for annotation or markup tools while storing the vector JSON for programmatic diff or compliance checks.
  • Marketplaces and catalogs — generate a product thumbnail from the DWG and extract metadata for search indexing in one API round trip.
  • Mobile and web apps — serve a raster image to the front end for immediate display while storing the JSON for later processing, without separate infrastructure for each.
03API WORKFLOW

One upload, two outputs.

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>
04EXAMPLE OUTPUT

Both outputs, one result.

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.

05LIMITATIONS

Fair-use and known constraints.

  • File size: approximately 10 MB per file on standard plans.
  • Entity count: up to approximately 50,000 entities per drawing.
  • Processing time: up to 30 seconds on standard plans; rendering adds minimal overhead on top of parsing.
  • Signed URL expiry: the imageUrl is time-limited. Download to your own storage for permanent access.
  • Render resolution: the PNG output is sized relative to drawing extents; very large drawings may produce proportionally large images.
  • 3D drawings: CADLens renders a 2D projection; full 3D viewport rendering is not currently supported.
06 — FAQ

Common questions.

CADLens returns both. Every successful parse produces a signed PNG URL (imageUrl) and the full vector JSON (vectorJson, layersJson, metadata). You do not need to choose between a preview and structured data — you get both from the same API call.

DWG (R14–2025), DXF (R12–2025), and DWF are stable and production-ready. PDF (vector), DWFx, and DGN V7 are available in beta.

CADLens renders the parsed vector geometry using a server-side canvas renderer. The output is a raster PNG image of the model space content, delivered as a time-limited signed URL hosted on our CDN.

Signed image URLs are time-limited. The exact duration is shown in the API response. For long-term storage, download the image to your own storage and serve it from there.

There is no preview-only mode. The CADLens API always parses the full file. For use cases that only need a thumbnail, you can ignore the vectorJson field in the response — you will still be billed the same amount.

The PNG is rendered at a resolution suitable for thumbnail display. Exact dimensions depend on the drawing extents. For production display at larger sizes, rendering at higher resolution is on the roadmap. Refer to the docs for the current output specification.

No. Only successful parses count toward your monthly quota. A job that ends in FAILED status — including rendering failures — is never billed.

JOIN THE BETA

Get an API key. Parse your first drawing today.

Free tier includes 50 parse requests per month. No credit card required.

Join the beta · Free 50/mo Read the docs
— RELATED

Keep reading.