Carbon makes it easy to create and share beautiful images of your source code
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 |
Params are encoded in url
https://unofficialcarbon.herokuapp.com/api?text=Made+with+❤+in+India+by+Affan
Response is an image of a code or text snippet.
-
Heroku Method
-
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
- Copyright (C) 2020 by Affan
- Licensed under the terms of the GNU GPL Version 3
- Support Group - https://t.me/AsLootChat