{
  "openapi": "3.0.1",
  "info": {
    "title": "Code to Image: Beautiful Code Screenshots as PNG & SVG",
    "description": "Turn code into beautiful images like Carbon and ray.so: VS Code themes, 235 languages, ligature fonts, line highlights and diffs, as PNG, SVG or WebP. Paste code or link GitHub files. Built for AI agents, docs, blogs and social posts.",
    "version": "0.1",
    "x-build-id": "WFIIbOYkWFxPABNRP"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/jumblemog~code-to-image/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-jumblemog-code-to-image",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/jumblemog~code-to-image/runs": {
      "post": {
        "operationId": "runs-sync-jumblemog-code-to-image",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/jumblemog~code-to-image/run-sync": {
      "post": {
        "operationId": "run-sync-jumblemog-code-to-image",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "code": {
            "title": "Code",
            "type": "string",
            "description": "The code to draw. Any of 235 languages; a Markdown code fence (```python ... ```), the way AI models write code, also sets the language, and text around the fence is left out."
          },
          "language": {
            "title": "Language",
            "type": "string",
            "description": "auto detects it. Or a name, alias, file extension or file name: python, ts, tsx, rust, go, sql, bash, yaml, c++, c#, kotlin, swift, php, Dockerfile and 235 languages in all (every language VS Code's grammars cover through Shiki).",
            "default": "auto"
          },
          "snippets": {
            "title": "More snippets (batch)",
            "type": "array",
            "description": "More images in one run. Each entry is a code string, or an object with \"code\" (or \"url\") and any settings of its own, such as {\"code\": \"fmt.Println(42)\", \"language\": \"go\", \"title\": \"main.go\", \"theme\": \"nord\", \"highlightLines\": \"1\", \"name\": \"intro\"}. Settings left out come from this form."
          },
          "urls": {
            "title": "Links to code files",
            "type": "array",
            "description": "Draw code straight from links: GitHub file links (a line range such as #L10-L25 shows just those lines, numbered as in the file), raw.githubusercontent.com links, gists, or any public raw text file. Hosts whose robots.txt forbids it (GitLab and Bitbucket raw files) are declined. Files up to 1 MB.",
            "items": {
              "type": "string"
            }
          },
          "theme": {
            "title": "Theme",
            "enum": [
              "andromeeda",
              "aurora-x",
              "ayu-dark",
              "ayu-light",
              "ayu-mirage",
              "catppuccin-frappe",
              "catppuccin-latte",
              "catppuccin-macchiato",
              "catppuccin-mocha",
              "dark-plus",
              "dracula",
              "dracula-soft",
              "everforest-dark",
              "everforest-light",
              "github-dark",
              "github-dark-default",
              "github-dark-dimmed",
              "github-dark-high-contrast",
              "github-light",
              "github-light-default",
              "github-light-high-contrast",
              "gruvbox-dark-hard",
              "gruvbox-dark-medium",
              "gruvbox-dark-soft",
              "gruvbox-light-hard",
              "gruvbox-light-medium",
              "gruvbox-light-soft",
              "horizon",
              "horizon-bright",
              "houston",
              "kanagawa-dragon",
              "kanagawa-lotus",
              "kanagawa-wave",
              "laserwave",
              "light-plus",
              "material-theme",
              "material-theme-darker",
              "material-theme-lighter",
              "material-theme-ocean",
              "material-theme-palenight",
              "min-dark",
              "min-light",
              "monokai",
              "night-owl",
              "night-owl-light",
              "nord",
              "one-dark-pro",
              "one-light",
              "plastic",
              "poimandres",
              "red",
              "rose-pine",
              "rose-pine-dawn",
              "rose-pine-moon",
              "slack-dark",
              "slack-ochin",
              "snazzy-light",
              "solarized-dark",
              "solarized-light",
              "synthwave-84",
              "tokyo-night",
              "vesper",
              "vitesse-black",
              "vitesse-dark",
              "vitesse-light"
            ],
            "type": "string",
            "description": "One of 65 VS Code color themes, the same colors as in the editor.",
            "default": "one-dark-pro"
          },
          "background": {
            "title": "Background",
            "enum": [
              "violet",
              "sunset",
              "ocean",
              "mint",
              "candy",
              "peach",
              "aurora",
              "lime",
              "midnight",
              "charcoal",
              "silver",
              "white",
              "theme",
              "transparent",
              "none"
            ],
            "type": "string",
            "description": "What's around the window: a gradient, a solid color, the theme's own color, transparent, or none (just the window).",
            "default": "violet"
          },
          "backgroundColors": {
            "title": "Custom background colors",
            "type": "string",
            "description": "Your own background instead: one hex color (#0f172a) or two or three for a diagonal gradient (#f97316, #db2777)."
          },
          "fontFamily": {
            "title": "Font",
            "enum": [
              "JetBrains Mono",
              "Fira Code",
              "Cascadia Code",
              "Source Code Pro",
              "IBM Plex Mono",
              "Roboto Mono",
              "Geist Mono",
              "Hack",
              "Ubuntu Mono",
              "Space Mono",
              "DejaVu Sans Mono"
            ],
            "type": "string",
            "description": "Coding font, with bold and italics where the font has them. Ligatures (-> => != ===) where the font has them.",
            "default": "JetBrains Mono"
          },
          "fontSize": {
            "title": "Font size (px)",
            "minimum": 8,
            "maximum": 48,
            "type": "integer",
            "description": "Text size before scaling.",
            "default": 14
          },
          "lineHeight": {
            "title": "Line height",
            "minimum": 1,
            "maximum": 3,
            "type": "number",
            "description": "Space per line as a multiple of the font size.",
            "default": 1.6
          },
          "ligatures": {
            "title": "Font ligatures",
            "type": "boolean",
            "description": "Join -> => != === and similar into single symbols, in fonts that have them (JetBrains Mono, Fira Code, Cascadia Code).",
            "default": true
          },
          "windowStyle": {
            "title": "Window style",
            "enum": [
              "mac",
              "windows",
              "none"
            ],
            "type": "string",
            "description": "The editor window's title bar.",
            "default": "mac"
          },
          "title": {
            "title": "Window title",
            "type": "string",
            "description": "Text in the title bar, usually a file name such as app.py. Links to files use the file's name when this is empty."
          },
          "fileName": {
            "title": "File name",
            "type": "string",
            "description": "The code's file name, such as main.rs: sets the language and the window title when those are empty."
          },
          "shadow": {
            "title": "Shadow",
            "type": "boolean",
            "description": "A soft drop shadow under the window.",
            "default": true
          },
          "padding": {
            "title": "Padding (px)",
            "minimum": 0,
            "maximum": 256,
            "type": "integer",
            "description": "Space between the window and the image edge.",
            "default": 56
          },
          "cornerRadius": {
            "title": "Corner radius (px)",
            "minimum": 0,
            "maximum": 40,
            "type": "integer",
            "description": "How round the window's corners are.",
            "default": 10
          },
          "aspectRatio": {
            "title": "Image shape",
            "enum": [
              "auto",
              "16:9",
              "1.91:1",
              "2:1",
              "4:3",
              "1:1",
              "4:5",
              "9:16"
            ],
            "type": "string",
            "description": "auto fits the code. The others widen or heighten the background to a fixed shape, with the window centered: 16:9 for slides and YouTube, 1.91:1 for link previews and X posts, 1:1 and 4:5 for Instagram, 9:16 for stories and Shorts.",
            "default": "auto"
          },
          "caption": {
            "title": "Caption",
            "type": "string",
            "description": "A line of text under the window, such as your name, handle or site."
          },
          "lineNumbers": {
            "title": "Line numbers",
            "type": "boolean",
            "description": "Show line numbers.",
            "default": false
          },
          "startLine": {
            "title": "First line number",
            "minimum": 0,
            "type": "integer",
            "description": "The number of the first line. Empty: 1, or the first line of the range picked with lines or a #L link."
          },
          "lines": {
            "title": "Lines to show",
            "type": "string",
            "description": "Show part of the code only, such as 10-30, 10- (to the end) or -30."
          },
          "highlightLines": {
            "title": "Highlight lines",
            "type": "string",
            "description": "Lines to mark with a bright band, such as 3, 7-9 (numbers as shown)."
          },
          "focusLines": {
            "title": "Focus lines",
            "type": "string",
            "description": "Lines to keep bright while all others fade, such as 4-6."
          },
          "diff": {
            "title": "Diff markers",
            "type": "boolean",
            "description": "Lines starting with + or - are shown as added (green) or removed (red), keeping the code's own colors, like a pull request. Git headers are left out.",
            "default": false
          },
          "wrapColumns": {
            "title": "Wrap long lines at",
            "minimum": 0,
            "maximum": 1000,
            "type": "integer",
            "description": "Lines longer than this many characters wrap onto the next row, indented. 0 never wraps.",
            "default": 100
          },
          "minColumns": {
            "title": "Minimum width (characters)",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "The window is at least this many characters wide. Give several images the same width for a matching set.",
            "default": 40
          },
          "tabSize": {
            "title": "Tab width",
            "minimum": 1,
            "maximum": 16,
            "type": "integer",
            "description": "Spaces per tab character.",
            "default": 4
          },
          "maxLines": {
            "title": "Maximum lines",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Longer code is cut after this many lines (the result says so).",
            "default": 300
          },
          "formats": {
            "title": "File formats",
            "type": "array",
            "description": "PNG for chats, docs and social posts; SVG for crisp scaling on the web, with the fonts embedded; WebP for small lossless files. One charge per image, whatever the number of formats.",
            "items": {
              "type": "string",
              "enum": [
                "png",
                "svg",
                "webp"
              ],
              "enumTitles": [
                "PNG",
                "SVG",
                "WebP"
              ]
            },
            "default": [
              "png"
            ]
          },
          "scale": {
            "title": "Pixel scale",
            "minimum": 1,
            "maximum": 4,
            "type": "number",
            "description": "Pixel density of PNG and WebP files: 2 (default) is sharp on high-resolution screens, 1 gives smaller files, 3 or 4 for print. Very tall images are scaled down to stay under 25 megapixels.",
            "default": 2
          },
          "maxImages": {
            "title": "Maximum images",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Stop after this many images, so the cost of a run stays predictable.",
            "default": 100
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}