API Docs
Free placeholder text and images for your code and tests. One GET request, no sign-up.
- Free forever
- No API key
- CORS enabled
- Cached at the edge
https://www.loremly.com/api/v1Quick start
There are three endpoints. Every option has a sensible default, so the shortest request just works.
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.
curl "https://www.loremly.com/api/v1/lorem?count=4&format=html&elements=headings,ul&seed=demo"Parameters
All parameters are optional.
| Name | Values | Default | Description |
|---|---|---|---|
unit | paragraphs · sentences · words · lists · characters | paragraphs | What to count. |
count | 1–10,000 | 3 | How many. Max: paragraphs 100, sentences 500, words 10,000, lists 200, characters 50,000. |
flavor | latin · cicero · english · corporate · tech · foodie · space · custom | latin | Text style. Use custom together with words. |
format | text · html · markdown · json · jsx | text | Output format. |
length | short · medium · long · mixed | medium | Sentence and paragraph length. |
start | 1 · 0 | 1 | Begin with “Lorem ipsum dolor sit amet…”. |
elements | headings, emphasis, links, ul, ol, blockquote, code, table | — | Comma-separated HTML elements to include (paragraphs only). |
words | space or comma separated | — | Your own vocabulary (with flavor=custom). |
seed | any text, ≤ 64 | random | Same seed + options = same output. |
envelope | 1 | — | 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.
<img src="https://www.loremly.com/api/v1/photo?w=600&h=400" alt="">Parameters
All parameters are optional.
| Name | Values | Default | Description |
|---|---|---|---|
w | 1–3,000 | 600 | Width in pixels. |
h | 1–3,000 | same as w | Height in pixels. Leave it out for a square. |
type | photo · illustration | photo | Real photo, or generated artwork. |
category | any · nature · ocean · city · architecture · food · animals · flowers · forest | any | Photo subject (type=photo). |
style | landscape · gradient · soft · waves · shapes | mixed | Illustration style (type=illustration). |
seed | a–z, 0–9, - _ (≤ 64) | random | Same seed = same picture, every time. |
grayscale | 1 | off | Black and white. |
blur | 0–10 | 0 | Blur strength, 1–10. |
format | jpg · webp · png · svg | jpg | File 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.
<img src="https://www.loremly.com/api/v1/image?w=600&h=400" alt="">Parameters
All parameters are optional.
| Name | Values | Default | Description |
|---|---|---|---|
w | 1–4,000 | 600 | Width in pixels (PNG max 2,000). |
h | 1–4,000 | same as w | Height in pixels. Leave it out for a square. |
bg | hex, e.g. 4f46e5 | e5e7eb | Background color, hex without #. |
fg | hex, e.g. 4f46e5 | 6b7280 | Text color, hex without #. |
text | ≤ 80 characters | the size | Label in the middle of the image. |
format | svg · png | svg | File type. |
- The same URL always returns the same image, so responses are cached for a long time.
Errors & limits
| Status | Meaning |
|---|---|
200 | Success. |
404 | Unknown endpoint. Check the path. |
429 | Too many requests. Slow down, or cache responses, and try again shortly. |
500 | Something 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.