72 stable releases

new 4.3.1 Jul 4, 2025
4.2.0 May 31, 2025
3.2.2 May 13, 2025
2.9.6 May 4, 2025
2.0.4 Mar 5, 2024

#374 in Web programming

Download history 480/week @ 2025-03-12 47/week @ 2025-03-19 147/week @ 2025-03-26 4/week @ 2025-04-02 10/week @ 2025-04-09 4/week @ 2025-04-16 98/week @ 2025-04-23 844/week @ 2025-04-30 840/week @ 2025-05-07 288/week @ 2025-05-14 1231/week @ 2025-05-21 1240/week @ 2025-05-28 14/week @ 2025-06-04 51/week @ 2025-06-11 518/week @ 2025-06-18 85/week @ 2025-06-25

706 downloads per month
Used in apimokka

Apache-2.0

1MB
3.5K SLoC

API mock (apimock-rs)

crates.io Rust Documentation Dependency Status Releases Workflow App Docs Workflow License

logo

🪄 Mock APIs easily — no setup stress, just JSON and go

If you’re building or testing APIs, this tool makes mocking painless. You don’t need to write any config files — just use folders and JSON. It’s super fast, efficient, and flexible when you need it to be.

  • 🎈 No config needed to get started
  • 🥷 Fast to launch, light on memory, out of your way
  • 🧩 Moreover, advanced matching and custom scripting supported

It’s rebuilt from the ground up in version 4. Designed to help developers of all levels.

Getting started

# install
npm install -D apimock-rs
# and go
npx apimock
# just use folders and JSON
mkdir -p api/v1/
echo '{"hello": "world"}' > api/v1/hello.json
npx apimock

# response
curl http://localhost:3001/api/v1/hello
# --> {"hello":"world"}
# also, there's room to tweak things later
npx apimock --init

📖 Documentation

For more details, 🧭 check out the docs.

💻️ GUI wrapper (development in progress)

apimokka, featherlight GUI bundle, will be also available.


🛠️ App overhaul announcement

⚠️ v4, our new major version, was released. Compatibility Note

v4 is a complete rewrite, breaking compatibility with v3. A direct migration isn't supported; please opt to continue with v3 or start fresh with v4. V4's streamlined file-based and rule-based architecture aims to make new response configurations less burdensome.


Open-source, with care

This project is lovingly built and maintained by volunteers.
We hope it helps streamline your API development.
Please understand that the project has its own direction — while we welcome feedback, it might not fit every edge case 🌱

Acknowledgements

Depends on tokio / hyper / toml / serde / serde_json / json5 / console / rhai. In addition, mdbook (as to workflows).

Dependencies

~16–31MB
~394K SLoC