I'm searching for a package that can detect the country of a contact number without Knowing the country code or default region, while also being cost-effective in c#

Bharathi Hattikal 40 Reputation points
2025-02-18T06:51:38.2466667+00:00

I'm searching for a package that can detect the country of a contact number without Knowing the country code or default region, while also being cost-effective in c#

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
11,305 questions
{count} votes

Accepted answer
  1. Jiale Xue - MSFT 48,966 Reputation points Microsoft Vendor
    2025-02-18T09:32:46.08+00:00

    Hi @Bharathi Hattikal , Welcome to Microsoft Q&A,

    Microsoft does not have such an API yet. Consider using libphonenumber-csharp - a C# port of Google's libphonenumber. It can parse and validate phone numbers, and automatically identify the country if the number is in international format (with a "+" prefix), without requiring you to pre-specify the country code or default region.

    The library has examples on the Nuget page and github.

    Best Regards,

    Jiale


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". 

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.