Logo Lava

Docs Code examples

Code examples

The same logo, Juniper & Vale with seed 1140956701, requested from nine places.

B Klug, updated October 25, 2026

Each example asks for the same pinned logo, so they all produce the picture on the docs overview. The server-side examples read an optional key from the LL_API_KEY environment variable and print any adjustment the service reports in the X-LogoLava-Warning header. Change the text and drop the seed to explore, then pin the seed you like.

HTML

Give the image a width and height so the page does not jump when it loads. The second URL, with scale=2, is for screens with twice the pixel density.

<img
  src="https://api.logolava.com/v2/logo.png?text=Juniper+%26+Vale&seed=1140956701"
  srcset="https://api.logolava.com/v2/logo.png?text=Juniper+%26+Vale&seed=1140956701&scale=2 2x"
  width="640" height="240" alt="Juniper &amp; Vale logo">

Markdown

GitHub READMEs, issues and most Markdown renderers show remote images.

![Juniper & Vale logo](https://api.logolava.com/v2/logo.png?text=Juniper+%26+Vale&seed=1140956701)

CSS

As a background image, with SVG so it stays sharp at any size:

.brand {
  width: 320px;
  height: 120px;
  background: url("https://api.logolava.com/v2/logo.svg?text=Juniper+%26+Vale&seed=1140956701") center / contain no-repeat;
}

React

A component that takes the name and seed as props. URLSearchParams takes care of the encoding.

export function Logo({ text, seed, width = 320, height = 120 }) {
  const params = new URLSearchParams({ text, seed: String(seed) });
  const src = `https://api.logolava.com/v2/logo.png?${params}`;
  return (
    <img
      src={src}
      srcSet={`${src}&scale=2 2x`}
      width={width}
      height={height}
      alt={`${text} logo`}
    />
  );
}

// <Logo text="Juniper & Vale" seed={1140956701} />

WordPress

In the block editor, add an Image block, choose Insert from URL, and paste the logo address. In a theme template, use the same markup as the HTML example:

<img src="<?php echo esc_url( 'https://api.logolava.com/v2/logo.png?text=Juniper+%26+Vale&seed=1140956701' ); ?>"
     width="640" height="240" alt="<?php echo esc_attr( get_bloginfo( 'name' ) ); ?>">

The Media Library can also hold a copy. Download the PNG or SVG once and upload it, which removes any dependence on the API for that image.

PHP

<?php
$query = http_build_query([
    'text' => 'Juniper & Vale',
    'seed' => 1140956701,
    'scale' => 2,
    'api_key' => getenv('LL_API_KEY') ?: '',
]);
$png = file_get_contents("https://api.logolava.com/v2/logo.png?$query");
if ($png === false) {
    exit("Logo Lava did not answer\n");
}
file_put_contents('juniper-vale.png', $png);
echo strlen($png), " bytes\n";

Python

Uses the requests package.

import os
import requests

res = requests.get(
    "https://api.logolava.com/v2/logo.png",
    params={"text": "Juniper & Vale", "seed": 1140956701, "scale": 2, "api_key": os.environ.get("LL_API_KEY", "")},
    timeout=10,
)
res.raise_for_status()
print("warnings:", res.headers.get("X-LogoLava-Warning", "none"))
with open("juniper-vale.png", "wb") as f:
    f.write(res.content)

Node

Needs Node 18 or later, which includes fetch.

import { writeFile } from 'node:fs/promises';

const url = new URL('https://api.logolava.com/v2/logo.png');
url.search = new URLSearchParams({
  text: 'Juniper & Vale',
  seed: '1140956701',
  scale: '2',
  api_key: process.env.LL_API_KEY ?? '',
});

const res = await fetch(url);
if (!res.ok) throw new Error(`Logo Lava answered ${res.status}`);
console.log('warnings:', res.headers.get('x-logolava-warning') ?? 'none');
await writeFile('juniper-vale.png', Buffer.from(await res.arrayBuffer()));

curl

Save the logo, then read the design as JSON. -G with --data-urlencode handles the encoding.

curl -G "https://api.logolava.com/v2/logo.png" \
  --data-urlencode "text=Juniper & Vale" --data "seed=1140956701" \
  -o juniper-vale.png

curl -G "https://api.logolava.com/v2/logo.json" \
  --data-urlencode "text=Juniper & Vale" --data "seed=1140956701"

The Node, PHP, Python and curl examples were each run against the live service on October 25, 2026. The three that ask for scale=2 saved a 1280 by 480 PNG, and the curl example saved the 640 by 240 original.

Next: Migrate from v1