Using MITM API for fetching information

Hello Mitm folks,

I looked at documentation on API but was not clear. The use case that I have is to have an API call (using Python) to capture the following information and store as log file (txt human readable).

  1. Redirection chains - The urls that were seen as traces that we see in command line
  2. Capture each request, response, IPs etc in readable text format.

The sample I am thinking of is to query the captured “saved” MITM Proxy traces.

def getAllRedirectionUrl()
“Will give me all redirection url of the traces”

def getSingleUlrFromTheChain(index)
“Will get single url from the chain from the index chain”

def getRequestorResponseFromTheChain(request[or response], Index)
“Will get provided index request or response”

def toString(input)
“Will provide human-readable toString text form for a provided input file or above-queried information”

Any insights?

Thanks
Bhupendra