# Gerber Viewer API: PCB Render (PNG, SVG) & Board Report (`jumblemog/gerber-pcb-renderer`) Actor

Turn Gerber and Excellon drill files into realistic PCB pictures (top and bottom, PNG and SVG) and a board report: size, copper layers, which file is which layer, drill table, narrowest trace and missing-file warnings. Reads KiCad, Eagle, Altium, EasyEDA, Fusion 360, OrCAD and more.

- **URL**: https://apify.com/jumblemog/gerber-pcb-renderer.md
- **Developed by:** [Jumble Mog](https://apify.com/jumblemog) (community)
- **Categories:** Developer tools, AI, Automation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Gerber Viewer API: PCB Render (PNG, SVG) & Board Report

**Turn a board's Gerber and drill files into realistic pictures of the PCB and a report of what a fab will ask about, from one ZIP link.** Send the ZIP you would upload to JLCPCB, PCBWay or OSH Park and you get back:

- **Pictures of the top and bottom** as PNG and SVG: copper, solder mask, silkscreen and holes drawn the way the made board looks, in the mask color and finish you pick (green, red, blue, black, white, yellow or purple; HASL, ENIG or bare copper).
- **Board size** in millimetres and inches, from the outline, and the area fabs price by.
- **The layer list**: which file was read as which layer (top copper, bottom mask, inner 2, outline, plated holes), and any file that wasn't recognized.
- **The drill table**: every hole size with its count, plated or not, slots, and the smallest and largest hole.
- **The narrowest copper line**, in mm and mil.
- **Warnings** before you order: no outline file, no drill file, a side without solder mask, lines under 5 mil, holes under 0.2 mm.

![The example board drawn by this Actor from its Gerber and drill files: top and bottom in green solder mask with HASL pads, then the top in blue and in matte black with gold ENIG pads, with white silkscreen labels and drilled holes](https://api.apify.com/v2/key-value-stores/Km5b4PG3kYHdZSb1E/records/gerber-pcb-renderer-example.png?signature=R1VqEmXnYPYfH9lMOoXW)

It reads the files KiCad, Eagle, Altium, EasyEDA, Fusion 360, OrCAD and Allegro, PADS, DipTrace, Fritzing, gEDA and pcb-rnd, P-CAD, Target 3001 and Siemens tools export.

It's made for:

- Hardware teams and makers who want a preview image and a sanity check of a Gerber ZIP in a build pipeline or pull request.
- PCB shops, quoting tools and marketplaces that need a board's size, layer count and drill table to price an upload.
- AI agents that design or order boards and need to see and check what they made.
- Documentation and product pages that need a clean picture of a board from its manufacturing files.

### How to use it

1. Add **Links to Gerber ZIPs**, one board per ZIP, or upload them. Write `example` to try the built-in board.
2. Optionally pick the **sides**, **picture formats**, **solder mask color** and **surface finish**.
3. Click **Start**. Each board is a row in the results, with its pictures, measurements and warnings.

#### What you can send

| You send | What happens |
|---|---|
| A link to a ZIP of Gerber and drill files | One board. Folders inside the ZIP are fine; documents, CAD sources and pictures in it are skipped |
| A GitHub folder link (`https://github.com/user/repo/tree/main/hardware/gerbers`) | That folder of the repository is read as one board |
| Google Drive or Dropbox share links, uploaded files | Read like any other link |
| Links to single files (`top.gtl`, `drill.drl`, ...) | All single files of a run are read together as one board |
| `example` | The built-in example: a 50 × 30 mm two-layer LED blinker |

### Examples

- `{"gerberUrls": ["example"]}` → "led-blinker: 50 × 30 mm (1.969 × 1.181 in), 2 copper layers, 24 holes in 4 sizes from 0.8 to 3.2 mm, narrowest copper line 0.3 mm (11.81 mil)." with PNG pictures of the top and bottom, 1600 pixels wide, and no warnings.
- `{"gerberUrls": ["example"], "maskColor": "blue", "finish": "enig", "outputs": ["png", "svg"]}` → the same board in blue with gold pads, as PNG and SVG.
- `{"gerberUrls": ["example"], "sides": "top", "imageWidth": 600}` → one 600 pixel picture of the top, a good size for a chat message or a pull request comment.

### How-to examples

The result lines are from runs of these inputs.

#### How to render Gerber files to a PNG image

```json
{"gerberUrls": ["https://example.com/my-board-gerbers.zip"]}
```

Put your own ZIP link in place of this one. With `example` as the link, the result is: "led-blinker: 50 × 30 mm (1.969 × 1.181 in), 2 copper layers, 24 holes in 4 sizes from 0.8 to 3.2 mm, narrowest copper line 0.3 mm (11.81 mil)." with `topImageUrl` and `bottomImageUrl`.

#### How to check a Gerber ZIP before ordering a PCB

```json
{"gerberUrls": ["example"], "sides": "top", "imageWidth": 600}
```

Result: `widthMm` 50, `heightMm` 30, `copperLayers` 2, a drill table of 8 holes of 0.8 mm, 10 of 0.9 mm and 2 of 1.0 mm (plated) and 4 of 3.2 mm (non-plated), `minTraceWidthMm` 0.3 and an empty `warnings` list. A ZIP without an outline or drill file, or with lines under 5 mil, says so in `warnings`.

#### How to preview a PCB in another solder mask color

```json
{"gerberUrls": ["example"], "maskColor": "blue", "finish": "enig", "outputs": ["png", "svg"]}
```

Result: the same board drawn with a blue mask and gold (ENIG) pads, as PNG and SVG for both sides.

#### How to let an AI agent look at a PCB

Add this Actor to the [Apify MCP server](https://mcp.apify.com) with `https://mcp.apify.com/?tools=jumblemog/gerber-pcb-renderer`. The agent passes the link to a Gerber ZIP and reads `summary`, `layers`, `drills` and `warnings`, and can open `topImageUrl` to see the board, instead of parsing Gerber text itself.

### FAQ

**Which files does it need?** The Gerber files (RS-274X or X2) and Excellon drill files your CAD program exports for manufacturing: copper, solder mask, silkscreen, outline and drill. Paste layers are read too. It doesn't read CAD project files such as `.kicad_pcb` or `.brd`.

**How does it know which file is which layer?** From the names each CAD program gives its files (`-F_Cu.gbr`, `.GTL`, `copper_top.gbr`, `Top.pho` and so on). The `layers` list shows the match for every file. If one is wrong or missing, name it yourself in `layerMap`, such as `{"cut.gbr": "outline"}`.

**Is this a design rule check?** No. It reports the size, layers, drill table and narrowest copper line and warns about missing files, but it doesn't measure clearances or annular rings or compare against a netlist. Run your CAD program's DRC and your fab's checker for those.

**Can I send several boards?** Yes, one ZIP per board, up to the **Maximum boards** setting. A ZIP that holds more than one board fails with a message that says so and isn't charged.

**Are inner layers drawn?** They're counted and listed, and the pictures show the top and bottom as you would see the finished board.

**Does it work with Zapier, Make or n8n?** Yes. Call the Actor with its Apify app or an HTTP request and pass the results on.

### Input

| Field | What it is |
|---|---|
| `gerberUrls` | Links to ZIP archives of Gerber and drill files, one board per ZIP, or `example` |
| `uploads` | ZIP archives or loose Gerber and drill files uploaded in the form |
| `sides` | `both` (default), `top` or `bottom` |
| `outputs` | `png` (default), `svg`, or both |
| `imageWidth` | Width of the PNG pictures in pixels (1600 by default, 200 to 6000) |
| `maskColor` | `green` (default), `red`, `blue`, `black`, `matte-black`, `white`, `yellow` or `purple` |
| `finish` | `hasl` (silver, default), `enig` (gold) or `bare-copper` |
| `silkColor` | `auto` (black on a white mask, else white), `white` or `black` |
| `layerMap` | File names mapped to layers, for names that aren't recognized |
| `maxBoards` | Stop after this many boards (50 by default) |
| `timeoutSecs` | Time limit per board (120 seconds by default) |

### Output

One dataset item per board. The first picture is also saved as the run's `OUTPUT` record:

```json
{
  "index": 1, "name": "led-blinker", "status": "ok",
  "summary": "led-blinker: 50 × 30 mm (1.969 × 1.181 in), 2 copper layers, 24 holes in 4 sizes from 0.8 to 3.2 mm, narrowest copper line 0.3 mm (11.81 mil).",
  "widthMm": 50.0, "heightMm": 30.0, "widthIn": 1.969, "heightIn": 1.181, "areaCm2": 15.0,
  "copperLayers": 2, "minTraceWidthMm": 0.3, "minTraceWidthMil": 11.81,
  "drills": {"holes": 24, "plated": 20, "nonPlated": 4, "slots": 0, "sizes": 4, "minDiameterMm": 0.8, "maxDiameterMm": 3.2,
             "table": [{"diameterMm": 0.8, "diameterIn": 0.0315, "count": 8, "plated": true}, "..."]},
  "layers": [{"file": "led-blinker-F_Cu.gbr", "side": "top", "type": "copper", "objects": 39}, "..."],
  "unrecognizedFiles": [], "warnings": [], "parserNotes": [],
  "topImageUrl": "https://api.apify.com/v2/key-value-stores/.../records/001-led-blinker-top.png",
  "bottomImageUrl": "https://api.apify.com/v2/key-value-stores/.../records/001-led-blinker-bottom.png",
  "topSvgUrl": null, "bottomSvgUrl": null, "maskColor": "green", "finish": "hasl", "sourceUrl": "example"
}
```

A board that can't be read has `"status": "failed"` and the reason in `error`, and isn't billed.

### How it works

1. **Download and unpack** each link; documents, CAD sources and pictures in a ZIP are skipped.
2. **Match files to layers** with [gerbonara](https://gerbonara.gitlab.io/gerbonara/), which knows the file names of the common CAD programs, then by short codes such as `GTL`, `SMT` or `ko` for names it doesn't know. A file that can't be parsed is left out and named in `parserNotes`.
3. **Measure**: the board size from the outline (the middle of its line), the holes of every drill file by size, and the narrowest line on the copper layers.
4. **Draw** each side as an SVG in board order (substrate, copper, solder mask, silkscreen, holes) and rasterize it with [resvg](https://github.com/linebender/resvg). The bottom is mirrored, as you see it turning the board over.

### Pricing

You pay one low price per board, at the price shown on this page, whatever sides and formats you pick. Boards that can't be read are never charged. If you set a maximum cost per run, the Actor stops before a board that wouldn't fit.

### Speed

A small two-layer board takes about 2 seconds, a dense 100 × 80 mm board about 5, and a large ten-layer board about 20. A run through the API adds a few seconds for the cloud container to start.

### Tips and limits

- **Send what you send the fab**: one ZIP per board with the Gerber and drill files. A ZIP holding several boards (a panel's parts, or two projects) is refused; zip each board on its own.
- **No outline file** means the size is the extent of everything drawn, and the result says so.
- **The narrowest copper line** is the thinnest line drawn on copper, which can be text or the border of a filled zone, so read it as a hint. Lines under 0.025 mm are ignored as drawing artifacts.
- **Drill files without a header** (no `M48` line, as some old PADS exports) aren't read; export Excellon with a header.
- **Not a DRC**: clearances, annular rings, netlists and impedance aren't checked.
- **Limits**: 200 files and 150 MB unpacked per ZIP, 100 MB per download.

### For AI agents and developers

This Actor works with the [Apify MCP server](https://mcp.apify.com), so AI agents can call it as a tool. Pass `gerberUrls` and read `summary`, `layers`, `drills`, `warnings` and the picture links. A direct API call that waits for the answer:

```bash
curl -X POST "https://api.apify.com/v2/acts/jumblemog~gerber-pcb-renderer/run-sync-get-dataset-items?token=YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"gerberUrls": ["https://example.com/my-board-gerbers.zip"], "maskColor": "black"}'
```

`run-sync` instead returns the run's `OUTPUT`: the first picture as a PNG.

In Python, with the `apify-client` package:

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_TOKEN")
run = client.actor("jumblemog/gerber-pcb-renderer").call(run_input={
    "gerberUrls": ["https://example.com/my-board-gerbers.zip"], "outputs": ["png", "svg"],
})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item["summary"], item["topImageUrl"], item["warnings"])
```

### Credits

- Gerber and Excellon reading: [gerbonara](https://gitlab.com/gerbolyze/gerbonara) (Apache-2.0).
- Rasterizing: [resvg](https://github.com/linebender/resvg) (Apache-2.0 or MIT) through [resvg-py](https://github.com/baseplate-admin/resvg-py) (MIT).
- The example board is this Actor's own design.

# Actor input Schema

## `gerberUrls` (type: `array`):

Links to ZIP archives of Gerber and drill files, one board per ZIP, as you would send to a PCB fab. GitHub folder and file links, Google Drive and Dropbox share links work. Links to single Gerber files are read together as one board. Write `example` to try the built-in example board.

## `uploads` (type: `array`):

Upload ZIP archives (one board each) or a board's loose Gerber and drill files from your computer.

## `sides` (type: `string`):

The bottom is drawn mirrored, as you see it when you turn the board over.

## `outputs` (type: `array`):

PNG for previews, quotes and chat; SVG to zoom without limit or edit. The price per board is the same whatever you pick.

## `imageWidth` (type: `integer`):

Width of the PNG pictures. The height follows the board's shape.

## `maskColor` (type: `string`):

The solder mask color to draw the board in, as fabs offer them.

## `finish` (type: `string`):

The color of exposed pads.

## `silkColor` (type: `string`):

The color of the printed legend.

## `layerMap` (type: `object`):

Only when a file's layer isn't recognized from its name: map file names to layers, such as {"board.g2": "inner 1 copper", "cut.gbr": "outline", "notes.gbr": "ignore"}. Layers: top or bottom copper, mask, silk or paste; inner 1 copper and so on; outline; drill plated; drill non-plated; ignore.

## `maxBoards` (type: `integer`):

Stop after this many boards.

## `timeoutSecs` (type: `integer`):

A board that takes longer to read and draw is reported as failed and not charged.

## Actor input object example

```json
{
  "gerberUrls": [
    "example"
  ],
  "sides": "both",
  "outputs": [
    "png"
  ],
  "imageWidth": 1600,
  "maskColor": "green",
  "finish": "hasl",
  "silkColor": "auto",
  "maxBoards": 50,
  "timeoutSecs": 120
}
```

# Actor output Schema

## `results` (type: `string`):

One item per board: size, layers, drill table, warnings and links to the pictures.

## `files` (type: `string`):

The PNG and SVG pictures saved in the run's key-value store.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "gerberUrls": [
        "example"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("jumblemog/gerber-pcb-renderer").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "gerberUrls": ["example"] }

# Run the Actor and wait for it to finish
run = client.actor("jumblemog/gerber-pcb-renderer").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "gerberUrls": [
    "example"
  ]
}' |
apify call jumblemog/gerber-pcb-renderer --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,jumblemog/gerber-pcb-renderer"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/CMqVUa9cE81pqwsaL/builds/hyR65EyTB2IROXclb/openapi.json
