If you’ve ever needed a fake API endpoint that returns a specific JSON body, status code, and headers without standing up a server, you’ve probably searched for Mocky. This guide explains what Mocky is, how to use it, and when you’ll outgrow it. If you want the wider landscape first, our roundup of online API mocking tools compared covers the field, and Mocky’s own open-source repository confirms the basics.
What is Mocky?
Mocky is a free, open-source web service for generating custom HTTP responses. You design a response in your browser, Mocky gives you a unique URL, and any request to that URL returns exactly what you defined. There’s no backend to write and no server to host.
It was built by Julien Lafont and released under the Apache 2.0 license. The hosted version lives at mocky.io, and because the code is public, you can also self-host it if you’d rather run your own instance.
The core idea is simple. You’re “designing a response behind a URL.” That’s the whole product, and that focus is its biggest strength.
What you can configure
Mocky lets you set the parts of an HTTP response that matter for client testing:
- Status code, so you can return a
200, a404, or a500on demand. - Response body, usually JSON, but any text payload works.
- HTTP headers, including content type and custom headers.
- A response delay, so you can simulate a slow network or a laggy upstream.
Once you save, Mocky stores the response and hands you a permanent URL. You paste that URL into your front-end code, your test, or your HTTP client, and you’re done.
A quick example
Say your back end isn’t ready, but your front end needs a user object to render. You’d open the Mocky designer, set the status to 200, set Content-Type: application/json, and paste a body like this:
{
"id": 42,
"name": "Ada Lovelace",
"role": "admin"
}
Mocky returns a URL such as https://run.mocky.io/v3/<some-id>. Point your app at it, and every request gets that user back. For a broader look at this pattern, see our explainer on how to mock APIs online without setting up a server.
When Mocky is the right call
Mocky shines when your needs are small and one-off:
- You want a single static response, fast, with no account.
- You’re sharing a fixed payload with a teammate or a support ticket.
- You’re reproducing one error case, like a 500 internal server error response, for a bug report.
- You don’t need the response to change based on the request.
For these jobs, Mocky is hard to beat. It’s free, it loads in a browser, and you can have a working URL in under a minute. Don’t over-engineer a problem this size.
Where Mocky starts to hurt
The same simplicity that makes Mocky great also caps it. Each Mocky URL is one fixed response. As your project grows, that model gets thin in a few predictable ways.
- No dynamic data. Every caller gets the identical body. You can’t return a different user for
/users/1versus/users/2, and you can’t generate realistic, varied data. - No request matching. Mocky doesn’t branch on query params, path values, or request bodies. One URL, one answer.
- Loose organization. A real API has dozens of endpoints. Managing them as a pile of separate Mocky links gets messy quickly.
- Thin collaboration. There’s no shared workspace, no versioning, and no team permissions around your mocks.
- No schema link. Your mock and your OpenAPI spec live in different places, so they drift apart.
When you hit two or three of these, you’ve outgrown a single-response tool. That’s the point to graduate to a full mock platform. If you’re weighing the budget tradeoff, our guide to free and cheap API mock servers lays out the options.
A common trigger is the front-end team. One developer mocks the user object, another mocks the orders list, a third mocks the auth flow. With Mocky, those are three unrelated links with no shared base URL and no way to swap environments. With a real mock server, they’re three endpoints in one project that all answer under a single host, and you can flip between staging and production data in one place.
The best Mocky alternative: Apidog
Apidog keeps Mocky’s best trait, a custom response behind a shareable URL, then adds the things Mocky leaves out: persistence across many endpoints, schema-driven data, dynamic responses, and team collaboration. You design endpoints, and Apidog generates a hosted mock URL that returns custom status codes, headers, and JSON bodies, just like Mocky, but tied to your actual API design.
Here’s the honest difference. Mocky answers “give me one fixed response, free, right now.” Apidog answers “give me a believable mock of a whole API that grows with my project.”
A few things Apidog adds on top of the Mocky use case:
- Smart mock and AI-generated data. Instead of hardcoding one body, Apidog can infer realistic values from your field names and schema, so
emailreturns an email andcreatedAtreturns a date. - Faker.js support. You can plug in Faker.js to generate dynamic mock data for varied, realistic payloads on every call.
- Advanced mock rules. Return different responses based on query parameters or request content, which is the request-matching Mocky can’t do.
- Schema-first mocking. Your mock is generated from your OpenAPI design, so the two stay in sync.
- Team workspaces. Mocks live in a shared project with version control and real-time sync, not scattered across one-off links.
You still get the simple part. Need a single endpoint that returns a 200 with a fixed JSON body behind a URL? Apidog does that too, and you can share it with your team in one click.
Mocky vs Apidog at a glance
| Capability | Mocky | Apidog |
|---|---|---|
| Custom status, headers, body behind a URL | Yes | Yes |
| Free to start, no setup | Yes | Yes (free plan) |
| Single static response | Yes | Yes |
| Dynamic data (Faker.js, smart mock) | No | Yes |
| Request matching / conditional rules | No | Yes |
| Many endpoints in one project | No | Yes |
| Schema-driven (OpenAPI) mocks | No | Yes |
| Team workspace + versioning | No | Yes |
| Self-host option | Yes (open source) | Cloud + self-host options |
If you want to compare more contenders side by side, our list of the best API mocking tools and our REST endpoint mocking roundup go deeper.
How to replace a Mocky URL in Apidog
Moving off a single Mocky link is quick:
- Download Apidog and create a project.
- Add an endpoint, for example
GET /users/42. - Define the response: set the status code, add headers, and write the JSON body, the same fields you’d have typed into Mocky.
- Enable the mock. Apidog generates a hosted mock URL for that endpoint.
- Point your front end or test at the new URL.
From there you can layer on the extras, dynamic data, conditional rules, more endpoints, whenever you need them. You don’t have to use the advanced features on day one.
The migration is rarely all-at-once. Most teams keep their existing Mocky links working while they rebuild the important endpoints in Apidog, then retire the old URLs once the project is in one place. Because Apidog can read an OpenAPI file, if you already have a spec you can import it and get mock URLs for every endpoint at once, instead of recreating each response by hand.
Frequently asked questions
Is Mocky free?
Yes. Mocky is free and open source under the Apache 2.0 license, and you don’t need an account to create a mock. Responses are stored server-side, so the URL you get stays live. If you need more than a single fixed response, a fuller platform like Apidog gives you a free tier with dynamic data and team features.
What’s the difference between mocky.io and a mock server?
A Mocky URL is one canned response. A mock server simulates a whole API, with many endpoints, request matching, and data that can change per request. If you’re new to the concept, our explainer on what a mock API is walks through it from the ground up.
Can I return a custom status code and headers with Mocky?
Yes. That’s exactly what Mocky is for. You set the status code, add any headers you want, write the body, and Mocky serves all of it from a single URL. The limit is that it’s always the same response, regardless of the request.
When should I switch from Mocky to a full mock platform?
Switch when you need more than one fixed answer: dynamic or realistic data, conditional responses, several endpoints organized together, or a shared workspace for your team. Until then, Mocky’s simplicity is a feature, not a flaw.
Wrapping up
Mocky is a clean, free way to put one custom HTTP response behind a URL, and for quick, static needs it’s the right tool. The moment you need dynamic data, request matching, many endpoints, or team collaboration, that single-response model runs out of room.
That’s where Apidog picks up. It covers the same “design a response behind a URL” job, then scales into schema-driven, dynamic, collaborative mocking as your API grows. Download Apidog to spin up your first mock URL for free and keep it as your project gets bigger.



