Add a “Mock These APIs” Button
If your project includes an OpenAPI (Swagger) spec file, you can help other developers test or integrate faster by embedding a “Mock These APIs” button.
This button opens the Beeceptor OpenAPI Mock Server with your spec’s URL pre-filled. Users can spin up a mock server with AI powered responses, linked to 300+ dynamic test data generators.
How It Works 🔧
- You add a link with a special URL containing the direct link to your OpenAPI YAML/JSON file.
- The Beeceptor mock server downloads your spec and prepares a mock API endpoint automatically.
- Your API consumers (or developers) get an HTTP base URL with all APIs hosted. This can be used for testing, demos, integrations, or sandboxing.
Markdown Example (e.g. GitHub README)
Use this snippet in any .md file like README.md:
## 🧪 Try the Mock API
[](https://beeceptor.com/openapi-mock-server/?url=https://raw.githubusercontent.com/YOUR-ORG/REPO/refs/heads/main/api.yaml)
Replace the url=
value with your own raw OpenAPI YAML/JSON link.
HTML Example (e.g. Developer Portal or Static Docs)
Use this snippet in any .html file:
<h2>🧪 Try the Mock API</h2>
<a href="https://beeceptor.com/openapi-mock-server/?url=https://raw.githubusercontent.com/YOUR-ORG/REPO/refs/heads/main/api.yaml" target="_blank">
<img src="https://cdn.beeceptor.com/assets/images/buttons/mock-openapi-with-beeceptor.png" alt="Mock These APIs Instantly" style="height: 60px;">
</a>
You can embed this into static documentation tools like Docusaurus, Hugo, or Jekyll.
Preview
