
将 Python 连接到您的手机以发送 短信 或者 WhatsApp
使用 SMS Mobile API 将您的手机转变为 SMS 和 WhatsApp 网关
轻松发送和接收 短信 并发送 WhatsApp 使用 Python 直接从手机发送消息。只需几行简单的代码即可轻松实现通信自动化!
寻找一种快速、安全且简单的发送和接收方式 短信或发送 WhatsApp 使用手机和 Python 发送消息? 短信移动API 是终极解决方案!它允许您发送 短信 立即检索传入 短信并发送 WhatsApp 信息,将您的手机变成一个方便、自动化和可靠的强大通讯工具。
要开始使用,只需使用以下命令安装模块:
pip 安装 smsmobileapi
在使用 Python 模块之前,请确保在 iOS 和 Android 上下载我们安全且经过验证的移动应用程序:


我们的应用程序经过 Google 和 Apple 的验证,确保稳定、安全的体验,尊重您的隐私。无论您是发送通知还是自动化消息传递工作流程, SMS Mobile API 是管理短信通信的完美解决方案 直接使用 Python 从你的手机中获取!
发送短信的请求示例
下面是使用 Python 代码发送短信的示例 短信移动应用接口 模块:
使用此代码, 短信将直接通过你的 Python 脚本通过手机发送,使用您的电话号码。
这意味着你的联系人可以直接回复你,并且 短信是免费的 因为它使用您的移动计划。
from smsmobileapi import SMSSender
# Initialize the SMS sender with your API key
sms = SMSSender(api_key='YOUR_API_KEY')
# Send an SMS
response = sms.send_message(to='PHONENUMBER', message='Hello from Python!')
print(response) # This will print the response from the API
发送 WhatsApp 消息的示例请求
下面是使用以下代码发送 WhatsApp 消息的 Python 代码示例 短信移动应用接口 模块:
使用此代码, WhatsApp 消息将直接通过你的 Python 脚本通过你的手机发送,使用您关联的 WhatsApp 帐户。
这使得你能够毫不费力地发送消息,并且 无需支付每条消息的费用,因为它使用您手机的 WhatsApp 连接。
from smsmobileapi import SMSSender
# Initialize the SMS sender with your API key
sms = SMSSender(api_key='YOUR_API_KEY')
# Send a WhatsApp message
response = sms.send_message(to='PHONENUMBER', message='Hello from Python via WhatsApp!', sendwa=1, sendsms=0)
print(response) # This will print the response from the API
主要特点
- WhatsApp 消息: 使用您的移动连接直接通过 WhatsApp 发送消息。
- 短信: 还需要短信吗?您可以轻松发送短信和 WhatsApp 消息。
- 无隐藏费用: SMS 和 WhatsApp 消息均使用您的移动套餐发送 - 无需支付每条消息的费用。
- 简单集成: 只需几行 Python 代码即可开始使用。
检索收到的短信的示例请求
以下是检索手机上收到的短信的 Python 代码示例:
使用此脚本,您可以 检索手机上收到的所有短信 实时地,让您通过短信与联系人的回复进行互动。
from smsmobileapi import SMSSender
# Initialize the SMS sender with your API key
sms = SMSSender(api_key='YOUR_API_KEY')
# Retrieve received SMS messages
received_messages = sms.get_received_messages()
print(received_messages) # This will print the list of received SMSx