The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.


SkypeAPI - Skype API simple implementation, only support windows platform now.




    use SkypeAPI;
    my $skype = SkypeAPI->new();
    print " skype available=", $skype->attach , "\n";
    my $command = $skype->create_command( { string => "GET USERSTATUS"}  );
    print  $skype->send_command($command) , "\n";
    $command = $skype->create_command( { string => "SEARCH CHATS"}  );
    print $skype->send_command($command) , "\n";


SkypeAPI->new( )

Returns a SkypeAPI object.

    my $skype = SkypeAPI->new();

SkypeAPI->attach( )

Attach to skype, return 1 if attached ok.

SkypeAPI->send_command( $command_object, [$try_times] )

Send command to skype, return the reponse of skype

It sometimes failed when sending message to skype, so we have to retry sending message. $try_times default is 10.

SkypeAPI->create_command( $opt )

Create command. $opt is a hashref. You can defind the command string, timeout in it.

timeout default is 10 seconds.

    my $command = $skype->create_command( { string => "SEARCH CHATS", timeout => 5}  );

SkypeAPI->register_handler( $ref_callback )

Add listener to the chain of message handler.

    sub handler {
        my $skype = shift;
        my $msg = shift;
        my $command = $skype->create_command( { string => "GET USERSTATUS"}  );
        print $skype->send_command($command) , "\n";

SkypeAPI->listen( )

After you register handlers, call $skype->listen to enter the message loop;


SkypeAPI->stop_listen( )

Call stop_listen in your handler to exit the message loop

    sub handler {
        my $skype = shift;
        my $msg = shift;


A Perl simple implementation of the Skype API, working off of the canonical Java and Python implementations. It is a encapsulation of Windows message communication between Skype and client applications. This version of SkypeAPI only implement some commands of SKYPE API, you can implement the others using SkypAPI->send_command


None by default.


You can find the in the lib/../t/, run it and your skype will become a xiaoi robot :)

the robot needs the module XiaoI, please install it first, See


For more command information, See

The svn source of this project, See


laomoi ( )


Copyright (C) 2008 by laomoi

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itinstance, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.