Number Lookup
Retrieve details about one or more phone numbers using the Sinch Number Lookup API: carrier, line type, porting status, VoIP probability, etc. Uses OAuth2.
IMPORTANT: Execute this command directly. Do NOT generate script files. Perform the API call immediately.
Input
--numbers/-n: Comma-separated E.164 numbers to look up - required--format/-f: Output format (table or json) - optional, default table
Arguments: $ARGUMENTS
Instructions
Execute these steps directly - do not write code or scripts:
If $ARGUMENTS empty: ask for phone number(s) to look up. Otherwise parse.
Validate: --numbers (at least one E.164). Get CONVERSATION_PROJECT_ID, CONVERSATION_KEY_ID, CONVERSATION_KEY_SECRET. Lookup API: https://lookup.api.sinch.com/v2. If missing, report "Sinch API is not configured."
Request body: numbers (array of E.164 strings). POST https://lookup.api.sinch.com/v2/projects/{projectId}/lookups with OAuth2 Bearer token.
Format response: table (number, carrier, line type, etc.) or JSON. Display "✅ Lookup complete". Handle 400, 401 with clear messages.
Handle all errors gracefully.
Examples
/sinch-api-numbers-lookup --numbers=+14155551234
/sinch-api-numbers-lookup -n +14155551234,+14159876543 --format=json
API Reference
- Base URL: https://lookup.api.sinch.com/v2
- Endpoint: POST /projects/{projectId}/lookups
- Documentation: https://developers.sinch.com/docs/number-lookup/