This is a very small http server using only the python standard library that will return the ip (and some extra data) of the caller.
$ python3 iphinter.py &
[1] 1125059
Starting on address 0.0.0.0 port 7777
example: http://127.0.0.1:7777
$ curl http://127.0.0.1:7777
127.0.0.1 - - [08/Jun/2024 11:41:00] "GET / HTTP/1.1" 200 -
{
"ip": "127.0.0.1",
"headers": {
"Host": "127.0.0.1:7777",
"User-Agent": "curl/8.6.0",
"Accept": "*/*"
},
"path": "/"
}