WhatsApp check
GET/v1/exists
Whether a number has a WhatsApp account, and nothing else: the cheapest way to clean a list before paying for profiles. /v1/profile gives the same answer plus the account's details.
参数
phonestring · query必填
Phone number with its country code, e.g. +14155550123. The + is optional; spaces, dashes and a leading 00 are fine.
价格
0.003USDC per request
Every answer is charged, “not on WhatsApp” included; a lookup WhatsApp does not answer is free.
# Once: npx @wtsp/cli start, then fund the wallet it prints.# Each request pays for itself and prints JSON.npx @wtsp/cli exists +14155550123# Without payment you get the 402 challenge: price, token and# address are in the PAYMENT-REQUIRED header.curl -i "https://wtsp.dev/v1/exists?phone=14155550123"import { wrapFetchWithPayment, x402Client } from "@x402/fetch";import { ExactEvmScheme } from "@x402/evm/exact/client";import { privateKeyToAccount } from "viem/accounts";
const wallet = privateKeyToAccount(process.env.PRIVATE_KEY as `0x${string}`);const client = new x402Client().register("eip155:*", new ExactEvmScheme(wallet));const fetchWithPayment = wrapFetchWithPayment(fetch, client);
const res = await fetchWithPayment("https://wtsp.dev/v1/exists?phone=14155550123");console.log(await res.json());# Prepaid credit instead of a payment per request: https://wtsp.dev/pricing#keyscurl "https://wtsp.dev/v1/exists?phone=14155550123" \ -H "Authorization: Bearer $WTSP_API_KEY"import osfrom eth_account import Accountfrom x402 import x402ClientSyncfrom x402.http.clients import x402_requestsfrom x402.mechanisms.evm import EthAccountSignerfrom x402.mechanisms.evm.exact.register import register_exact_evm_client
client = x402ClientSync()register_exact_evm_client(client, EthAccountSigner(Account.from_key(os.environ["PRIVATE_KEY"])))
with x402_requests(client) as session: print(session.get("https://wtsp.dev/v1/exists?phone=14155550123").json())+1 415 555 0123
已开通 WhatsApp
{
"phone": "+14155550123",
"hasWhatsApp": true
}