Capture Douyin Hotspot Data on Android with Charles, Appium & mitmproxy

This tutorial explains how to use Charles proxy, Appium automation, and mitmproxy to intercept and extract real‑time hotspot rankings from the Douyin Android app, covering tool installation, proxy configuration, certificate setup, and script execution steps.

Python Crawling & Data Mining
Python Crawling & Data Mining
Python Crawling & Data Mining
Capture Douyin Hotspot Data on Android with Charles, Appium & mitmproxy

In this guide the author demonstrates a simple method for analyzing and capturing data from an Android app, using Douyin (TikTok) as an example to retrieve its hotspot ranking list.

First, install Charles proxy, a paid network‑capture tool that is easy to use. After installation, configure the proxy on the computer via Proxy → Proxy Settings .

On the Android device, set the proxy to the computer’s IP address and port 8888 , ensuring both devices are on the same LAN.

Install the required SSL certificates on both the PC and the phone. On the PC, go to Help → SSL Proxy → Install Charles Root Certificate . On the phone, select Help → SSL Proxy → Install on mobile device , open chls.pro/ssl in a browser to download the certificate, then install it via Settings → Security → Install from SD card .

Launch Charles, open the Douyin app’s hotspot page, and the data request can be seen in Charles, returning 50 items at once. The request URL is displayed in the tool.

The interface only returns the current snapshot of hotspot data; obtaining newer data requires changing complex request parameters, which is beyond the scope of this article.

To automate data collection, combine Appium for device control with mitmproxy for interception. The Appium script (shown in the image) repeatedly fetches the latest hotspot information, while the mitmproxy script (shown in the image) filters traffic.

Key points for the mitmproxy script:

Before capturing, set the phone’s proxy port to 8080 .

Include the first two lines in the script to enable external functions.

Use if url in flow.request.url to identify Douyin hotspot requests.

Execute the script from its directory as illustrated.

After running the Appium automation script, the data capture process is complete.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

Mobile DevelopmentAndroidmitmproxyAppiumCharles ProxyDouyinData Capture
Python Crawling & Data Mining
Written by

Python Crawling & Data Mining

Life's short, I code in Python. This channel shares Python web crawling, data mining, analysis, processing, visualization, automated testing, DevOps, big data, AI, cloud computing, machine learning tools, resources, news, technical articles, tutorial videos and learning materials. Join us!

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.