Skip to content

siddiquiaffan/Carbon-API

Repository files navigation

Carbon API {Unofficial}

Create and share beautiful images of your source code!

Carbon
Unofficial API

Show some ❤️ and ⭐ the repo

GitHub stars GitHub followers Telegram Channel

Unofficial Carbon API written in Node Js using Puppeteer

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

parameter default type description
text (required) string Code snippet
ss "false" string Get screenshot instead of exported image
name "carbon" string Name of the image (without extension)
type "png" string type of carbon (PNG or SVG)
bg "rgba(171, 184, 195, 1)" string Hex or rgba color
ds true boolean Turn on/off shadow
blur "68px" string shadow blur radius
dsyoff "20px" string shadow offset y
es "2x" string resolution of exported image, e.g. 1x, 3x
fs "14px" string font size
fm "Hack" string font family, e.g. JetBrains Mono, Fira Code.
fl 1 number first line number
l "auto" string programing language for properly highlighting
ln false boolean turn on/off line number
ph "56px" string horizontal padding
pv "56px" string vertical padding
t "seti" string code theme
wm false boolean turn on/off watermark
wa true boolean turn on/off width adjustment
wc true boolean turn on/off window controls
wt "none" string window theme

GET /

Params are encoded in url

https://unofficialcarbon.herokuapp.com/api?text=Made+with+❤+in+India+by+Affan

RESPONSE

Response is an image of a code or text snippet.

Response

Deploy Option

  • Heroku Method Deploy

  • Other Method

    # Clone the repo
    git clone https://github.com/AffanTheBest/Carbon-API
    cd Carbon-API
    
    # install npm modules
    npm install
    
    # Finally run the app
    npm start

Made with ❤️️ in India

Copyright & License