BaconMockup API

⭐ Beginner's Pick Food & Drink / No Auth Required Beginner HTTPS CORS
Free to Use Varies (check documentation)

Overview

BaconMockup is a fun, free API that serves placeholder images featuring bacon — great for filling in image slots during web or app development when you just need something visual. You simply specify a width and height in the URL and get back a JPEG image instantly, with no sign-up or API key needed. It is the quickest way to add food-themed placeholder images to a mockup or prototype.

💡

Beginner Tip

Just embed the URL directly in an img tag with src="https://baconmockup.com/300/200" — no JavaScript or API key needed.

Available Data

randomly generated data
customizable output format
BaconMockup data via REST API
JSON-formatted response data
Freely accessible without authentication

Example Response

JSON Response
{
  "status": "success",
  "data": {
    "result": "Data from BaconMockup",
    "description": "Resizable bacon placeholder images",
    "timestamp": "2025-01-15T10:00:00Z"
  }
}

Field Reference

(binary image) The response body is a JPEG image of bacon at the requested dimensions — there is no JSON payload.

Implementation Example

const url = "https://baconmockup.com/";
const response = await fetch(url);
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data);

What Can You Build?

Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.

Common Errors & Troubleshooting

Image returns an error page instead of a JPEG Width or height value is too large or is not a valid integer.
Keep dimensions between 1 and 2000 pixels and make sure both values are whole numbers (e.g., /300/200 not /300.5/200).
Broken image in browser Accessing the bare domain without dimensions returns no image.
Always include width and height in the path: https://baconmockup.com/{width}/{height}.
Slow response in production BaconMockup is a free service with no SLA, so it can be slow under load.
Download the images once and serve them from your own storage in production.

Matrix Score Breakdown

🌐 Reachability 30/30
⚡ Speed 15/20
🔒 Security 15/15
🛠 Developer XP 20/20
✓ Reliability 7/15
Response Time 370ms

Fully tested on Apr 5, 2026

Technical Specifications

Auth No Auth
HTTPS REQUIRED
CORS YES
Category Food & Drink
Difficulty Beginner
Verified: 2026-04-04

Similar APIs

View All →