Python API for Omegle webchat
Switch branches/tags
Nothing to show
Clone or download
Latest commit de02ec6 Mar 11, 2015
Failed to load latest commit information.
pyomegle Renamed function and fixed comments Mar 11, 2015
.gitignore Initial commit Mar 7, 2015
LICENSE Initial commit Mar 7, 2015 Updated README Mar 11, 2015 Fixed class name Mar 8, 2015


Python API for Omegle webchat. Inspired by brianewing.


$ pip install pyomegle

pyomegle depends on mechanize. For this reason Python 3 is currently not supported.


from pyomegle import OmegleClient, OmegleHandler

    Omegle inteface for python

        starts a new conversation
        exits chat session

h = OmegleHandler(loop=True)            # session loop
c = OmegleClient(h, wpm=47, lang='en')  # 47 words per minute

while 1:
    input_str = raw_input('')           # string input

    if input_str.strip() == '/next':                        # new conversation
    elif input_str.strip() == '/exit':
        c.disconnect()                  # disconnect chat session
        c.send(input_str)               # send string


List of events accessible by OmegleHandler. Note that OmegleHandler uses a loop optional parameter, valid for start a new chat when a stranger disconnects.

  • waiting() Called when we are waiting for a stranger to connect
  • connected() Called when we are connected with a stranger
  • typing() Called when the user is typing a message
  • stopped_typing() Called when the user stop typing a message
  • message(message) Called when a message is received from the connected stranger
  • common_likes(likes) Called when you and stranger likes the same thing
  • disconnected() Called when a stranger disconnects
  • captcha_required() Called when the server asks for captcha
  • captcha_rejected() Called when server reject captcha
  • server_message(message) Called when the server report a message
  • status_info(status) Status info received from server
  • ident_digest(digests) Identity digest received from server

Inherit OmegleHandler class for implement your custom events.

class MyCustomHandler(OmegleHandler):

    def connected(self):
        super(MyCustomHandler, self).connected()



OmegleClient uses some optional initial parameters, the most useful are

  • lang='en' for set a default chat language
  • wpm=42 set the words per minutes typing speed
  • topics=[] list of interests
  • event_delay=3 server polling delay in seconds

List of client methods

  • start() Start a new conversation
  • status() Return connection status
  • write(message) Simulates a message completely written whit typing time
  • typing() Emulates typing in the conversation
  • stopped_typing() Emulates stopped typing into the conversation
  • send(message) Sends a message
  • recaptcha(challenge, response) Captcha validation
  • next() Starts with a new conversation
  • disconnect() Disconnect from the current conversation


pyomegle is released under the MIT License.