Twilio

Twilio is a web application programming interface (API) that software developers can use to add communications such as phone calling, messaging, video and two-factor authentication into their Python applications.

Twilio logo.

Why is Twilio a good API choice?

Interacting with the standard telephone networks to send and receive phone calls and text messages without Twilio is extremely difficult if you do not know the unique telecommunications protocols such as Session Initiation Protocol (SIP). Twilio's API abstracts the telecommunications pieces so as a developer you can simply use your favorite programming languages and frameworks in your application. For example, here's how you can send an outbound SMS using a few lines of Python code:

# import the Twilio helper library (installed with pip install twilio)
from twilio.rest import TwilioRestClient

# replace the placeholder strings in the following code line with 
# your Twilio Account SID and Auth Token from the Twilio Console
client = TwilioRestClient("ACxxxxxxxxxxxxxx", "zzzzzzzzzzzzz")

# change the "from_" number to your Twilio number and the "to" number
# to any phone number you want to send the message to 
client.messages.create(to="+19732644152", from_="+12023358536", 
                       body="Hello from Python!")

Learn more about the above code in the How to Send SMS Text Messages with Python tutorial.

How is Twilio's documentation for Python developers?

Twilio is a developer-focused company, rather than a traditional "enterprise company", so their tutorials and documentation are written by developers for fellow developers.

More Twilio resources

Disclaimer

I currently work at Twilio on the Developer Network and run a program called Twilio Voices.

您想了解有关集成或创建 API 的更多信息吗?

什么是Web应用程序编程接口(API)?

如何为 Web 应用程序创建 API?

如何将现有 Web API 集成到我的应用程序中?

Sign up for a monthly email with Full Stack Python tutorials. No spam ever.

Sponsored By

Rollbar logo

Fix errors in your Python code before your users see them by monitoring with Rollbar.

Learn More Python

Introduction to Ansible video course logo.

Deploy web apps with the Ansible configuration management tool.


TestDriven logo

Build microservices with Docker, Flask & React in this great course.

Full Stack Python

Full Stack Python is an open book that explains concepts in plain language and provides helpful resources for those topics.
Updates via newsletter, Twitter & Facebook.