Skip to contentSkip to navigationSkip to topbar

Block Spam Calls

Created by: Twilio
  • Voice
  • PHP
  • Python
  • .NET
  • JavaScript
  • Java
  • Ruby

This is an example app that:

  • Uses Twilio Add-ons from the Twilio Add-ons Marketplace to block unwanted voice calls
  • Integrates 3 spam Add-ons from the Marketplace (Whitepages Pro Phone Reputation, Marchex Clean Call, and Nomorobo Spam Score)

How it works:

  • When your Twilio number receives an inbound call, this code will check the spam rating of the phone number on all 3 spam Add-ons
  • If all 3 Add-ons deem the number to be spam, the number will be blocked
  • If the number is not deemed spam, the call will be forwarded to the customer
Report this template(link takes you to an external page)
  1. Choose a language

    This project is available in multiple programming languages.

    Select language
  2. Get the code for this project

    The code for this sample is available on GitHub to view.

    View on GitHub(link takes you to an external page)
  3. Get Twilio credentials

    You will need an Account SID and Auth Token in order to run this code.

    Checking for existing account...

  4. Set up the code sample locally

Need some help?

We all do sometimes; code is hard. Get help now from our support team(link takes you to an external page), or lean on the wisdom of the crowd by browsing the Twilio tag(link takes you to an external page)on Stack Overflow.

Terms of servicePrivacy Policy

Copyright © 2025 Twilio Inc.