line-bot-sdk
LINE Messaging API SDK for Python
What it is and what it does
line-bot-sdk is the official Python client library for LINE's Messaging API, designed to simplify bot development on the LINE platform. It provides webhook parsing and event handling, message sending, and access to LINE's messaging features. The SDK abstracts away HTTP details and signature verification, letting developers focus on bot logic.
The package is built on requests, urllib3, aiohttp, pydantic, and other dependencies, supporting both synchronous and asynchronous workflows. It is actively maintained and supports Python 3.10 through 3.14. Developers typically use it to receive webhook events from LINE, parse them into typed event objects, and reply with formatted messages via the MessagingApi client.
Use it for:
- Build a LINE chatbot that echoes or processes user messages in real time.
- Create a customer support bot that routes inquiries to different handlers based on message type.
- Send rich, templated messages to LINE users from a backend service.
- Parse and respond to LINE follow/unfollow and postback events for interactive bot flows.
- Integrate LINE messaging into a web application with webhook callbacks.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
SDK for building LINE bots that handles webhook parsing, event routing, and message sending through LINE's Messaging API.
Yes. The SDK is production-stable (Apache 2.0, active maintenance, no known vulnerabilities), has low install friction, and is the canonical way to build LINE bots in Python. Install it if you are building any LINE bot or integrating LINE messaging into a Python application.
Install
line-bot-sdk on PyPI
pip
pip install line-bot-sdkuv
uv add line-bot-sdkpoetry
poetry add line-bot-sdkInstalling line-bot-sdk
Before you install
Low install friction with a pure-Python wheel distribution. Actively maintained with recent releases (last commit 2026-08-14, 2129 stars). Supports Python 3.10–3.14 with 8 runtime dependencies including requests, urllib3, aiohttp, and pydantic.
License in practice
Apache License 2.0 (permissive) allows commercial and private use, modification, and distribution with minimal restrictions—suitable for production bot projects.
Quickstart
pip install line-bot-sdk
from line_bot_sdk.v3 import WebhookHandler
from line_bot_sdk.v3.messaging import Configuration, ApiClient, MessagingApi, ReplyMessageRequest, TextMessage
handler = WebhookHandler('YOUR_CHANNEL_SECRET')
configuration = Configuration(access_token='YOUR_CHANNEL_ACCESS_TOKEN')
@handler.add(MessageEvent, message=TextMessageContent)
def handle_message(event):
with ApiClient(configuration) as api_client:
line_bot_api = MessagingApi(api_client)
line_bot_api.reply_message_with_http_info(
ReplyMessageRequest(
reply_token=event.reply_token,
messages=[TextMessage(text=event.message.text)]
)
)
Requires Python >= 3.10.0 and valid LINE channel credentials (access token and channel secret).
Verify before relying
- Whether the SDK handles rate limiting or retry logic automatically for API calls.
- Specifics on async support beyond aiohttp dependency (e.g., async/await patterns in handlers).
- Whether FlexMessage and RichMenu JSON deserialization covers all message types or has known gaps.
- Full scope of message types and features supported by the MessagingApi client.
Package facts
| License | Apache License 2.0 (permissive) |
| Python support | supports the current Python release (>=3.10.0) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 8 — requests, urllib3, aiohttp, future, pydantic, aenum, python_dateutil, Deprecated |
| Maintenance | actively maintained — 38 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 11,317,145/month — #1,399 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: line_bot_sdk-3.25.0-py2.py3-none-any.whl
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
pywaPyWa is a fully-typed Python framework for…
permissive · top 15,000 on PyPI
dingtalk-streamPython SDK for building DingTalk chatbots and…
permissive · top 15,000 on PyPI
fastapi-poeImplements the Poe protocol using FastAPI,…
permissive · top 15,000 on PyPI
botbuilder-coreProvides the core SDK for building bots that…
permissive · top 5,000 on PyPI
pyTelegramBotAPIA Python library that wraps the Telegram Bot…
copyleft · top 5,000 on PyPI
slackwebSends messages to Slack channels via incoming…
permissive · top 15,000 on PyPI
wecom-aibot-python-sdkA Python SDK for WeChat Work (企业微信) AI bot that…
permissive · top 15,000 on PyPI
botframework-streamingProvides streaming protocol support for…
permissive · top 5,000 on PyPI
python-telegram-botProvides a pure Python asynchronous interface…
copyleft · top 1,000 on PyPI
slackclientProvides Python interfaces to Slack's Web API…
permissive · top 5,000 on PyPI