---
title: "How to Approve Real Users and Block Fake Accounts at Sign Up with Lookup and Verify in Python"
description: "This Python tutorial builds a signup flow that screens phone numbers for fake accounts while aiming to keep legitimate onboarding smooth. It combines Twilio Lookup’s Line Type Intelligence, optional Line Status, and Identity Match checks before using Twilio Verify to send an OTP and confirm possession of the number. The provided Flask example collects a phone number and first and last names, rejects landlines, nonfixed VoIP, toll-free numbers, and pagers, and accepts Identity Match only when both name fields are exact_match or high_partial_match. The post shows how to configure the project, run it locally, inspect outcomes such as LINE_TYPE_BLOCKED or identity-match failure, and consider pricing because the four API calls have different costs."
---

# How to Approve Real Users and Block Fake Accounts at Sign Up with Lookup and Verify in Python

[Twilio](https://yomu.fyi/company/twilio) · Kelley Robinson, Dylan Frankcom · Aug 27, 2026

**Type:** Tutorial

## Summary

This Python tutorial builds a signup flow that screens phone numbers for fake accounts while aiming to keep legitimate onboarding smooth. It combines Twilio Lookup’s Line Type Intelligence, optional Line Status, and Identity Match checks before using Twilio Verify to send an OTP and confirm possession of the number. The provided Flask example collects a phone number and first and last names, rejects landlines, nonfixed VoIP, toll-free numbers, and pagers, and accepts Identity Match only when both name fields are exact\_match or high\_partial\_match. The post shows how to configure the project, run it locally, inspect outcomes such as LINE\_TYPE\_BLOCKED or identity-match failure, and consider pricing because the four API calls have different costs.

## Context

The flow is intended to block bots, fake accounts, and fraudulent signups while providing real users with a smooth onboarding path. It uses progressively more intensive checks and considers API pricing when ordering the checks.

## Approach / What changed

A Flask application collects a phone number and name, runs Twilio Lookup checks for line type and identity match, optionally checks line status, and then starts a Twilio Verify OTP flow when the lookup checks pass. The project uses Python 3.8+, environment variables, the Twilio SDK, and a basic HTML interface.

## Takeaways

- Line Type Intelligence blocks landlines, nonfixed VoIP, toll-free numbers, and pagers before later verification steps.
- Identity Match requires both first\_name\_match and last\_name\_match to be exact\_match or high\_partial\_match; no\_match, partial\_match, null, or an unavailable result rejects the request.
- Line Status is optional, commented out by default because it is in Private Beta, and the Lookup and Verify steps have different costs that can influence their order.

**Tags:** [Flask](https://yomu.fyi/topic/flask), [Python](https://yomu.fyi/topic/python), [Twilio Lookup](https://yomu.fyi/topic/twilio-lookup)

- Source: [Twilio](https://www.twilio.com/en-us/blog/developers/tutorials/product/block-fake-accounts-lookup-verify-python)
- Source URL: https://www.twilio.com/en-us/blog/developers/tutorials/product/block-fake-accounts-lookup-verify-python
- Ingested by Yomu: 2026-09-09T13:35:39.621Z

[Read original post](https://www.twilio.com/en-us/blog/developers/tutorials/product/block-fake-accounts-lookup-verify-python)
