{
"success": true,
"data": {
"carrier": null,
"is_valid": false,
"is_blacklisted": false,
"is_disposable": false,
"phone": "+12121234567",
"country_code": "US",
"risk_level": "high",
"recommendation": "reject",
"reasons": ["Invalid phone number structure."],
"custom_rules_applied": {
"total": 0,
"rules": []
}
},
"execution_ms": 1
}
{
"success": false,
"code": 101,
"type": "invalid_key",
"description": "The API Key is missing or invalid."
}
Phone scoring
curl --request GET \
--url https://v2.greipapi.com/score/phone/{phone} \
--header 'Authorization: Bearer <token>'import requests
url = "https://v2.greipapi.com/score/phone/{phone}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://v2.greipapi.com/score/phone/{phone}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://v2.greipapi.com/score/phone/{phone}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://v2.greipapi.com/score/phone/{phone}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://v2.greipapi.com/score/phone/{phone}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://v2.greipapi.com/score/phone/{phone}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body
{
"success": true,
"data": {
"carrier": null,
"is_valid": false,
"is_blacklisted": false,
"is_disposable": false,
"phone": "+12121234567",
"country_code": "US",
"risk_level": "high",
"recommendation": "reject",
"reasons": ["Invalid phone number structure."],
"custom_rules_applied": {
"total": 0,
"rules": []
}
},
"execution_ms": 1
}
{
"success": false,
"code": 101,
"type": "invalid_key",
"description": "The API Key is missing or invalid."
}
Risk Scoring
Phone Scoring
This method serves as an additional layer of protection in your system for validating phone numbers. It not only checks the syntax but also assesses the likelihood of the phone number being valid and operational.
By incorporating this scoring into your workflow, you can enhance fraud detection, reduce invalid inputs, and improve the overall quality of data captured.
{
"success": true,
"data": {
"carrier": null,
"is_valid": false,
"is_blacklisted": false,
"is_disposable": false,
"phone": "+12121234567",
"country_code": "US",
"risk_level": "high",
"recommendation": "reject",
"reasons": ["Invalid phone number structure."],
"custom_rules_applied": {
"total": 0,
"rules": []
}
},
"execution_ms": 1
}
{
"success": false,
"code": 101,
"type": "invalid_key",
"description": "The API Key is missing or invalid."
}
GET
/
score
/
phone
/
{phone}
Phone scoring
curl --request GET \
--url https://v2.greipapi.com/score/phone/{phone} \
--header 'Authorization: Bearer <token>'import requests
url = "https://v2.greipapi.com/score/phone/{phone}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://v2.greipapi.com/score/phone/{phone}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://v2.greipapi.com/score/phone/{phone}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://v2.greipapi.com/score/phone/{phone}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://v2.greipapi.com/score/phone/{phone}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://v2.greipapi.com/score/phone/{phone}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body
{
"success": true,
"data": {
"carrier": null,
"is_valid": false,
"is_blacklisted": false,
"is_disposable": false,
"phone": "+12121234567",
"country_code": "US",
"risk_level": "high",
"recommendation": "reject",
"reasons": ["Invalid phone number structure."],
"custom_rules_applied": {
"total": 0,
"rules": []
}
},
"execution_ms": 1
}
{
"success": false,
"code": 101,
"type": "invalid_key",
"description": "The API Key is missing or invalid."
}
Authentication
Include your API key in theAuthorization header:
Authorization: Bearer <api_key>
Path parameters
string
required
The phone number you want to validate.Expected values: a phone numberSample value:
+12121234567, 0012121234567, 12121234567, or 2121234567Query parameters
string
required
The
ISO 3166-1 alpha-2 format of the country code of the phone number. Learn moreSample value: USstring
default:"JSON"
The format command is used to get a response in a specific format.Expected values:
JSON, XML, CSV, or NewlineFor more information please refer to Response format.string
default:"live"
The mode command is used in the development stage to simulate the integration process before releasing it to the production environment.Expected values:
live, or test.For more information please refer to Development environment.string
Optional label for your own analytics or support correlation (for example a product or channel name).
string
The user_id command can be used to identify requests sent by specific users to monitor in the Events page.Expected values: email address, phone number, user id, name, etc.For more information please refer to User identifier.
Response properties
boolean
required
true when the request succeeded; false on error.object
required
Hide properties
Hide properties
string
required
Carrier name of the phone number.
string
required
Overall risk band (
low, medium, or high).string
required
Suggested action (
accept, review, or reject).array
required
Human-readable strings explaining elevated risk. Empty when
risk_level is low.boolean
required
Whether the number passes structure and validation checks for the given
country_code.boolean
required
Indicates if the phone number is blacklisted due to applying custom
rules or were found in one of your
blacklists.
boolean
required
Whether the number is flagged as disposable or spam.
string
required
The phone number you sent in the request.
string
required
The country code you sent in the request (ISO 3166-1 alpha-2).
object
The custom rules applied to this request, learn
more.
Hide properties
Hide properties
integer
required
The total number of custom rules applied to this request.
object
required
The custom rules applied to this request, learn
more.
integer
required
Time taken to process the request (milliseconds).
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Query Parameters
Response
200
OK
Was this page helpful?