SIM Swap SDK

The SIM Swap SDK offers an extra layer of identity security to your devices. With this code, applications can better react to fraudulent attempts, such as SIM swapping, also known as SIM splitting or SIM hijacking, by using resources that go beyond traditional 2FA authentication processes.

Here's a hypothetical scenario of a SIM-swap fraud: Someone received a message seemingly from their bank requesting to verify personal account details. The person clicks the link, assuming it's legitimate, and provides the details. In the meanwhile, a fraudster contacts the victim's mobile carrier requesting a SIM swap and providing the personal account details provided in the phishing link sent before. Once the fraudster transfers the victim's phone number to a new SIM card they can control, they can illicitly gain access to accounts, personal data, or commit other identity-theft related crimes.

Checking SIM Swap events

With the SIM Swap SDK, you can easily retrieve the latest date for when a SIM was swapped.

NOTE: if the SIM was never swapped before, the SIM activation date will be returned instead.

It's also possible to check if a SIM was swapped within a specific span of n seconds. So, in case you suspect a SIM swap attempt occurred in the last n hours (converted in seconds), you can pass this value within the max_age or maxAge parameter, and precisely check if the fraudulent attempt happened during this time. Or simply verify if the SIM was swapped without any specific amount of time defined by leaving the methods verify_sim_swap() or verifySimSwap() empty.

import network_as_code as nac
 
from network_as_code.models.device import Device
 
# Initialize the client object with your application key
client = nac.NetworkAsCodeClient(
    token="<your-application-key-here>",
)
 
# Then, create a device object for the phone number you want to check
my_device = client.devices.get(
    # The phone number accepts the "+" sign, but not spaces or "()" marks
    phone_number="36721601234567"
)
 
# Check the latest SIM-Swap date
latest_sim_swap_date = my_device.get_sim_swap_date()
 
# Check SIM-Swap events within specified time spans
# The max_age parameter is not mandatory
# This method also checks if SIM swap occurred within an undefined age
sim_swap_check = my_device.verify_sim_swap(max_age=360)

SIM-Swap parameters

ParameterDescription
max_ageOPTIONAL parameter which defines the time span of n seconds for when a SIM was supposedly swapped.

Last updated on July 25, 2024