What mitmproxy is for
Two primary uses in scraping:
- Mobile API discovery. Install the mitmproxy CA on an Android emulator or jailbroken iPhone, point the device proxy at mitmproxy, and use the target app. Every request becomes visible — endpoints, auth tokens, request signing schemes, pagination models. This is how scrapers discover unprotected mobile backends behind sites that pay Akamai for web protection.
- Web request inspection and replay. When debugging a flaky scraper, route it through mitmproxy and replay individual requests with header tweaks (the
rkey opens a request editor). Combined with the inline Python scripting API, you can rewrite requests on the fly without touching the scraper code.
mitmweb (the browser UI) is friendlier for one-off use; mitmproxy (the keyboard-driven TUI) is faster once learned; mitmdump is headless and useful 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 — free, scriptable, and unambiguously focused on the intercept-and-replay loop. Burp Suite's feature set overlaps but it's aimed at pen-testing and the price tag reflects that.
The certificate-pinning wall
Roughly half of mainstream mobile apps pin their TLS certificates — they ship with the expected server certificate hash baked in and refuse to talk to any other certificate. The mitmproxy CA you installed becomes invisible to the app, which shows a network error.
Three escalation steps when pinning blocks you:
- Try a different app version. Older versions of the same app frequently omit pinning. Sideload an APK from a few releases back via
apkpureor similar. - Frida + universal pinning bypass.
frida-serveron the device +fridantiroot.json the host disables bothokhttp3.CertificatePinnerand the JavaTrustManagerFactory. Works against most apps. See the mobile API scraping playbook for the full workflow. - objection / static reverse engineering. For native-code pinning (banking apps, some games), Frida's default scripts aren't enough.
objectioncovers more cases; novel pinning requires disassembly. At this point you're spending more on intercept than the scraping is worth.
