Simple Snap API

Learn how to automate the creation of beautiful code screenshots


Our powerful editor gives you the ability to create beautiful code snippets with ease. But sometimes you might want to create them programmatically. That's why we're building an API around the functionalities of snappify so you're able to automate the process.

We started out with this "Simple Snap" API, where you can pass the code + style settings to our REST endpoint and receive the generated image. Our users leverage this API to e.g. create Twitter Posts automatically or generate beautiful OG Images in their services.

Hint πŸ’‘

The API is only available to users on our paid plans and if you want to remove the watermark, you have to upgrade at least to the Pro plan. Check our pricing table for more infos.

Usage

The API is available at https://api.snappify.com/snap/simple as a POST call.

You have to send your API-Key in the Authorization Header.

The configuration has to be sent as a JSON body. Here you can see an example config:

simple-api-config.json
{
	"code": "function () {\n  console.log('hello world');\n}",
	"fileName": "test.js",
	"language": "JavaScript",
	"theme": "github-dark-dimmed",
	"background": "linear-gradient(354deg,  #FF75B5, #FFB86C)",
	"paddingLeft": 60,
	"paddingRight": 60,
	"paddingTop": 40,
	"paddingBottom": 100,
	"profileInfo": {
		"showFullname": true,
		"showUsername": true,
		"showAvatar": true,
		"position": "bottom-center"
	},
	"aspectRatio": {
		"width": 16,
		"height": 9
	}
}

Config Parameters

code* required
Description
Pass your code as a string. Line breaks should be passed as \n.
Type
string

language
Description
The programming language which should be used for syntax highlighting.
Type
"abap"Β |Β "actionscript"Β |Β "apache"Β |Β "apl"Β |Β "applescript"Β |Β "astro"Β |Β "autoit"Β |Β "bash"Β |Β "c"Β |Β "c++"Β |Β "c#"Β |Β "clojure"Β |Β "cobol"Β |Β "css"Β |Β "dart"Β |Β "docker"Β |Β "elixir"Β |Β "elm"Β |Β "erb"Β |Β "erlang"Β |Β "f#"Β |Β "gherkin"Β |Β "graphql"Β |Β "go"Β |Β "groovy"Β |Β "haskell"Β |Β "hcl (terraform)"Β |Β "html"Β |Β "ini"Β |Β "java"Β |Β "javascript"Β |Β "julia"Β |Β "jupyter"Β |Β "jsx"Β |Β "json"Β |Β "kotlin"Β |Β "latex"Β |Β "less"Β |Β "liquid"Β |Β "lisp"Β |Β "lua"Β |Β "markdown"Β |Β "matlab / octave"Β |Β "mdx"Β |Β "nginx"Β |Β "objective c"Β |Β "objective c++"Β |Β "ocaml"Β |Β "pascal"Β |Β "perl"Β |Β "php"Β |Β "plain text"Β |Β "pl/sql"Β |Β "powershell"Β |Β "prisma"Β |Β "python"Β |Β "r"Β |Β "ruby"Β |Β "rust"Β |Β "sass"Β |Β "scala"Β |Β "shell"Β |Β "smalltalk"Β |Β "solidity"Β |Β "sql"Β |Β "stylus"Β |Β "svelte"Β |Β "swift"Β |Β "toml"Β |Β "typescript"Β |Β "tsx"Β |Β "visual basic"Β |Β "vue"Β |Β "wasm"Β |Β "wolfram"Β |Β "xml"Β |Β "x86 & x64 assembly"Β |Β "yaml"Β |Β "zsh"
Default
"javascript"

theme
Description
The theme which should be used for syntax highlighting.
Type
"bt-vivid-black"Β |Β "catppuccin-frappe"Β |Β "catppuccin-macchiato"Β |Β "catppuccin-mocha"Β |Β "dark-plus"Β |Β "darcula"Β |Β "dracula-soft"Β |Β "dracula"Β |Β "github-dark"Β |Β "github-dark-colorblind"Β |Β "github-dark-dimmed"Β |Β "lucario"Β |Β "lucario-custom"Β |Β "material-darker"Β |Β "material-default"Β |Β "material-deep-ocean"Β |Β "material-ocean"Β |Β "material-palenight"Β |Β "mayukai-sunset"Β |Β "min-dark"Β |Β "monokai"Β |Β "nightowl"Β |Β "nord"Β |Β "one-dark-pro"Β |Β "panda-syntax"Β |Β "poimandres"Β |Β "rouge"Β |Β "shades-of-purple"Β |Β "shades-of-purple-sd"Β |Β "slack-dark"Β |Β "solarized-dark"Β |Β "sublime-oceanic"Β |Β "vitesse-dark"Β |Β "github-light"Β |Β "github-light-colorblind"Β |Β "catppuccin-latte"Β |Β "light-plus"Β |Β "material-lighter"Β |Β "min-light"Β |Β "nightowl-light"Β |Β "slack-ochin"Β |Β "solarized-light"Β |Β "vitesse-light"
Default
"github-dark-dimmed"

background
Description
The desired background color as CSS value. (Also supports transparent)
Type
string
Default
"linear-gradient(337deg, #654ea3, #da98b4)"

codeBackground
Description
The desired background color for the code snippet window. If nothing is passed, the default background color of the chosen theme will be used.
Type
string

hideBoxShadow
Description
Enables you to hide the box-shadow of the code window.
Type
boolean
Default
false

profileInfo
Description
Configuration for including your own profile info into the snap. If not specified, no profile info will be shown. You can configure your profile info on the dashboard.
Type
object
showFullname
Type
boolean
Default
false

showUsername
Type
boolean
Default
false

showAvatar
Type
boolean
Default
false

position
Type
"bottom-left"Β |Β "bottom-center"Β |Β "bottom-right"
Default
"bottom-left"

scale
Type
number
Default
1


fileName
Description
The filename which should be shown in the tab of the code snippet window. Leave empty for no tab at all.
Type
string

hideTab
Description
If specified, the whole tab-header of the code snippet window will be hidden.
Type
boolean
Default
false

showLineNumbers
Description
Enables line numbering in the code snippet.
Type
boolean
Default
false

firstLineNumber
Description
Specifies the first line number to count from.
Type
number
Default
1

fontSize
Description
You can specify the font size of your code snippet. Can be a value from 8 to 30.
Type
number
Default
14

fontLigatures
Description
Toggles the visibility of font ligatures in your code.
Type
boolean
Default
true

showWatermark
Description
Toggles the visibility of the snappify watermark.
If you're on the personal plan, the watermark will always be shown.
Type
boolean
Default
false

paddingLeft
Type
number
Default
0

paddingRight
Type
number
Default
0

paddingTop
Type
number
Default
0

paddingBottom
Type
number
Default
0

aspectRatio
Description
Can be passed if the resulting image should keep a specific Aspect Ratio.
Type
object
width
Description
Width of the Aspect Ratio (e.g. 16).
Type
number

height
Description
Height of the Aspect Ratio (e.g. 9).
Type
number


Any questions?
Don't hesitate to ask them! πŸ‘‡