---
agentTools:
  projectIndex: https://apidocs.macrofab.com/llms.txt
---

# Get PCB File

Get a Specific PCB File

Returns the contents of a PCB file. Use `GET /api/v3/pcb/{pcb_id}/{pcb_version}/files` to find
the available files and their states.

For example, `GET /api/v3/pcb/mdx0ce/1/file/processed/pcbtop.png` returns the rendered image of
the top of the board, when one is available.

# OpenAPI definition

```json
{
  "openapi": "3.0.1",
  "info": {
    "title": "MacroFab API",
    "description": "MacroFab API\n\n**Authentication**\n\nAuthenticate every request by sending your API key in the `X-MacroFab-API-Key` header.\nRequests act as the user that generated the API key.\n\n**Responses**\n\nSend `Accept: application/json` with every request. Some endpoints return an empty response\nwithout it.\n\n**Versions**\n\nEndpoints are versioned in their path (`/api/v2/`, `/api/v3/`, `/api/v4/`, `/api/v5/`), and\ndifferent endpoints are at different versions. Use the version documented here for each\nendpoint.\n",
    "version": "1.1.0"
  },
  "servers": [
    {
      "url": "https://api.macrofab.com"
    }
  ],
  "paths": {
    "/api/v3/pcb/{pcb_id}/{pcb_version}/file/{status}/{file_name}": {
      "get": {
        "tags": [
          "PCB"
        ],
        "summary": "Get PCB File",
        "description": "Get a Specific PCB File\n\nReturns the contents of a PCB file. Use `GET /api/v3/pcb/{pcb_id}/{pcb_version}/files` to find\nthe available files and their states.\n\nFor example, `GET /api/v3/pcb/mdx0ce/1/file/processed/pcbtop.png` returns the rendered image of\nthe top of the board, when one is available.\n",
        "responses": {
          "200": {
            "description": "The file's contents",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "404": {
            "description": "The file does not exist, or you do not have access to it"
          }
        },
        "security": [
          {
            "apikeyHeader": []
          }
        ]
      },
      "parameters": [
        {
          "name": "pcb_id",
          "in": "path",
          "required": true,
          "description": "The PCB ID",
          "schema": {
            "type": "string",
            "example": "mdx0ce"
          }
        },
        {
          "name": "pcb_version",
          "in": "path",
          "required": true,
          "description": "The PCB version number",
          "schema": {
            "type": "integer",
            "example": 1
          }
        },
        {
          "name": "status",
          "in": "path",
          "required": true,
          "description": "The file's state",
          "schema": {
            "type": "string",
            "enum": [
              "original",
              "processed",
              "generated",
              "extra",
              "pending",
              "trash"
            ],
            "example": "processed"
          }
        },
        {
          "name": "file_name",
          "in": "path",
          "required": true,
          "description": "The file's `basename`",
          "schema": {
            "type": "string",
            "example": "pcbtop.png"
          }
        }
      ]
    }
  },
  "components": {
    "securitySchemes": {
      "apikeyHeader": {
        "type": "apiKey",
        "name": "X-MacroFab-API-Key",
        "in": "header"
      }
    }
  },
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "_id": {
    "buffer": {
      "0": 100,
      "1": 251,
      "2": 93,
      "3": 50,
      "4": 34,
      "5": 139,
      "6": 70,
      "7": 0,
      "8": 113,
      "9": 3,
      "10": 149,
      "11": 120
    }
  }
}
```