Benchmark your APIs with confidence. A lightweight, serverless-ready, and stateless tool built with Next.js 15+ and Autocannon to measure and compare API performance in real-time.
- 🚀 Instant Execution: Run load tests immediately from your browser using Bun's fast runtime.
- 📊 Visual Analytics: Beautiful, interactive charts for latency, throughput, and error rates using Recharts.
- 🔄 Side-by-Side Comparison: Compare up to 5 APIs sequentially to ensure accuracy and performance parity.
- 🔒 Secure & Stateless: Zero data persistence. Built-in SSRF protection blocks internal network requests.
- 📥 Export Results: Download your benchmark results as CSV for further analysis.
- 🎨 Modern UI: Sleek, responsive design built with Tailwind CSS 4 and Geist font.
- Framework: Next.js 16 (App Router)
- Runtime: Bun
- Benchmarking Engine: Autocannon
- Styling: Tailwind CSS 4
- Components: Base UI, Shadcn UI
- Charts: Recharts
- Icons: Tabler Icons
- Validation: Zod
- Bun installed on your machine.
-
Clone the repository:
git clone https://github.com/farhan-nahid/api-benchmark cd api-benchmark -
Install dependencies:
bun install
-
Run the development server:
bun dev
Open http://localhost:3000 with your browser to see the result.
- Navigate to
/test. - Enter your API endpoint URL.
- Configure duration, connections, headers, and body (optional).
- Click Start Benchmarking.
- Navigate to
/compare. - Add up to 5 API endpoints.
- Configure the common test parameters.
- Click Compare APIs to run them sequentially.
This tool implements strict URL validation to prevent Server-Side Request Forgery (SSRF).
- Blocked: Internal hostnames (
localhost,127.0.0.1), private IP ranges, and cloud metadata endpoints. - Allowed: Publicly accessible
httpandhttpsURLs.
Available scripts:
bun dev: Starts the development server.bun build: Builds the application for production.bun start: Starts the production server.bun lint: Runs ESLint.bun format: Formats code with Prettier.bun typecheck: Runs TypeScript type checking.
This project is open-source and available under the MIT License.