Telefono Format API

Number formatting and parsing endpoints

OpenAPI Specification

telefono-format-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Telefono Carrier Lookup Batch Format API
  description: Look up carrier and network information for phone numbers worldwide, including MCC, MNC, network type, and real-time HLR lookup for portability-aware detection.
  version: '1.0'
  contact:
    name: Telefono Support
    url: https://www.telefono.com/support
    email: support@telefono.com
  termsOfService: https://www.telefono.com/terms
servers:
- url: https://api.telefono.com/v1
  description: Telefono API
security:
- ApiKeyAuth: []
tags:
- name: Format
  description: Number formatting and parsing endpoints
paths:
  /format:
    get:
      operationId: formatPhoneNumber
      summary: Format Phone Number
      description: Format a phone number into multiple standard formats.
      tags:
      - Format
      parameters:
      - name: number
        in: query
        required: true
        schema:
          type: string
        description: Phone number to format (any format)
      - name: country_code
        in: query
        schema:
          type: string
        description: ISO 3166-1 alpha-2 country code hint for local numbers
      - name: output_format
        in: query
        schema:
          type: string
          enum:
          - e164
          - national
          - international
          - rfc3966
          - all
          default: all
        description: Desired output format
      responses:
        '200':
          description: Formatted number result
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FormatResult'
        '400':
          description: Could not parse the number
components:
  schemas:
    FormatResult:
      type: object
      properties:
        number:
          type: string
          description: Original input number
        e164:
          type: string
          description: E.164 format (e.g., +14155552671)
        national:
          type: string
          description: National format (e.g., (415) 555-2671)
        international:
          type: string
          description: International format (e.g., +1 415-555-2671)
        rfc3966:
          type: string
          description: RFC 3966 tel URI format (e.g., tel:+1-415-555-2671)
        country_code:
          type: string
          description: Detected country code (ISO alpha-2)
        calling_code:
          type: integer
          description: Numeric calling code
        is_valid:
          type: boolean
          description: Whether the number was successfully parsed
      required:
      - number
      - is_valid
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key