Home

Awesome

Carbon API [Unofficial]


<p align="center"> <a href="https://github.com/carbon-app/carbon"> <img src="resources/carbon.png" alt="Carbon"> </a> <br> <b>Unofficial API</b> <br> </p>

Show some :heart: and :star: the repo

GitHub stars GitHub followers Telegram Channel

Carbon API written in Python using Flask and Pyppeteer

made-with-python Open Source Love svg1

Carbon makes it easy to create and share beautiful images of your source code

Usage

You can use the API by sending a GET or a POST request using these params

parameterdefaulttypedescription
code (required)stringCode snippet
backgroundColor"rgba(171, 184, 195, 1)"stringHex or rgba color
dropShadowtruebooleanTurn on/off shadow
dropShadowBlurRadius"68px"stringshadow blur radius
dropShadowOffsetY"20px"stringshadow offset y
exportSize"2x"stringresolution of exported image, e.g. 1x, 3x
fontSize"14px"stringfont size
fontFamily"Hack"stringfont family, e.g. JetBrains Mono, Fira Code.
firstLineNumber1numberfirst line number
language"auto"stringprograming language for properly highlighting
lineNumbersfalsebooleanturn on/off line number
paddingHorizontal"56px"stringhorizontal padding
paddingVertical"56px"stringvertical padding
theme"seti"stringcode theme
watermarkfalsebooleanturn on/off watermark
widthAdjustmenttruebooleanturn on/off width adjustment
windowControlstruebooleanturn on/off window controls
windowTheme"none"stringwindow theme

GET /

Params are encoded in url

https://carbonnowsh.herokuapp.com/?code=Made+with+Love+in+India+by+Sumanjay&theme=darcula&backgroundColor=rgba(144, 19, 254, 100)

POST /

Body is JSON with these params:

{
    "backgroundColor": "rgba(144, 19, 254, 100)",
    "code": "Made with Love in India by Sumanjay",
    "theme": "dracula"
}

RESPONSE

Response is an image of a code or text snippet.

<p align="center"> <a href="https://github.com/cyberboysumanjay"> <img src="resources/response.png" alt="Response"> </a> </p>

Deploy Option

Made with ❤️️ in India

Copyright & License