Developer-first HTTP interception and mocking for iOS.
Capture, inspect, debug, and mock network requests with zero configuration and zero dependencies.
Inspectly is a lightweight HTTP inspector and API stubbing toolkit for iOS.
It automatically captures network traffic, provides a beautiful in-app inspector, and allows you to create and manage mocked API responses directly from live requests.
Built on top of the Foundation networking stack, Inspectly works seamlessly with URLSession, Alamofire, AFNetworking, and any networking layer powered by Foundation.
- Automatic request interception with zero setup
- Zero external dependencies
- In-app inspector UI for Requests, Statistics, Stubs, and Settings
- Request and response inspection including headers, bodies, timing, and metadata
- Rich HTML Rendering — interactive preview for HTML responses
- Smart Content Detection — automatic content-type sniffing when server headers are misleading
- Sensitive Header Masking —
Authorization,Cookie,X-Api-Keyand other sensitive headers are hidden by default with a per-header reveal toggle
- Search, filter, sort, favorite, pin, and tag captured requests
- Paginated request list with auto-load-more
- Export logs as JSON directly from the app
- Create stubs directly from any captured request in one tap
- Flexible URL Matching — match stubs by
Exact,Contains,Prefix,Suffix, orRegexURL pattern - All requests with matching URLs are automatically marked as stubbed
- Enable, disable, duplicate, group, and manage stubs
- Export stubs as JSON for sharing or version control
- Slow Request Detection — configurable threshold highlights slow requests with visual indicator
- Network Throttling — simulate Edge, 3G, LTE, or custom bandwidth/delay conditions
- Performance Heatmap — top 5 slowest endpoints with color-coded average response time bars
- Duplicate Detector — surfaces endpoints called multiple times with a repeat count badge
- Large Response Warning — flags responses over 1 MB in Statistics and the request list
- Timeline view for DNS, connect, TLS, TTFB, and transfer phases
- cURL export with correct shell escaping for all requests
- Response Body Search — full-text search inside JSON/plain-text responses with next/prev highlight navigation
- Full-Text Search — search across URL, method, host, status code, request body, response body, and error messages
- Configure max stored requests (100–2500)
- Ignore specific hosts from being captured
- Light / Dark / System theme override
- Auto-prettify JSON responses
- iOS 13.0+ (Swift Package Manager minimum deployment target)
- The inspector UI requires iOS 16.0+. On iOS 13–15,
Inspectly.enable()and request capture/stubbing still run in the background, butpresentInspector()shows an alert instead of the inspector. - Swift 5.9+
- Xcode 15+
dependencies: [
.package(url: "https://github.com/balitax/Inspectly.git", from: "1.3.2")
]Then add Inspectly to your target dependencies.
import Inspectly
@main
struct MyApp: App {
init() {
Inspectly.enable()
}
var body: some Scene {
WindowGroup {
ContentView()
}
}
}Inspectly.presentInspector()import Inspectly
@main
struct MyApp: App {
init() {
#if DEBUG
Inspectly.enable()
#endif
}
var body: some Scene {
WindowGroup {
ContentView()
}
}
}import Inspectly
let configuration = Inspectly.Configuration(
isLoggingEnabled: true,
isStubEnabled: true,
ignoredHosts: ["example.com"],
isShakeGestureEnabled: true,
ignoreLocalhost: true
)
Inspectly.enable(with: configuration)| Option | Type | Default | Description |
|---|---|---|---|
isLoggingEnabled |
Bool |
true |
Enable or disable request capture |
isStubEnabled |
Bool |
true |
Enable or disable request stubbing globally |
networkThrottlingPreset |
NetworkThrottlingPreset |
.off |
Simulate network conditions (Edge, 3G, LTE, Custom) |
slowRequestThreshold |
TimeInterval |
1.0 |
Duration (seconds) above which requests are flagged as slow |
maxStoredRequests |
Int |
500 |
Maximum number of requests retained in storage |
ignoredHosts |
[String] |
[] |
Hosts to exclude from capture |
isShakeGestureEnabled |
Bool |
true |
Open the inspector by shaking the device |
ignoreLocalhost |
Bool |
false |
Ignore localhost and 127.0.0.1 |
stubRepository |
StubRepositoryProtocol? |
nil |
Provide a custom stub repository |
Inspectly.enable(isEnabled:with:)Inspectly.disable()Inspectly.presentInspector(rootView:)Inspectly.isEnabledInspectly.container
Inspectly works with:
URLSession- Alamofire
- AFNetworking
- Any networking library built on top of Foundation
No custom interceptor setup is required for common use cases.
| Demo App | Requests | Request Detail |
|---|---|---|
![]() |
![]() |
![]() |
| Statistics | Stubs | Settings |
|---|---|---|
![]() |
![]() |
![]() |
- Enable Inspectly in your app
- Trigger real API calls
- Open the inspector using
Inspectly.presentInspector()or shake gesture (if enabled via configuration) - Browse captured requests
- Create a stub from an existing request
- Adjust the mocked response in the Stubs tab
- Re-run the flow with stubs enabled
- Security — masked sensitive headers in JSON export/share (previously only
curlCommandand the UI masked them), excluded stored request data from device backups and added file protection, and hardenedHTMLPreviewView's WKWebView against navigating away from a malicious/MITM'd response body. - Cleanup — removed the dead
NetworkObserverServicesubsystem, a stale commented-out UI block, and an unused property. - Refactor — split
SettingsView,StatisticsView,RequestListView, andInspectlyURLProtocolinto smaller per-section/per-responsibility files with no behavior change.
- Restored iOS 13.0 minimum deployment target —
Package.swiftis SPM-installable again from iOS 13. The inspector UI still requires iOS 16.0+ (all Views/ViewModels are@available(iOS 16.0, *)); on iOS 13–15,presentInspector()shows an alert instead of crashing or silently no-op'ing, while request capture and stubbing keep running viaenable().
- Performance Heatmap — top 5 slowest endpoints visualized as color-coded bars (green < 500ms, orange < 2s, red ≥ 2s)
- Duplicate Detector — groups requests by method + URL and surfaces repeated calls with a count badge
- Large Response Warning — responses over 1 MB are flagged in the Statistics view and marked with a warning indicator in the request list
- Response Body Search — full-text search inside JSON and plain-text responses with next/prev highlight navigation and a fixed search bar
- Floating tab bar now hides automatically when entering Request Detail
- Dismiss tab added to the floating tab bar for quick close
- Fixed next/prev highlight scroll in response body search
- Settings: removed Shake to Open toggle from UI (still configurable via
Inspectly.Configuration)
- iOS 16.0 minimum — dropped iOS 13–15 support
- Liquid glass-inspired floating tab bar for iOS 16–25
- Inspector now presents fullscreen
- Revamped DemoApp with card layout and response console
- Fixed dark mode statistics cards visibility
- Converted
StorageManagertoactor(eliminates Sendable warnings) - Removed all redundant
@availableannotations
- Flexible stub URL matching: Exact, Contains, Prefix, Suffix, Regex
- Batch-mark all matching URL requests as stubbed when a stub is saved
- Clearing all requests now also clears all stubs
- Configurable slow request detection threshold (Settings → Performance)
- Search covers response body, request body, and error messages
- Sensitive header masking with per-header reveal toggle
- Paginated request list with auto-load-more
- Configurable max stored requests (100–2500)
- cURL export with correct shell escaping
- Full UI revamp: Request Detail, Request List, Statistics, Stubs, Settings
- Initial release
Contributions are always welcome.
If you would like to improve the UI, add new features, improve performance, or fix bugs, feel free to open an issue or submit a pull request.
Inspectly is available under the MIT license. See LICENSE for more information.
Made with ❤️ by Agus Cahyono






