MyNixOS website logo
Description

Client for 'GenderAPI.io' Phone Number Validation and Formatter API.

Provides an interface to the 'GenderAPI.io' Phone Number Validation & Formatter API (<https://www.genderapi.io>) for validating international phone numbers, detecting number type (mobile, landline, Voice over Internet Protocol (VoIP)), retrieving region and country metadata, and formatting numbers to E.164 or national format. Designed to simplify integration into R workflows for data validation, Customer Relationship Management (CRM) data cleaning, and analytics tasks. Full documentation is available at <https://www.genderapi.io/docs-phone-validation-formatter-api>.

๐Ÿ“ž Phone Number Validation & Formatter API (R SDK)

The PhoneValidator R package is the official client for the GenderAPI Phone Number Validation & Formatter API, enabling you to validate and format phone numbers from over 240 countries worldwide.

Whether your users provide phone numbers in various formats (e.g., 12128675309, +1 212 867 5309, 001โ€“212โ€“867โ€“5309), this package intelligently detects, validates, and converts the input into a standardized E.164 format (e.g., +12128675309).


โœ… Features

  • Converts phone numbers to E.164 format
  • Validates if a number is valid and structurally possible
  • Detects number type: mobile, landline, VoIP, etc.
  • Identifies region/city based on area code
  • Includes country-level metadata (e.g., ISO code, time zone)
  • Built with R and powered by GenderAPI.io

๐Ÿ“ฆ Installation

Since this package is not yet on CRAN, you can install it directly from GitHub:

# Install devtools if not already installed
install.packages("devtools")

# Install the PhoneValidator package
devtools::install_github("GenderAPI/PhoneValidator-R")

๐Ÿš€ Usage

library(PhoneValidator)

result <- validate(
  api_key = "YOUR_API_KEY",
  number = "+1 212 867 5309",
  address = "US"  # Optional, improves parsing of local numbers
)

print(result)

๐Ÿงพ Input Parameters

ParameterTypeRequiredDescription
numberstringโœ… YesPhone number in any format
addressstringOptionalCan be a country code (US), full country name (Turkey), or city name (Berlin) to improve parsing
validate(api_key = "YOUR_API_KEY", number = "12128675309", address = "US")

๐Ÿ“ค API Response Example

{
  "status": true,
  "remaining_credits": 15709,
  "expires": 0,
  "duration": "18ms",
  "regionCode": "US",
  "countryCode": 1,
  "country": "United States",
  "national": "(212) 867โ€“5309",
  "international": "+1 212-867-5309",
  "e164": "+12128675309",
  "isValid": true,
  "isPossible": true,
  "numberType": "FIXED_LINE_OR_MOBILE",
  "nationalSignificantNumber": "12128675309",
  "rawInput": "+1 212 867 5309",
  "isGeographical": true,
  "areaCode": "212",
  "location": "New York City (Manhattan)"
}

๐Ÿ“š Response Fields

FieldTypeDescription
statusBooleanWas the request successful
remaining_creditsIntegerRemaining API credits
regionCodeStringISO 3166-1 alpha-2 code (e.g., US)
countryStringCountry name
e164StringNumber formatted to E.164
isValidBooleanIs number valid according to numbering rules
isPossibleBooleanIs number structurally possible
numberTypeStringType of number (mobile, VoIP, etc.)
areaCodeStringArea code from input
locationStringCity/region matched from area code

๐Ÿ”ข Number Type Values

ValueDescription
FIXED_LINELandline
MOBILEMobile phone
FIXED_LINE_OR_MOBILECould be both
TOLL_FREEe.g. 800 numbers
PREMIUM_RATEExpensive premium numbers
SHARED_COSTShared between parties
VOIPInternet-based number
PERSONAL_NUMBERForwarding number
PAGERObsolete pager number
VOICEMAILVoicemail access
UNKNOWNCannot be determined

โ„น๏ธ More Information

  • Supports 240+ countries and territories
  • Auto-detects landline vs. mobile numbers
  • Useful for CRM, form validation, user profiling
  • Full API documentation: GenderAPI Phone Validation Docs

๐Ÿ“ License

MIT License ยฉ GenderAPI.

Metadata

Version

1.0.1

License

Unknown

Platformsย (76)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-windows
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-linux
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows