Skip to content

Instantly share code, notes, and snippets.

@scramblr
Created March 11, 2020 15:43
Show Gist options
  • Save scramblr/9ce42b90cd124dbe2291356ac10436a1 to your computer and use it in GitHub Desktop.
Save scramblr/9ce42b90cd124dbe2291356ac10436a1 to your computer and use it in GitHub Desktop.
#!/bin/sh
#
# This is a small Twilio Lookup Script by me, SCRAMBLR. It's a work in progress
# and I'll be adding more functionality soon. The first major thing I'll be adding
# is the ability to pick and choose which features you deploy on each request, as
# some are way more expensive than others.
#
# This started out as a small sideproject/script for myself, but I figure the community
# might find it useful. If not, fuck you! ;)
#
# REQUIREMENTS:
#
# 1. jq (JSON Parser) - Consult https://stedolan.github.io/jq/download/ for download & install.
#
# 2. Twilio Account with at least $1. Demo accounts come with $10, so that really shouldn't be
# hard.
#
# 3. The following Twilio Add-Ons enabled:
# - Twilio Carrier Information £0.00376 per request
# - Twilio Caller Name £0.00752 per request
# - Ekata Reverse Phone £0.05261 per request
# - Ekata Phone Validation £0.00752 per request
# - OpenCNAM by Telo £0.00361 per request
# - Data Axle BizInfo £0.03758 per request
# - RealValidation Phone Verify £0.04510 per request
# - Payfone TCPA Compliance £0.03758 per request
# - IceHook Systems Scout £0.00263 per request
#
# You can enable and disable them by using this URL:
# these by removing them from the URL below:
# https://www.twilio.com/console/lookup/add-ons.
#
# Script setup: You will need to find your Twilio SID and
# auth token. They're literally right in this URL:
# https://www.twilio.com/console/project/settings
#
# If you don't want to use any of the add-ons I call, just
# remove them from the curl script below. Same goes for jq,
# if you dont have it installed, or you don't want to install
# it for some fucking crazy reason, just remove it. Stare at
# garbage JSON output all day. See if I care.
# ** Admittedly, a lot of the add-ons provide redudant data,
# the reason so many are activated is so you can do comparisons.
# Using ALL of them long-term is probably a dumb idea.
#
# -SCRAMBLR
#
curl -X GET "https://lookups.twilio.com/v1/PhoneNumbers/+"$1"?AddOns=icehook_scout&AddOns=twilio_carrier_info&AddOns=twilio_caller_name&AddOns=payfone_tcpa_compliance&AddOns=ekata_phone_valid&AddOns=telo_opencnam&AddOns=ekata_reverse_phone" -u <UR_TWILIO_ACCOUNT_SID>:<UR_TWILIO_AUTH_TOKEN>|jq
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment