#Lookup cURL API Samples
You'll need
- Twilio SID
- Auth Token
Add them to the .env file and
source .env
- Basic
- Carrier
For any AddOns you want to use, you'll need to browse to https://www.twilio.com/console/lookup/add-ons and:
- Create a unique name
- enable the AddOn for Lookup.
You'll use the unique name in the cURL call.
Lookup Basic (free)
Essentially a RESTful a wrapper around libphonenumber
lookup_basic.sh
curl -X GET "https://lookups.twilio.com/v1/PhoneNumbers/$1/" \
-u "$TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN"
./lookup_basic.sh 15551234567
Multiple AddOns
Append each unique addon's name as an additional param
lookup_multiple.sh
curl -X GET "https://lookups.twilio.com/v1/PhoneNumbers/$1/?AddOns=whitepages_pro_phone_intel&AddOns=whitepages_pro_caller_id" \
-u "$TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN"
./lookup_multiple.sh 15551234567