VoiceNumber Resource
Property nameTypeRequiredPIIDescriptionChild properties
The destination phone number in E.164 format, which consists of a + followed by the country code and subscriber number.
The origination phone number in [E.164 format, which consists of a + followed by the country code and subscriber number.
The currency in which prices are measured, specified in ISO 4127 format (e.g. usd, eur, jpy).
The absolute URL of the resource.
GET https://pricing.twilio.com/v2/Voice/Numbers/{DestinationNumber}
Property nameTypeRequiredPIIDescription
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function fetchVoiceNumber() {11const number = await client.pricing.v2.voice.numbers("+11111111111").fetch();1213console.log(number.destinationNumber);14}1516fetchVoiceNumber();
Response
1{2"country": "United States",3"destination_number": "+11111111111",4"inbound_call_price": {5"base_price": null,6"current_price": null,7"number_type": null8},9"iso_country": "US",10"origination_number": "+987654321",11"outbound_call_prices": [12{13"base_price": "0.013",14"current_price": "0.013",15"origination_prefixes": [16"ALL"17]18}19],20"price_unit": "USD",21"url": "https://pricing.twilio.com/v2/Voice/Numbers/+18001234567"22}