What mitmproxy is for
There are two main jobs it does in scraping:
- Mobile API discovery. Install mitmproxy's certificate (the credential a device trusts to verify HTTPS) on an Android emulator or jailbroken iPhone, point the device's proxy setting at mitmproxy, and use the target app normally. Every request becomes readable — the endpoints it calls, the auth tokens it sends, how it signs requests, how it pages through results. This is how scrapers find the unprotected mobile backends sitting behind sites that pay Akamai to protect their websites.
- Web request inspection and replay. When a scraper is misbehaving, route it through mitmproxy and re-send individual requests with tweaked headers (the
rkey opens a request editor). Using the inline Python scripting, you can rewrite requests on the fly without editing the scraper itself.
mitmweb (the browser UI) is the easiest for one-off use; mitmproxy (the keyboard-driven terminal UI) is faster once you learn it; mitmdump runs without a UI, which is handy in CI or scripted captures.
mitmproxy vs HTTP Toolkit vs Charles Proxy vs Burp Suite
Four tools cover the intercepting-proxy category, with overlapping use cases:
| Tool | Best for | Cost |
|---|---|---|
| mitmproxy | CLI/scripting, automation, repeatable captures | Free |
| HTTP Toolkit | GUI-driven mobile intercept; one-click device setup | Free + Pro ($10/mo) |
| Charles Proxy | Veteran GUI, polished macOS experience | $50 one-time |
| Burp Suite | Security recon, intruder/repeater, MCP server | Free / Pro $475/yr |
For scraping reconnaissance specifically, mitmproxy is the default — it's free, scriptable, and built squarely around the intercept-and-replay loop. Burp Suite can do the same things, but it's really a penetration-testing tool, and the price reflects that.
The certificate-pinning wall
Roughly half of mainstream mobile apps pin their TLS certificates — the app ships with the expected server certificate's fingerprint baked in and refuses to talk to anything else. That means mitmproxy's certificate, which you installed on the device, is rejected, and the app just shows a network error.
Three escalation steps when pinning blocks you:
- Try a different app version. Older versions of the same app often skip pinning. Sideload an APK (the Android install file) from a few releases back via
apkpureor similar. - Frida + certificate unpinning (for apps you are authorized to test). Frida is a tool that injects code into a running app. Running
frida-serveron the device plusfridantiroot.json your machine switches off bothokhttp3.CertificatePinnerand the JavaTrustManagerFactory— the two common pinning mechanisms. This works against most apps. See the mobile API scraping playbook for the full workflow. - objection / static reverse engineering. When pinning is built into native code (banking apps, some games), Frida's default scripts aren't enough.
objectionhandles more cases; truly custom pinning means disassembling the app by hand. By this point you're spending more effort on the intercept than the scraping is worth.
