Menu

Expand
Rate this page:

Lookup: Validation and Formatting

Twilio Lookup can help you check that phone numbers you receive from your users are real. It can also provide you with the local format of an international phone number.

This guide will show you how to perform both kinds of lookups. You can skip to the carrier and caller name guide to learn about other information Lookup can provide about a phone number.

Validate a national phone number

Given a national phone number and an ISO country code, Lookup will confirm the phone number is valid and return the number in its E.164 format.

        
        
        
        

        If the number is invalid, this request will return an HTTP 404 status code.

        If you plan to store the phone number after validating, we recommend storing the full E.164 formatted number returned in the phone number field. Most other Twilio services require the E.164 format for phone numbers.

        Format an International Phone Number

        If you send Lookup an internationally formatted phone number, you can get the correct national format for that phone number from the national format field.

              
              
              
              

              Though most other Twilio services require the E.164 formatted number, the national format is often better to display to end users.

              Lookup can tell you even more about a phone number. Check out the carrier and caller name guide to learn how.

              Andrew Baker Kelley Robinson Kat King
              Rate this page:

              Need some help?

              We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd browsing the Twilio tag on Stack Overflow.

                    
                    
                    

                    Thank you for your feedback!

                    We are always striving to improve our documentation quality, and your feedback is valuable to us. How could this documentation serve you better?

                    Sending your feedback...
                    🎉 Thank you for your feedback!
                    Something went wrong. Please try again.

                    Thanks for your feedback!

                    Refer us and get $10 in 3 simple steps!

                    Step 1

                    Get link

                    Get a free personal referral link here

                    Step 2

                    Give $10

                    Your user signs up and upgrade using link

                    Step 3

                    Get $10

                    1,250 free SMSes
                    OR 1,000 free voice mins
                    OR 12,000 chats
                    OR more