
Security News
Risky Biz Podcast: Making Reachability Analysis Work in Real-World Codebases
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
genderapi-phone-validator
Advanced tools
The genderapi-phone-validator
gem uses the official GenderAPI Phone Number Validation & Formatter API to validate and format phone numbers from over 240 countries and territories.
Whether your users enter phone numbers in various formats (e.g., 12128675309
, +1 212 867 5309
, 001-212-867-5309
), this library will intelligently detect, validate, and convert the input into a standardized E.164 format (e.g., +12128675309
).
HTTParty
for HTTP requestsAdd the gem to your project:
gem install genderapi-phone-validator
Or in your Gemfile
:
gem 'genderapi-phone-validator'
You need an API key from www.genderapi.io.
Sign up and get your key from your dashboard.
require 'genderapi-phone-validator'
client = PhoneValidator::Client.new(api_key: "YOUR_API_KEY")
response = client.validate(
number: "+1 212 867 5309", # Required
address: "US" # Optional, helps with local formats
)
puts response
validate(number:, address: nil) → Hash
Parameter | Type | Required | Description |
---|---|---|---|
number | String | ✅ Yes | Phone number in any format |
address | String | Optional | ISO country code (US ), full country name (Turkey ), or city name (Berlin ) – improves local number detection |
client.validate(number: "2128675309", address: "US")
{
"status": true,
"remaining_credits": 15709,
"expires": 0,
"duration": "18ms",
"regionCode": "US",
"country": "United States",
"national": "(212) 867-5309",
"international": "+1 212-867-5309",
"e164": "+12128675309",
"isValid": true,
"isPossible": true,
"numberType": "FIXED_LINE_OR_MOBILE",
"nationalSignificantNumber": "2128675309",
"rawInput": "+1 212 867 5309",
"isGeographical": true,
"areaCode": "212",
"location": "New York City (Manhattan)"
}
Field | Type | Description |
---|---|---|
status | Boolean | Was the request successful |
remaining_credits | Integer | Remaining API credits |
regionCode | String | ISO 3166-1 alpha-2 code (e.g., US ) |
country | String | Country name |
e164 | String | Number formatted to E.164 |
isValid | Boolean | Is number valid according to rules |
isPossible | Boolean | Is number structurally possible |
numberType | String | Number type (MOBILE , FIXED_LINE , etc.) |
areaCode | String | Area code from input |
location | String | City/region matched from area code |
Value | Description |
---|---|
FIXED_LINE | Landline |
MOBILE | Mobile phone |
FIXED_LINE_OR_MOBILE | Ambiguous, could be both |
TOLL_FREE | e.g., 800 numbers |
PREMIUM_RATE | Expensive premium numbers |
SHARED_COST | Cost shared between parties |
VOIP | Internet-based phone |
PERSONAL_NUMBER | Forwarding number |
PAGER | Obsolete pager number |
VOICEMAIL | Voicemail access |
UNKNOWN | Cannot be determined |
MIT License © GenderAPI
FAQs
Unknown package
We found that genderapi-phone-validator demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
Security News
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.