Carbon API

screenshot of Carbon API
flask

Unofficial API for generating beautiful images of your source code using Carbon.

Overview

Carbon API is an innovative tool designed for developers who want to create visually stunning images of their source code effortlessly. Built with Python using Flask and Pyppeteer, it streamlines the process of transforming code snippets into beautifully styled graphics. Whether you're sharing code on social media, blogs, or presentations, Carbon API allows you to showcase your coding skills with appealing aesthetics.

The API provides flexibility and customization options, making it suitable for various coding languages and styles. With simple GET and POST requests, you can easily manipulate different parameters to achieve the perfect look for your code images. It's an essential tool for any developer looking to enhance their coding portfolio or simply express their creativity.

Features

  • Customizable Background Color: Choose any hex or RGBA color to set the background for your code image, allowing for a personalized touch.
  • Shadow Effects: Easily toggle drop shadows on or off and adjust the blur radius and vertical offset to create depth in your images.
  • Export Resolution Options: Control the image size with options for exporting at different resolutions, such as 1x or 3x.
  • Font Customization: Select from various font families, including popular options like JetBrains Mono and Fira Code, and adjust the font size to fit your style.
  • Line Number Management: Decide whether to display line numbers in your code image, making it easy to reference specific sections.
  • Theming Options: Choose from different themes, including the popular "seti" theme, to ensure your code looks great in any context.
  • Watermark Control: Decide if you want a watermark on your images, giving you complete control over the branding of your creations.
  • Width Adjustment: Toggle width adjustments for better fitting of your code snippet within the image frame.
flask
Flask

Flask is a lightweight and popular web framework for Python, known for its simplicity and flexibility. It is widely used to build web applications, providing a minimalistic approach to web development with features like routing, templates, and support for extensions.