LINE manual


line is a python library that allow you to send and receive a LINE message. With line you can use LINE on any systems like Ubuntu or make your own LINE bot which will automatically reply for your message!

Enjoy line and May the LINE be with you...


Some codes are removed because of the request of LINE corporation. (2014.08.08)

Key Features

  • login to LINE server
  • get a list of contact, group or chat room
  • send and receive a message or sticker
  • invite, join or leave a group or room
  • longPoll method which will allow you to make a LINE bot easily


  • Sending a Image
  • More usable methods and objects


First, you need to install Apache Thrift. Install instructions are here. (This might take some time...)


$ pip install line

Or, you can use:

$ easy_install line

Or, you can also install manually:

$ git clone git://
$ cd LINE
$ python install

Indices and tables

Echo bot example

from line import LineClient, LineGroup, LineContact

   client = LineClient("ID", "PASSWORD")
   #client = LineClient(authToken="AUTHTOKEN")
   print "Login Failed"

while True:
   op_list = []

   for op in client.longPoll():

   for op in op_list:
      sender   = op[0]
      receiver = op[1]
      message  = op[2]

      msg = message.text
      receiver.sendMessage("[%s] %s" % (, msg))


Source codes are distributed under BSD license.


Taehoon Kim / @carpedm20