libphonenumber API

Parse and validate any phone number using Google's libphonenumber, for free

Zero Setup

No API keys, no signup, no authentication. Just make requests.

Built on libphonenumber

Powered by Google's libphonenumber, the industry standard.

Perfect for Testing

Ideal for local development, prototypes, and testing.

Usage

GET /api/phone-numbers/{phone_number}

Parse and validate any phone number. Returns carrier, location, and formatting.

Path Parameters

phone_number
string required

The phone number to parse. Can include country code, spaces, dashes, or parentheses. URL-encode the + as %2B for international format.

Response Attributes

carrier string

The carrier or network operator name (e.g., "T-Mobile", "Verizon").

components object

Parsed parts: area_code, country_code, extension, local_number.

country string

ISO 3166-1 alpha-2 country code (e.g., "CA", "GB", "US").

formats object

Formatted versions: e164, international, national.

geo_name string

Geographic location (e.g., "California", "Ontario").

is_possible boolean

Whether the number has a valid format structure.

is_valid boolean

Whether the phone number is valid and assigned.

possible_types array

All possible number types this number could be. One or more of the following:

  • area_code_optional
  • carrier_selection_codes
  • carrier_services
  • carrier_specific
  • directory_services
  • emergency
  • expanded_emergency
  • fixed_line
  • fixed_or_mobile
  • mobile
  • no_international_dialling
  • pager
  • personal_number
  • premium_rate
  • shared_cost
  • short_code
  • sms_services
  • standard_rate
  • toll_free
  • uan
  • voicemail
  • voip
sanitized string

The phone number with all non-digit characters removed.

timezone string

IANA timezone identifier (e.g., "America/Los_Angeles").

type string

Number type. One of the types listed in possible_types.

Request
curl https://libphonenumberapi.com/api/phone-numbers/+4915123456789
Response
{
  "carrier": "T-Mobile",
  "country": "DE",
  "components": {
    "area_code": null,
    "country_code": 49,
    "extension": null,
    "local_number": "3456789"
  },
  "formats": {
    "e164": "+4915123456789",
    "international": "+49 1512 3456789",
    "national": "01512 3456789"
  },
  "geo_name": null,
  "is_possible": true,
  "is_valid": true,
  "possible_types": [
    "fixed_or_mobile",
    "pager",
    "personal_number",
    "premium_rate",
    "shared_cost",
    "toll_free",
    "uan"
  ],
  "sanitized": "4915123456789",
  "timezone": "Europe/Berlin",
  "type": "mobile"
}

Frequently Asked Questions

What is this API?

This is a free REST API built with phonelib, a Ruby gem that wraps Google's libphonenumber library. It provides phone number parsing, validation, and formatting over HTTP.

Is it really free?

Yes, completely free. It's intended for development and testing purposes — not production use — as there are no uptime guarantees or SLAs.

Are there rate limits?

There are no strict rate limits, but please be reasonable.

What about data privacy?

We don't store or log any phone numbers. All parsing happens in real-time and no data is retained.

How accurate is the parsing?

The API uses Google's libphonenumber, the same library used by Android and many major applications. The accuracy depends on the library's metadata, which Google actively maintains. Currently, libphonenumberapi.com is using phonelib version 0.10.17.