BYTETOOLS

BaconMockup API

Free placeholder photo service with no key: put width and height in the path and get a real bacon photograph back at exactly that size. Tested example included.

No API key requiredHTTPSFree tier

Endpoint tested and returned HTTP 200 on 2026-08-21

What is the BaconMockup API?

BaconMockup serves placeholder photographs of bacon at any requested dimensions. The width and height go in the URL path and the response is the JPEG itself, so it can be used directly as an image source with no key and no JSON to parse.

Grey boxes make a mockup look unfinished in a way that has nothing to do with the design. Swapping them for real photographs changes how a layout reads, and BaconMockup does that in the laziest possible way: no account, no upload, no build step — just numbers in a URL. The trailing slash matters, incidentally, as the version without it costs you a redirect first.

What comes back is a genuine photograph, not a generated pattern, which means it exercises the parts of a layout that synthetic placeholders never do: real luminance variation behind overlaid text, real aspect-ratio cropping, real file weight. That last point is worth watching — the source images are full-resolution photographs with camera metadata still attached, so a page full of them is considerably heavier than the same page full of generated placeholders.

Quick facts

Base URL
https://baconmockup.com
Authentication
No API key, no account and no query parameters. Everything is in the path.
Rate limit
No published limit. Images are cacheable, so repeat requests for the same size are cheap.
Pricing
Free.
CORS
Not enabled — call it from your server
Official docs
Read the docs

How to use the BaconMockup API

Every request below was executed against the live API on 2026-08-21, and the response shown is the real body it returned — not an illustration.

1. Fetch a 300x200 bacon placeholder

GET https://baconmockup.com/300/200/

curl
curl 'https://baconmockup.com/300/200/'
JavaScript (fetch)
const res = await fetch("https://baconmockup.com/300/200/");
if (!res.ok) throw new Error(`Request failed: ${res.status}`);
const data = await res.json();
console.log(data);
Python (requests)
import requests

res = requests.get("https://baconmockup.com/300/200/", timeout=20)
res.raise_for_status()
print(res.json())
Response — HTTP 200
# This endpoint returns image/jpeg, not JSON.
# The response body is the image itself, so it can be used directly as an
# <img src="..."> or saved to a file — there is nothing to parse.
#
# Verified: HTTP 200, Content-Type: image/jpeg

Parameters

ParameterTypeRequiredDescription
widthpathRequiredRequested width in pixels, as the first path segment. 300
heightpathRequiredRequested height in pixels, as the second path segment. Keep the trailing slash to avoid a redirect. 200

Response fields

(body)image/jpeg
The photograph itself. There is no JSON — use the URL directly as an `img` src or save the bytes to a file.
Content-Typeheader
`image/jpeg`. The bytes carry original camera EXIF metadata, so files are larger than a generated placeholder of the same dimensions.

What you can build with the BaconMockup API

  • Fill a wireframe or design mockup with real photography
  • Test how a card grid behaves with images of differing aspect ratios
  • Provide a stand-in hero image while real assets are being shot
  • Demonstrate lazy-loading behaviour with genuinely heavy images

Common errors and how to fix them

Redirect before the image

The trailing slash was omitted from the path.

Fix: Request `/300/200/` rather than `/300/200`. Both work, but the second costs an extra round trip.

Page weight ballooned

These are full photographs with EXIF data attached, not lightweight generated images.

Fix: Use them in mockups, not in performance tests, and strip them before any Lighthouse run.

Cross-origin fetch blocked

The response carries no CORS header.

Fix: Loading the URL in an `img` tag is fine. Reading the bytes with fetch or drawing to a canvas is not — proxy it if you need pixel access.

BaconMockup API — frequently asked questions

Is BaconMockup free?

Yes, entirely — no key, no account and no attribution requirement for the placeholder images.

How do I control the image size?

Put the width and height directly in the path, as in `/300/200/`. There are no query parameters and no other options.

Are the images different every time?

The service picks from a set of bacon photographs, so the same dimensions can return different pictures across requests. It is not a deterministic mapping from size to image.

Can I use these in a production site?

They are meant for mockups and prototypes. They are real photographs of unclear provenance and far heavier than a generated placeholder, so neither the licensing nor the performance suits production.

Tools that pair with this API

BaconMockup is an independent third-party service and is not affiliated with ByteTools or ByteVancer. Details on this page were verified on 2026-08-21; always check the official documentation before relying on this API in production, as terms and limits can change.