Connect Python to your Mobile Phone to send SMS eller WhatsApp
Transform Your Phone into an SMS and WhatsApp Gateway with SMS Mobile API
Easily send and receive SMS and send WhatsApp messages directly from your mobile phone using Python. Automate your communication effortlessly with a few simple lines of code!
Looking for a fast, secure, and simple way to send and receive SMS, or send WhatsApp messages using your mobile phone and Python? SMS Mobile API is the ultimate solution! It allows you to send SMS instantly, retrieve incoming SMS, and send WhatsApp messages, turning your phone into a powerful communication tool for convenience, automation, and reliability.
For at komme i gang skal du blot installere modulet med følgende kommando:
pip installer smsmobileapi
Før du bruger Python-modulet, skal du sørge for at downloade vores sikre og verificerede mobilapp på iOS og Android:
Vores app er verificeret af både Google og Apple, hvilket sikrer en stabil og sikker oplevelse, der respekterer dit privatliv. Uanset om du sender meddelelser eller automatiserer meddelelsesarbejdsgange, SMS Mobile API er den perfekte løsning til at styre SMS-kommunikation direkte fra din telefon med Python!
Eksempel Anmodning om at sende en SMS
Her er et eksempel på Python-kode til at sende en SMS ved hjælp af smsmobileapi modul:
Med denne kode, en SMS vil blive sendt direkte fra dit Python-script via din mobiltelefon, ved hjælp af dit telefonnummer.
Det betyder, at din kontaktperson kan svare dig direkte og SMS er gratis da den bruger dit mobilabonnement.
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
Example Request to Send a WhatsApp Message
Here is an example of Python code to send a WhatsApp message using the smsmobileapi modul:
With this code, a WhatsApp message will be sent directly from your Python script via your mobile phone, using your linked WhatsApp account.
This allows you to send messages effortlessly, and there are no per-message costs, as it uses your phone's WhatsApp connection.
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
Key Features
- WhatsApp Messages: Send messages directly via WhatsApp using your mobile connection.
- SMS Messages: Still need SMS? You can send both SMS and WhatsApp messages with ease.
- No Hidden Costs: Both SMS and WhatsApp messages are sent using your mobile plan—no per-message fees.
- Simple Integration: A few lines of Python code are all you need to get started.
Eksempel Anmodning om at hente modtaget SMS
Her er et eksempel på Python-kode til at hente SMS-beskeder modtaget på din mobiltelefon:
Med dette script kan du hente alle SMS-beskeder modtaget på din mobiltelefon i realtid, så du kan interagere med dine kontakters svar via SMS.
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