Skip to content
Loremly

API Docs

Free placeholder text and images for your code and tests. One GET request, no sign-up.

Base URLhttps://www.loremly.com/api/v1

Quick start

There are three endpoints. Every option has a sensible default, so the shortest request just works.

Example
curl "https://www.loremly.com/api/v1/lorem?count=2"

For images, just use the URL in an <img> tag: <img src="https://www.loremly.com/api/v1/photo?w=600&h=400" alt="">

TextGET/api/v1/lorem

Lorem Ipsum and placeholder text as plain text, HTML, Markdown, JSON or JSX.

Example
curl "https://www.loremly.com/api/v1/lorem?count=4&format=html&elements=headings,ul&seed=demo"

Parameters

All parameters are optional.

NameValuesDefaultDescription
unitparagraphs · sentences · words · lists · charactersparagraphsWhat to count.
count1–10,0003How many. Max: paragraphs 100, sentences 500, words 10,000, lists 200, characters 50,000.
flavorlatin · cicero · english · corporate · tech · foodie · space · customlatinText style. Use custom together with words.
formattext · html · markdown · json · jsxtextOutput format.
lengthshort · medium · long · mixedmediumSentence and paragraph length.
start1 · 01Begin with “Lorem ipsum dolor sit amet…”.
elementsheadings, emphasis, links, ul, ol, blockquote, code, table—Comma-separated HTML elements to include (paragraphs only).
wordsspace or comma separated—Your own vocabulary (with flavor=custom).
seedany text, ≤ 64randomSame seed + options = same output.
envelope1—Set to 1 to wrap the response in JSON with seed, options and stats.
  • Values outside a range are clamped, and unknown values fall back to the default.
  • format=json returns an array of strings, or a block tree when elements is set.
  • Every response has an X-Lorem-Seed header, so you can reproduce a random result.

PhotosGET/api/v1/photo

A real placeholder photo cropped to the exact size, or a generated illustration.

Example
<img src="https://www.loremly.com/api/v1/photo?w=600&h=400" alt="">

Parameters

All parameters are optional.

NameValuesDefaultDescription
w1–3,000600Width in pixels.
h1–3,000same as wHeight in pixels. Leave it out for a square.
typephoto · illustrationphotoReal photo, or generated artwork.
categoryany · nature · ocean · city · architecture · food · animals · flowers · forestanyPhoto subject (type=photo).
stylelandscape · gradient · soft · waves · shapesmixedIllustration style (type=illustration).
seeda–z, 0–9, - _ (≤ 64)randomSame seed = same picture, every time.
grayscale1offBlack and white.
blur0–100Blur strength, 1–10.
formatjpg · webp · png · svgjpgFile type. SVG is for illustrations only.
  • Seeded pictures are cached for a long time. Random requests are never cached.
  • Browsers cache images by URL, so give identical random URLs on one page a different seed (or add &r=1, &r=2).
  • Every response has an X-Image-Seed header, so you can reproduce a random picture.

Placeholder ImagesGET/api/v1/image

A solid-color image with a label in the middle (the size, or your text), as SVG or PNG.

Example
<img src="https://www.loremly.com/api/v1/image?w=600&h=400" alt="">

Parameters

All parameters are optional.

NameValuesDefaultDescription
w1–4,000600Width in pixels (PNG max 2,000).
h1–4,000same as wHeight in pixels. Leave it out for a square.
bghex, e.g. 4f46e5e5e7ebBackground color, hex without #.
fghex, e.g. 4f46e56b7280Text color, hex without #.
text≤ 80 charactersthe sizeLabel in the middle of the image.
formatsvg · pngsvgFile type.
  • The same URL always returns the same image, so responses are cached for a long time.

Errors & limits

StatusMeaning
200Success.
404Unknown endpoint. Check the path.
429Too many requests. Slow down, or cache responses, and try again shortly.
500Something went wrong on our side. Try again.
  • • Invalid parameters don't cause errors: out-of-range numbers are clamped and unknown values fall back to the default.
  • • Maximum sizes: text up to 100 paragraphs or 10,000 words; photos 3,000 × 3,000 px; placeholder images 4,000 px (SVG) or 2,000 px (PNG).

Fair use

The API is free for development, testing and production. Please cache responses where you can; requests with a seed are made for this. Heavy automated traffic may be rate-limited. Need more? Email hello@loremly.com.