Send an SMS Using Python

The TextMagic API Python wrapper can save you a lot of time, as it includes all the necessary API commands and tests. It only takes a few seconds to download it from GitHub and to install it into your own app or software. After installation, you'll then be able to send text messages.

Get it now on GitHub
Python logo

Installation Instructions

Quick Installation

Run the following command to install the TextMagic Python helper using pip, a package management system used to install and manage software packages written in Python:

pip install textmagic

Manual Installation

You can also install the TextMagic Python helper from the GitHub repository using git. Run the following commands:

git clone [email protected]:textmagic/textmagic-rest-python.git
cd textmagic-python
python install


The Python wrapper for the TextMagic API has the following requirements:

  • Python 2.6 or higher

Sending an SMS using Python (an example)

Below is an example of how to send a text message using Python.

from import TextmagicRestClient
username = "your_textmagic_username"
token = "your_apiv2_key"
client = TextmagicRestClient(username, token)
message = client.messages.create(phones="9990001001", text="Hello TextMagic")


If you need help with the wrapper, or if you have any suggestions for improvements and/or if you have enquiries regarding the Python SMS API, please contact us by emailing¬†[email protected].