Library
GitHub · github.comsaved Jul 13, 2026archived

GitHub - littledivy/mimic: Intercept any app, then call it from Python like a library

Intercept any app, then call it from Python like a library - littledivy/mimic

github.com/littledivy/mimic

Archived text635 words

Intercept any app, then call it from Python like a library. from hinge_client import Hinge acc = Hinge() # reuses your captured session recs = acc.get_recommendations() acc.like(subject_id, comment="hi lol") You don't write hinge_client.py. mimic captures your own app traffic and an AI generates the client from it. Most apps authenticate every request with the same bundle of values: a bearer token, some device ids, a session id, cookies. They're stable across calls. Capture them once from a real request you made, and you can replay them on new requests to the same API. capture traffic -> extract auth -> generate client (mitmproxy) (mimic.Session) (claude reads the captured endpoints) The generated client is plain Python on top of mimic.App, and you edit it like any other file. It gives you named methods, body templates, and the multi-step call chaining mobile APIs tend to need (fetch a token in one call, spend it in the next). Installs uv if you don't have it, then mimic in an isolated tool env. mitmproxy isn't a separate install; mimic launches it via uvx on first record. (Manual: uv tool install mimic-client.) mimic doctor # confirm proxy + claude are ready mimic record # starts the proxy, prints the iPhone steps record fills in your Mac's LAN IP and walks you through it: iPhone -> Wi-Fi -> Configure Proxy -> Manual -> <your-mac-ip>:8080 Safari -> http://mitm.it -> install the Apple profile Settings -> General -> About -> Certificate Trust Settings -> turn on full trust for mitmproxy. This step is easy to miss and nothing works without it. open the app, use it normally mimic hosts # list captured hosts; pick your API host mimic learn prod-api.hingeaws.net # see the endpoints mimic saw mimic gen prod-api.hingeaws.net # generate hinge_client.py Then from hinge_client import Hinge; Hinge().get_recommendations(). Three ways to build a session by hand, if you don't want codegen: from mimic import Session Session.from_mitm("prod-api.hingeaws.net") # pull auth from mitmweb Session.from_curl(open("copied.txt").read()) # paste "Copy as cURL" from devtools Session(base_url="https://x.com", headers={...}) # explicit .get(path), .post(path, json=...), and the other common HTTP verb helpers return parsed JSON and raise requests.HTTPError for failed responses. If your token rotates, a 401 on an idempotent request triggers one re-pull from mitmweb and a retry.…

crawled Sep 8, 2026

Related sites

Nearest neighbours by embedding distance, computed at index time.