A simple Python script to trace HTTP redirects, by spoofing actual browsers with curl_cffi.
$ pip install pyhttptracer
$ pyhttptracer -h
usage: pyhttptracer [-h] [-i INPUT_FILE] [-o OUTPUT_FILE] [-n]
[-d {desktop_and_mobile,desktop,mobile}] [-p PROXY]
[-w MAX_WORKERS]
[URL]
optional arguments:
-h, --help show this help message and exit
Input parameters:
URL Single URL target given as a positional argument
-i INPUT_FILE, --input-file INPUT_FILE
Input file
Output parameters:
-o OUTPUT_FILE, --output-file OUTPUT_FILE
Output file (default "./traced_redirects.txt")
-n, --no-verbose Do not display the chain (default "False")
Connection parameters:
-d {desktop_and_mobile,desktop,mobile}, --device {desktop_and_mobile,desktop,mobile}
Device(s) to use: "desktop_and_mobile", "desktop",
"mobile" (default: "desktop_and_mobile")
-p PROXY, --proxy PROXY
Proxy configuration (e.g "-p 'http://127.0.0.1:8080',
use "socks5h" scheme to make the proxy resolve DNS
requests")
-w MAX_WORKERS, --max-workers MAX_WORKERS
Number of parallel workers (default 10)
$ pyhttptracer "https://httpbingo.org/absolute-redirect/6"
[+] "https://httpbingo.org/absolute-redirect/6" | desktop
302 | location header -> "https://httpbingo.org/absolute-redirect/5"
302 | location header -> "https://httpbingo.org/absolute-redirect/4"
302 | location header -> "https://httpbingo.org/absolute-redirect/3"
302 | location header -> "https://httpbingo.org/absolute-redirect/2"
302 | location header -> "https://httpbingo.org/absolute-redirect/1"
302 | location header -> "https://httpbingo.org/get"
200 | final -> "https://httpbingo.org/get"
[+] "https://httpbingo.org/absolute-redirect/6" | mobile
302 | location header -> "https://httpbingo.org/absolute-redirect/5"
302 | location header -> "https://httpbingo.org/absolute-redirect/4"
302 | location header -> "https://httpbingo.org/absolute-redirect/3"
302 | location header -> "https://httpbingo.org/absolute-redirect/2"
302 | location header -> "https://httpbingo.org/absolute-redirect/1"
302 | location header -> "https://httpbingo.org/get"
200 | final -> "https://httpbingo.org/get"
$ cat traced_redirects.txt
https://httpbingo.org/absolute-redirect/5
https://httpbingo.org/absolute-redirect/4
https://httpbingo.org/absolute-redirect/3
https://httpbingo.org/absolute-redirect/2
https://httpbingo.org/absolute-redirect/1
https://httpbingo.org/get
- version 1.1 - 2026-07-04: Fixes
- version 1.0 - 2026-06-28: First commit
All trademarks, service marks, trade names and product names appearing on this repository are the property of their respective owners
pyhttptracer is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
pyhttptracer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU General Public License along with pyhttptracer. If not, see http://www.gnu.org/licenses/.
- Thomas Debize < tdebize at mail d0t com >