Google Sheets — WhatsApp Profile API
Validate a column of phone numbers directly inside Google Sheets using Apps Script. Paste numbers, run a menu command, get results back in adjacent columns.
Setup
- Open a Sheet.
- Extensions → Apps Script.
- Paste the script below.
- Replace YOUR_DIRECT_KEY.
- Save. Reload the Sheet. A new menu WhatsApp API appears.
- Put phone numbers in column A (with country code, no + sign). Run WhatsApp API → Validate column A.
Apps Script
// Direct proxy: use your direct-purchase key from our dashboard.
// RapidAPI marketplace: set API_BASE = "https://whatsapp-data1.p.rapidapi.com"
// AND uncomment the x-rapidapi-host header below.
const API_KEY = "YOUR_DIRECT_KEY";
const API_BASE = "https://whatsapp-proxy.checkleaked.cc";
function onOpen() {
SpreadsheetApp.getUi()
.createMenu("WhatsApp API")
.addItem("Validate column A", "validateColumnA")
.addToUi();
}
function validateColumnA() {
const sheet = SpreadsheetApp.getActiveSheet();
const lastRow = sheet.getLastRow();
if (lastRow < 2) return;
const numbers = sheet.getRange(2, 1, lastRow - 1, 1).getValues();
// Header row
sheet.getRange(1, 2, 1, 4).setValues([["isWAContact", "about", "isBusiness", "profilePic"]]);
for (let i = 0; i < numbers.length; i++) {
const number = String(numbers[i][0]).replace(/[^0-9]/g, "");
if (!number) continue;
try {
const res = UrlFetchApp.fetch(
`${API_BASE}/number/no_picture/${number}`,
{
headers: {
"x-rapidapi-key": API_KEY,
// "x-rapidapi-host": "whatsapp-data1.p.rapidapi.com", // RapidAPI only
},
muteHttpExceptions: true,
}
);
const data = JSON.parse(res.getContentText());
sheet.getRange(i + 2, 2, 1, 4).setValues([[
data.isWAContact || false,
data.about || "",
data.isBusiness || false,
data.profilePic || "",
]]);
} catch (e) {
sheet.getRange(i + 2, 2).setValue("ERROR");
}
// Respect tier burst limits — sleep 500 ms between requests (2/sec). MEGA tier: 250 ms (4/sec).
Utilities.sleep(500);
}
}Volume guidance
- Google Sheets Apps Script has a 6-minute per-execution limit. At 2 req/sec (BASIC/PRO/ULTRA) this handles ~700 numbers per run; MEGA at 4 req/sec handles ~1,400.
- For lists larger than 1,000 numbers, call our bulk endpoint instead — one call, download CSV, paste results back.
- Apps Script's UrlFetchApp has a separate per-day quota — 20,000 calls for free accounts, 100,000 for Workspace. Monitor both sides.
Triggering on row edit
For a "validate on paste" workflow, add an installable trigger:
function onEditValidate(e) {
if (e.range.getColumn() !== 1 || e.range.getRow() < 2) return;
// ... call validateSingleRow(e.range.getRow())
}Install under Triggers → Add Trigger → onEditValidate → From spreadsheet → On edit.
Related
What Our Users Say
Real reviews from our satisfied customers
4.5/5 (162 reviews)