Phone Number Carrier and Line Type with Python and the Telnyx Number Lookup Telnyx launched a Number Lookup API that returns carrier, line type, and portability data for any phone number in a single request, and released a Python Flask example with a 24-hour in-memory cache. The tool helps developers automate call routing, SMS deliverability checks, and lead enrichment by integrating carrier data directly into applications. Contact us https://telnyx.com/contact-us Log in https://portal.telnyx.com A phone number carrier lookup identifies the current network operator, line type, number type, and portability status tied to a phone number. Developers use it to decide whether a number can receive SMS, whether a call should route to an agent, and whether contact data is current before the first message or call goes out. The Telnyx Number Lookup API https://telnyx.com/products/number-lookup returns carrier, line type, and portability data for any phone number in a single request, using Telnyx carrier network data rather than only a third-party reseller feed. This walkthrough builds a Python Flask service that wraps that API with a 24-hour in-memory cache so repeat lookups are fast and do not create repeat API calls during the TTL. The full code is available in the Telnyx code examples repo: phone-number-lookup-python https://github.com/team-telnyx/telnyx-code-examples/tree/main/phone-number-lookup-python . The Flask app exposes three endpoints: | Method | Path | Purpose | |---|---|---| | POST | /lookup | Look up a number from a JSON body | | GET | /lookup/