{
  "openapi": "3.0.1",
  "info": {
    "title": "Phone Number Validator & Formatter (Bulk, CSV, Dataset)",
    "description": "Validate and format phone numbers in bulk from a list, free text, CSV, Excel, Google Sheets or any Apify dataset. Get valid/invalid, line type, E.164 and national formats, country, city, time zone and risk flags, with duplicates removed. No API key needed.",
    "version": "1.0",
    "x-build-id": "djcIjUpbujNUB1bqS"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/ocrad~phone-number-validator-formatter/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-ocrad-phone-number-validator-formatter",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/ocrad~phone-number-validator-formatter/runs": {
      "post": {
        "operationId": "runs-sync-ocrad-phone-number-validator-formatter",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/ocrad~phone-number-validator-formatter/run-sync": {
      "post": {
        "operationId": "run-sync-ocrad-phone-number-validator-formatter",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "phoneNumbers": {
            "title": "Phone numbers",
            "type": "array",
            "description": "One number per line, in any format: +1 514 872 0311, (212) 555-0123, 06 12 34 56 78, 1-800-… A line holding several numbers (separated by ; | / or \"or\") is split.",
            "items": {
              "type": "string"
            }
          },
          "text": {
            "title": "Free text",
            "type": "string",
            "description": "Paste emails, notes, a web page or any text: every phone number inside it is found and validated."
          },
          "fileUrls": {
            "title": "Files or pages (CSV, Excel, Google Sheets, JSON, TXT, web page)",
            "type": "array",
            "description": "Links to CSV/TSV, Excel (.xlsx), JSON, TXT files, a Google Sheet shared as \"Anyone with the link\", or a web page (its tel: links and visible numbers are read). Phone columns are detected by name (phone, tel, mobile, cell, fax, téléphone, cellulaire …) unless you set Phone fields.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "datasetIds": {
            "title": "Apify dataset IDs",
            "type": "array",
            "description": "Validate the phone numbers from another Actor's results: paste the dataset ID of a scraper run. Phone fields are detected automatically, including nested ones such as agent.phones.",
            "items": {
              "type": "string"
            }
          },
          "phoneFields": {
            "title": "Phone fields",
            "type": "array",
            "description": "Column or field names that hold the numbers, for files and datasets (dot paths work: contact.mobile). Leave empty to detect them automatically.",
            "items": {
              "type": "string"
            }
          },
          "countryField": {
            "title": "Country field",
            "type": "string",
            "description": "Column or field with each row's country (ISO code like CA, a name like Canada or France, or a calling code like +33). Detected automatically when it is called country, countryCode or pays. Used for numbers written without +."
          },
          "defaultCountry": {
            "title": "Default country",
            "type": "string",
            "description": "Country used for numbers written without + or 00 and with no country on their row. 2-letter code (US, CA, GB, FR, MA, AE …) or a country name.",
            "default": "US"
          },
          "locale": {
            "title": "Language of place names",
            "enum": [
              "en",
              "fr"
            ],
            "type": "string",
            "description": "Language for country, city and carrier names.",
            "default": "en"
          },
          "deduplicate": {
            "title": "Remove duplicates",
            "type": "boolean",
            "description": "Keep each number once, even when written in different formats. When off, repeats are output with a DUPLICATE flag. Duplicates are never charged.",
            "default": true
          },
          "includeInvalid": {
            "title": "Include invalid numbers",
            "type": "boolean",
            "description": "Also output invalid numbers with the reason (TOO_SHORT, INVALID_NUMBER …). Turn off to get valid numbers only; skipped numbers are not charged.",
            "default": true
          },
          "keepSourceRecord": {
            "title": "Keep the original row",
            "type": "boolean",
            "description": "Attach the full original row or dataset item to each result, to merge back into your list or CRM.",
            "default": false
          },
          "maxNumbers": {
            "title": "Max numbers",
            "minimum": 0,
            "type": "integer",
            "description": "Stop after this many unique numbers. 0 = no limit.",
            "default": 0
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}