Generated images

Code as an image

A code snippet as a window with syntax colouring. Up to 150 lines of 140 characters. PNGs are drawn at twice the pixel density for sharp text (very large ones at single). The language is guessed from the title's file extension or the code when not given, and reported in the X-Code-Language header.

post/v1/code-image

Request

  • Base URL: https://api.dharun.dev
  • URL: https://api.dharun.dev/v1/code-image
  • Auth: none declared

Query parameters

codestring

The code (or POST it).

languagestring

Language name or file extension, such as go, python, js, sql.

titlestring

File name shown in the title bar.

theme'dark' | 'light'

Default dark.

lineNumbers'true'

Show line numbers.

format'png' | 'svg'

Default png.

Request body

codestring

The code (or POST it).

format'png' | 'svg'

Default png.

languagestring

Language name or file extension, such as go, python, js, sql.

lineNumbers'true'

Show line numbers.

textstring required

The code.

theme'dark' | 'light'

Default dark.

titlestring

File name shown in the title bar.

Response

Success

Changes

No recorded changes to this operation across all 1 revision of this API.