Mock API.
Create fake API endpoints that return the status, headers and JSON body you define.
Uses serverSign in to create mock API routes. Each account can keep 20 mocks; calling a mock URL works without an account.
About Mock API
Mock API lets you stand up a fake HTTP endpoint in a few seconds, so front-end and mobile work does not have to wait for the real backend. You pick the method, an optional path, the status code, the content type, extra response headers and the body, and you get a public URL that answers with exactly that response every time it is called. A typical use is a screen that shows a user profile: create a GET mock for /users/42 that returns a JSON object with id, name and email, point your app at the mock URL and build the UI against it. Switch the status to 404 or 500 to see how the app copes with errors, without touching any server code. Mocks answer requests from browsers, apps, curl or CI jobs, and cross-origin calls are allowed, so a page on localhost can fetch them directly. Each account can keep 20 mock routes, and a body can be up to 256 KB. For safety, a mock cannot set cookies, redirect with a Location header or change security headers, and the response is served with a sandbox policy so HTML in a body never runs as part of this site. Common mistakes: forgetting that the URL is public, so never put real customer data or secrets in a body; choosing a specific method and then calling the mock with another one, which returns 405; and sending JSON with a text/plain content type, which many HTTP clients will not parse.
How to Use
- Sign in, then fill in the method, path, status code, headers and body of the response you want.
- Save the mock and copy its URL.
- Call the URL from your app, curl or tests; edit the mock to change the response at any time.
Frequently Asked Questions
Do I need an account?
Yes. Mocks belong to your account so you can edit and delete them. Calling a mock URL needs no account.
How many mocks can I create?
Up to 20 mock routes per account, each with a body of up to 256 KB.
Can my front end call the mock from another origin?
Yes. Mock responses allow cross-origin requests without credentials, so a page on localhost can fetch them.
Why can't I set a Set-Cookie or Location header?
Mock URLs live on this site's domain. Cookies, redirects and security headers set by user content could be abused, so they are blocked.
Related Tools
Get a temporary URL that records every HTTP request sent to it, for debugging webhooks.
Build HTTP requests and generate code in cURL, PHP, JS, and Python.
Pretty print, minify, and validate JSON.
Reference for all HTTP status codes.
Store a JSON document and get a public URL that serves it raw, for configs, fixtures and demos.
Look up A, AAAA, CNAME, MX, NS, TXT, SOA, CAA and SRV records.