Docs/Image Utils/GET /v1/image-to-datauri

GET /v1/image-to-datauriImage to Base64 Data URI

Image Utils lf-image-utils

Packs an image into a text string you can paste straight into HTML or CSS. Takes an image URL and returns a data: URI string, the MIME type, and the byte size.

Query Parameters

ParameterTypeRequiredDescription
urlstringYesSource image URL

Response Schema

data_uri (string): data: URI string
mime_type (string): Image MIME
size_bytes (integer): Byte size

cURL Example

curl 'https://lf-image-utils.laminarforge.dev/v1/image-to-datauri?url=<url>' -H 'Authorization: Bearer lf_YourApiKey'

Python Example

import requests
url = 'https://lf-image-utils.laminarforge.dev/v1/image-to-datauri'
headers = {'Authorization': 'Bearer lf_YourApiKey'}
params = {'url': '<url>'}
response = requests.get(url, headers=headers, params=params)
print(response.json())