Skip to main content

Base64 Encoding Snippets

This page provides code snippets for encoding images to base64 in various programming languages. These snippets are useful for sending image data directly in API requests instead of using image URLs.

JavaScript

JavaScript (Browser)

Python

PHP

Java

C#

Ruby

Go

Swift

Using Base64 Encoded Images with VizAPI

When using base64 encoded images with VizAPI, you’ll need to convert the base64 string to a format that our API can accept.

Example with the Extract Values Endpoint