DEV Community

JohnMith
JohnMith

Posted on

I Built a Free Mock API Platform Because I Was Tired of Waiting for Backend" published: true

SnapMock — create mock APIs in 30 seconds with dynamic data, chaos testing, AI generation, and stateful CRUD. No install needed."
tags: webdev, javascript, react, api


Every frontend developer knows this pain:

Sprint starts. You're assigned to build the product listing page. Designs are ready. You open your editor, crack your knuckles, and...

The API isn't ready yet.

Your options:

  • Wait for the backend team (and delay the sprint)
  • Hardcode dummy data (and remember to clean it up... right?)
  • Set up json-server locally (and it works only on your machine)

I've been through this cycle too many times. So I built SnapMock — an online mock API platform where you create endpoints in 30 seconds and start building immediately.

No installation. No deployment. No backend code.


Quick Demo: Mock API in 30 Seconds

Step 1: Create a project on snapmock.net

Step 2: Add an endpoint

Method: GET
Path:   /api/products
Status: 200
Enter fullscreen mode Exit fullscreen mode

Response body:

{
  "products": [
    { "id": 1, "name": "iPhone 16", "price": 999 },
    { "id": 2, "name": "MacBook Pro", "price": 2499 },
    { "id": 3, "name": "AirPods Pro", "price": 249 }
  ]
}
Enter fullscreen mode Exit fullscreen mode

Step 3: Call your API

curl -H "x-snapmock-key: YOUR_API_KEY" \
  [https://snapmock.net/api/YOUR_PROJECT_ID/products](https://snapmock.net/api/YOUR_PROJECT_ID/products)
Enter fullscreen mode Exit fullscreen mode

Done. Your frontend can now fetch() real data while backend works in parallel.


Features That Make SnapMock Different

Dynamic Data (Faker.js)

Static JSON gets old fast. SnapMock lets you use dynamic tags:

{
  "id": "{{$uuid}}",
  "name": "{{$fullName}}",
  "email": "{{$email}}",
  "avatar": "{{$avatar}}",
  "company": "{{$company}}",
  "bio": "{{$lorem}}"
}
Enter fullscreen mode Exit fullscreen mode

Every API call returns different, realistic data. Your UI gets tested with diverse inputs automatically — no more "John Doe" everywhere.

Conditional Rules

Return different responses based on request data:

Condition Response
Header x-role = "admin" Full product list with admin fields
Header x-role = "user" Limited product list
Query ?page=2 Second page of results
Body contains {"error": true} 400 Bad Request

Rules are evaluated in order — first match wins. This lets you simulate complex API behaviors without writing any backend logic.

Chaos Engineering

This is my favorite feature, and no other mock tool has it.

Enable Chaos Mode on any project and configure:

  • Error injection: Random 500, 503, 404 responses
  • Latency spikes: Random delays (100ms to 5000ms)
  • Configurable failure rate: 10%, 30%, 50% — you control the chaos

Why? Because your app works great when everything returns 200. But production isn't that kind. Test your error boundaries, retry logic, and loading states before users hit them.

AI-Powered Generation

Don't want to write JSON by hand? Just describe what you need:

"A list of 10 blog posts with id, title, author, publishedAt, tags array, and a 200-word excerpt"

SnapMock uses Gemini AI to generate a realistic JSON response instantly. Edit it, save it, call it.

Stateful CRUD

Create a single "stateful" endpoint and SnapMock auto-manages full CRUD operations:

  • GET /users → Returns all resources
  • POST /users → Creates a new resource
  • GET /users/:id → Returns one resource
  • PUT /users/:id → Updates a resource
  • DELETE /users/:id → Deletes a resource

The state persists across requests (stored in Firebase Realtime Database), so your frontend can test real create → read → update → delete flows.

Like having a real database — without having a database.

Response Sequences

Need your API to change behavior over time?

  • Call 1 → Returns {"status": "pending"}
  • Call 2 → Returns {"status": "processing"}
  • Call 3 → Returns {"status": "completed"}
  • Call 4 → Loops back to call 1

Perfect for testing order status flows, payment processing, or any workflow that transitions through states.

Team Collaboration

Invite team members to your project with role-based access:

  • Owner: Full control
  • Editor: Create and edit endpoints
  • Viewer: Read-only access

Everyone shares the same project and API key. No more "hey can you send me that mock JSON?" messages.


How It Compares

Feature SnapMock json-server Mockoon Postman Mock
Online (no install) Yes No No Yes
Dynamic data (Faker.js) Yes No Yes No
AI generation Yes No No No
Conditional rules Yes No Yes No
Chaos engineering Yes No No No
Stateful CRUD Yes Yes No No
Response sequences Yes No Yes No
Team collaboration Yes No No Yes
Free tier 1,000 req/day Local only Local only 1,000/month

Using with React

// hooks/useProducts.ts
import { useState, useEffect } from 'react';

const API_BASE = '[https://snapmock.net/api/YOUR_PROJECT_ID](https://snapmock.net/api/YOUR_PROJECT_ID)';
const API_KEY = 'YOUR_API_KEY';

export function useProducts() {
  const [products, setProducts] = useState([]);
  const [loading, setLoading] = useState(true);

  useEffect(() => {
    fetch(`${API_BASE}/products`, {
      headers: { 'x-snapmock-key': API_KEY }
    })
      .then(res => res.json())
      .then(data => {
        setProducts(data.products);
        setLoading(false);
      });
  }, []);

  return { products, loading };
}
Enter fullscreen mode Exit fullscreen mode

When the real backend is ready, just swap the API_BASE URL and remove the x-snapmock-key header. Your frontend code stays the same.


Free to Start

Plan Price Requests/Day Projects Endpoints
Free $0 1,000 5 100/project
Pro $9/mo Unlimited 10 Unlimited
Ultra $29/mo Unlimited Unlimited Unlimited

The free tier includes Dynamic Data, Conditional Rules, Sequences, Chaos Mode, and Stateful CRUD. Upgrade to Pro for GraphQL mocking and Postman import, or Ultra for JWT auth and webhook forwarding.


Tech Stack (for the curious)

  • Frontend: React 19, Vite, TailwindCSS v4
  • Backend: Firebase Cloud Functions (Gen 2, Node 20)
  • Database: Firestore + Realtime Database
  • AI: Google Gemini
  • Payments: Lemon Squeezy
  • Hosting: Firebase Hosting
  • CI/CD: GitHub Actions

Total infrastructure cost: ~$1/month. Firebase's free tier is incredibly generous for a serverless app.


Try It

snapmock.net — sign up free, create your first API in 30 seconds.

I built this solo over 6 months. It's definitely not perfect yet — there are probably bugs I haven't found and UX flows that could be smoother.

If you try it, I'd genuinely love your feedback. Bug reports, feature requests, criticism — all welcome. Just drop a comment below or reach out on Twitter.

Happy mocking.

Top comments (0)