CRMs

Check phone numbers, carriers and phone complaints in Close

Validate the phone numbers on Close leads and contacts against numbering-plan rules, and write the formatted number and its type back so your call lists start from clean data.

Why the data matters in Close

Close is built around calling and texting from the lead record, so a malformed number or a toll-free line in a contact slot costs a dial, a call log entry and a wasted slot in a smart view. A wrong country code can send an entire import to numbers that cannot ring.

What LookValid checks

LookValid checks for Close
ProductWhat it does hereCredits
Phone Numbering-Plan ValidationChecks the number against its country numbering plan and returns E.164, national and international formats plus the number type the plan assigns. It cannot tell whether the line is active.1 credit per valid number
Carrier Lookup (original carrier)For US numbers, returns the carrier originally assigned the number block and its rate center. A number that has since been moved to another carrier still shows the original one.1 credit per lookup (numbers outside the covered numbering plan areas are free)
Phone Spam CheckReturns consumer complaint counts reported for a number, useful when a lead gives a number that others report as a nuisance caller.1 credit per number with complaints on record
Country Calling CodesExplains a calling code such as +44 with national number lengths and dialing prefixes, to fix leads typed without a country.1 credit per lookup (an unknown code, country or name is free)

Connect it in four steps

  1. Open a LookValid account and mint a key in the dashboard's API keys section.
  2. Export LOOKVALID_API_KEY in the shell or job runner that runs the script, and keep your Close API key in a separate variable because Close accepts it as the Basic auth username with an empty password or as a Bearer token.
  3. Call validate_close_phone for each number: on found:false skip the lead and log it, and on an error raise the code and fix so the run stops visibly.
  4. Write the four returned values back to the lead with an update that sets keys in the form custom.FIELD_ID, one custom field each for phone_valid, phone_e164, phone_type and phone_country.

A Python script run on a schedule or after an import that loops over Close leads and contacts, reads each phone number and updates the lead. The call is POST https://YOUR_API_HOST/v1/phone and costs 1 credit per valid number.

validate_close_phone.py
import json
import os
import urllib.error
import urllib.request
​
API_URL = "https://YOUR_API_HOST/v1/phone"
​
​
def validate_close_phone(value):
    request = urllib.request.Request(
        API_URL,
        data=json.dumps({
            "phone": value,
        }).encode(),
        headers={
            "Authorization": "Bearer " + os.environ["LOOKVALID_API_KEY"],
            "Content-Type": "application/json",
        },
        method="POST",
    )
    try:
        with urllib.request.urlopen(request, timeout=30) as response:
            result = json.load(response)
    except urllib.error.HTTPError as error:
        failure = json.load(error)["error"]
        raise RuntimeError(failure["code"] + ": " + failure["fix"])
    if not result["found"]:
        return None
    return {
        "phone_valid": result.get("data", {}).get("valid"),
        "phone_e164": result.get("data", {}).get("e164"),
        "phone_type": result.get("data", {}).get("number_type"),
        "phone_country": result.get("data", {}).get("country"),
    }
Where each response field goes in Close
Response fieldGoes into
data.validphone_valid
data.e164phone_e164
data.number_typephone_type
data.countryphone_country

The recipe returns nothing when the lookup finds nothing, which costs no credits for this product, and stops with the error code and fix on a failed request.

Without code

You can run the same check without code through an automation platform that has a generic HTTP request step and no dedicated app. Start from a new lead or a changed phone field in Close, post the number to the LookValid phone endpoint in an HTTP step, then use a second step to set the returned type on a custom field of that lead.

REST and MCPOne shared credit balance

Questions

How many credits does one lead cost?

One phone lookup per number, at the rate shown on the pricing page. A lead with three numbers is three lookups.

Does a valid result mean the person will pick up?

No. Valid means the number fits the numbering plan of its country. It says nothing about whether the line is connected or who holds it today.

Where is each key stored?

Both are environment variables of the process that runs the script. The Close key is sent as Basic auth or as a Bearer header, and the LookValid key is sent as a Bearer header.

Sources

LookValid is run by Meralume Labs. It is not connected to, endorsed by or a partner of any company or product named on this page, and every product name belongs to its owner.

LookValid bills every lookup in credits from one shared balance, so the same key works for each check above.

See Phone Numbering-Plan Validation