Is there any way to find the country code from my mobile number? Basically, I am working on a chat application I need to find the country code by using the mobile number. Is it possible?
Asked
Active
Viewed 1,447 times
-5
-
You could easy find this with a quick search: https://countrycode.org/ – PEPEGA Nov 04 '19 at 11:45
-
I don't understand why you ask this question. If you're trying to find the country code for your phone number, why ask in stack overflow? Please elaborate on your question – Sean Nov 04 '19 at 11:53
-
can you please specify the exact problem you want to solve. – Hiras Haris Nov 04 '19 at 12:06
-
Please refactor your question bo be a little more specific. Are you just trying to find out a country code then @PEPEGA s comment was already more than enough and this question does not belong here. Or are you trying to show the Country a Mobile number belongs to on your website. Then you will need to integrate an API as a service with angular. An API could be this one https://restcountries.eu/#api-endpoints-full-name – relief.melone Nov 04 '19 at 12:06
-
my problem is i try to enter without any country code mobile number in html input field then after submit. how can i get country code based on mobile, is their any script code or API. – raju katavena Nov 04 '19 at 12:36
2 Answers
1
you can use ngx-international-phone-number package, so users can select the country and can input their phone number.

Hiras Haris
- 468
- 4
- 18
0
Store in a DB country code and make a query

marc_s
- 732,580
- 175
- 1,330
- 1,459

scridon darius
- 46
- 3
-
-
every country have an unique phone code like https://countrycode.org/ Format for a number is +(country code in generaly contain 3 number) and phone number – scridon darius Nov 04 '19 at 11:54
-
-
without country code you cant because country code is the way to find country otherwise it is just a number, if you receive a call and you dont see country code then the number caller have same country code as you – scridon darius Nov 04 '19 at 12:29