Back to articles
How to Look Up Verified Phone Numbers with TypeScript

How to Look Up Verified Phone Numbers with TypeScript

via Dev.toJack

If you're building outbound sales tooling, a CRM integration, or any pipeline that needs real mobile phone numbers, here's how to do it in TypeScript with a single API call. We'll use the Million Phones API to look up a verified phone number from a LinkedIn profile handle. Setup Initialize a project and install dependencies: mkdir phone-lookup && cd phone-lookup npm init -y npm install tsx No extra HTTP libraries needed — we'll use the native fetch available in Node 18+. The Lookup Function Create lookup.ts : interface PhoneResponse { phone_numbers : string []; } async function lookupPhone ( socialUrl : string ): Promise < string [] | null > { const apiKey = process . env . MILLIONPHONES_API_KEY ; if ( ! apiKey ) { throw new Error ( " Missing MILLIONPHONES_API_KEY environment variable " ); } const url = `https://millionphones.com/v1/phone?social_url= ${ encodeURIComponent ( socialUrl )} ` ; const response = await fetch ( url , { headers : { " x-api-key " : apiKey , }, }); if ( ! respon

Continue reading on Dev.to

Opens in a new tab

Read Full Article
2 views

Related Articles