Skip to content

Usage Examples

curl -X POST "https://api.callerosint.org/callerid/search" \
  -H "Content-Type: application/json" \
  -d '{
    "api_key": "your-jwt-token",
    "query": "34600000001"
  }'

Example 2: Python

import requests

def search_number(token, number):
    url = "https://api.callerosint.org/callerid/search"
    payload = {
        "api_key": token,
        "query": number
    }

    response = requests.post(url, json=payload)

    if response.status_code == 200:
        data = response.json()
        print(f"✓ Search successful")
        print(f"Credits remaining: {data['credits_remaining']}")
        print(f"Callapp results: {data['data']['callapp']}")
        print(f"Truecaller results: {data['data']['truecaller']}")
        return data
    else:
        print(f"✗ Error: {response.json()['detail']}")
        return None

# Usage
token = "your-jwt-token"
number = "34600000001"
result = search_number(token, number)

Example 3: JavaScript/Node.js

async function searchNumber(token, number) {
    const url = 'https://api.callerosint.org/callerid/search';

    try {
        const response = await fetch(url, {
            method: 'POST',
            headers: {
                'Content-Type': 'application/json'
            },
            body: JSON.stringify({
                api_key: token,
                query: number
            })
        });

        const data = await response.json();

        if (response.ok) {
            console.log('✓ Search successful');
            console.log('Credits remaining:', data.credits_remaining);
            console.log('Results:', data.data);
            return data;
        } else {
            console.error('✗ Error:', data.detail);
            return null;
        }
    } catch (error) {
        console.error('Connection error:', error);
        return null;
    }
}

// Usage
const token = 'your-jwt-token';
const number = '34600000001';
searchNumber(token, number);

Example 4: Error Handling

import requests

def search_with_error_handling(token, number):
    url = "https://api.callerosint.org/callerid/search"
    payload = {
        "api_key": token,
        "query": number
    }

    try:
        response = requests.post(url, json=payload, timeout=10)

        if response.status_code == 200:
            return response.json()
        elif response.status_code == 401:
            print("Error: Invalid token")
        elif response.status_code == 403:
            print("Error: No credits remaining")
        elif response.status_code == 429:
            print("Error: Rate limit exceeded. Wait a minute.")
        else:
            print(f"Error: {response.status_code} - {response.json().get('detail', 'Unknown error')}")

    except requests.exceptions.Timeout:
        print("Error: Timeout - Server did not respond in time")
    except requests.exceptions.RequestException as e:
        print(f"Connection error: {e}")

    return None

Number Formats

Numbers must be sent without the + symbol:

Incorrect Format Correct Format
+34600000001 34600000001
+1 555 123 4567 15551234567
+91-9876543210 919876543210

Successful Response

{
  "success": true,
  "data": {
    "phone_number": "34600000001",
    "callapp": {
      "name": "John Doe",
      "location": "Madrid, Spain"
    },
    "truecaller": {
      "name": "John Doe",
      "spam": false
    },
    "combined": {
      "callapp_available": true,
      "truecaller_available": true
    }
  },
  "credits_remaining": 9
}