Frequently Asked Question
Cnam - CNAM Lookup
Last Updated 7 days ago
CNam API
Overview
The CNam (Caller Name) API provides information about a given phone number, including carrier details and caller name.
Version
1.000
Endpoint
/v2/cnam.php
Authentication
This API requires authentication using an API key. The key should be passed in the HTTP_X_API_KEY
header.
Request Parameters
Parameter | Type | Description |
---|---|---|
n | string | CLI (Calling Line Identifier) number (required, max 15 characters) |
Response
The API returns a JSON object with the following structure:
Field | Type | Description |
---|---|---|
status | string | The status of the request. "success" for successful requests, or an error message. |
uk | string | The UK format of the phone number. |
e164 | string | The E.164 format of the phone number. |
data | string | A concatenated string of carrier name, carrier type, and caller name. |
detail | object | Detailed information about the number lookup. |
Example Response
{
"status": "success",
"uk": "07123456789",
"e164": "447123456789",
"data": "Vodafone mobile John Doe",
"detail": {
// Detailed lookup information
}
}
Error Handling
- If the CLI is invalid:
{"status": "Invalid CLI"}
- If the number is not found (case 1):
{"status": "Not Found 1"}
- If the number is not found (case 2):
{"status": "Not Found 2"}
- If there's an authentication error:
{"status": "[validation status]"}
- If the status is not set for any reason:
{"status": "fail"}
Notes
- The API converts the input number to both UK and E.164 formats.
Security
- Ensure that the API key is kept secure and not exposed in client-side code.
- All responses are sent with the "Content-Type: application/json" header.