# Using mitmproxy APIs

**URL:** https://discourse.mitmproxy.org/t/using-mitmproxy-apis/813
**Category:** help
**Created:** [January 26, 2018, 11:04am UTC](https://discourse.mitmproxy.org/t/using-mitmproxy-apis/813 "2018-01-26T11:04:24Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![H0nus](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mitmproxy.org/h0nus/32/265_2.png) [@H0nus](https://discourse.mitmproxy.org/u/H0nus)
#### Post date: [January 26, 2018, 11:04am UTC](https://discourse.mitmproxy.org/t/using-mitmproxy-apis/813/1 "2018-01-26T11:04:24Z")

</div>

I have just a question, can i use mitmproxy (the lib) in python, without using mitmproxy to fire it up?  
If yes, how? I din’t find much on internet, and i didn’t uderstand much on official api docs.  
An example: i wrote a little script with `import mitmproxy` and some other things with his api and classes;  
Can i use it on my own (like: `python3.6 file.py` ) or I need to use mitmproxy? (like: `mitmproxy -s file.py` )  
Sorry for bad english or anything.

---

<div class="post-metadata">

### Author: ![mhils](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mitmproxy.org/mhils/32/7_2.png) [@mhils](https://discourse.mitmproxy.org/u/mhils)
#### Post date: [January 26, 2018, 12:07pm UTC](https://discourse.mitmproxy.org/t/using-mitmproxy-apis/813/2 "2018-01-26T12:07:22Z")

</div>

You can use mitmproxy as a library, what exactly you want to do really depends on what you are actually trying to achieve. In general, just running mitmproxy itself will probably be easier. 🙂

---

<div class="post-metadata">

### Author: ![H0nus](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mitmproxy.org/h0nus/32/265_2.png) [@H0nus](https://discourse.mitmproxy.org/u/H0nus)
#### Post date: [January 26, 2018, 5:45pm UTC](https://discourse.mitmproxy.org/t/using-mitmproxy-apis/813/3 "2018-01-26T17:45:10Z")

</div>

Ok, so it’s possible to use it like in a external tool/script (so starting the server too and similar things) ? withot using directly the binaries (mitmdump,mitmproxy,mitmweb)
