TwilioMatthew SetterTutorial
How to Retrieve a Phone Number's SMS Pumping Score in Rust
Summary
SMS Pumping Fraud exploits phone number input fields to generate revenue from SMS messages sent to numbers controlled by a specific mobile network operator. Twilio’s Lookup v2 API provides an SMS Pumping Risk Score from 0 to 100, based on a proprietary model using network data including Verify Fraud Guard signals and unusual traffic patterns. This Rust tutorial uses the rustlio crate, dotenvy, serde, and tokio to call the API and retrieve the score along with carrier risk category and block status. Canadian numbers do not return carrier information, and Twilio advises against using the score for US or Canadian numbers. Guidelines recommend sending messages for scores 0-60, adding friction for 60-75, treating as suspicious for 75-90, and blocking for 90-100.
Context
SMS Pumping Fraud is a growing threat where fraudsters exploit phone number input fields to generate revenue from SMS messages sent to numbers controlled by specific mobile network operators. Twilio’s Lookup v2 API provides an SMS Pumping Risk Score to help mitigate this fraud.
Approach / What changed
Using Rust with the rustlio crate, dotenvy for environment variables, serde for deserialization, and tokio for async, the tutorial creates a binary project that calls Twilio’s Lookup v2 API to retrieve the SMS Pumping Risk Score for a given phone number. The code sets environment variables for Twilio Account SID and Auth Token, then uses the lookup::lookup_phone_data function with the SmsPumpingRiskScore data package. It prints the risk score and related fields such as carrier risk category and block status.
Takeaways
The SMS Pumping Risk Score ranges from 0 (no risk) to 100 (high risk) and is based on Twilio’s proprietary model using network data, including signals from Verify Fraud Guard, risky carriers, unusual traffic patterns, and low conversion rates.
Twilio provides guidelines for acting on the score: send messages for scores 0-60, add friction for 60-75, treat as suspicious for 75-90, and block for 90-100.
Twilio does not recommend using the SMS Pumping Risk Score for US or Canadian phone numbers, as these regions are generally not targeted by SMS pumping fraud.
FAQ
What is SMS Pumping Fraud?
SMS Pumping Fraud occurs when fraudsters exploit phone number input fields to receive SMS messages (such as OTPs or download links) sent to numbers controlled by a specific mobile network operator, and they share the generated revenue. Indicators include messages sent to adjacent numbers controlled by the same MNO and incomplete verification cycles.
How do I retrieve the SMS Pumping Risk Score in Rust?
Create a Rust binary project, add crates dotenvy, rustlio, serde, and tokio, set environment variables for your Twilio Account SID and Auth Token, then use the lookup::lookup_phone_data function with the SmsPumpingRiskScore data package. The response includes the risk score, carrier risk category, and block status.
What do the risk score values mean?
The score ranges from 0 to 100. Twilio recommends: 0-60 low risk (send messages), 60-75 mild (add friction), 75-90 moderate (treat as suspicious), 90-100 high (don't send). The carrier risk category can be high, moderate, mild, or low.
Source and freshness
- Source
- twilio.com
- Published
- Added to Yomu
Summaries are generated from the original by a language model. Check the original before relying on it.
Keep reading
Related reading
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
The best engineering reads, once a week
One useful email. Unsubscribe anytime.