Learn Before
Concept

Getting the Service Provider Name Using the phonenumbers Library

To retrieve the service provider (carrier) name of a phone number in Python, use the carrier module from the phonenumbers library. First, parse the phone number string using phonenumbers.parse(), then call carrier.name_for_number() with the parsed object.

import phonenumbers from phonenumbers import carrier number = "+country code phonenumber" parsed_number = phonenumbers.parse(number, "RO") print(carrier.name_for_number(parsed_number, "en"))

0

1

Updated 2026-07-06

Tags

Python Programming Language

Data Science