音声リソース

The Pricing Voice resource provides a simple API to pull real-time, account-specific pricing for Twilio's Programmable Voice product. Prices can be retrieved at a country level via the Pricing Voice Countries resource or for a specific phone number via the Pricing Voice Numbers resource.

Pricing Voice Country インスタンスリソース

このリソースは、電話番号プレフィックスで編成した特定の国の電話番号に音声通話を発信する料金(OutboundPrefixPrices)および電話番号タイプで編成したその国で Twilio 電話番号にかけられた音声通話を受信する料金(InboundCallPrices)を表します。

リソース URL

https://pricing.twilio.com/v1/Voice/Countries/{Country}

{Country} は、ISO 3166-1 alpha-2 フォーマットの国コードです。

リソースのプロパティ

Pricing Voice Country リソースには、次のプロパティがあります。

プロパティ 説明
国の名前です。
IsoCountry ISO 国コードです。
OutboundPrefixPrices OutboundPrefixPrice レコードのリストです。
InboundCallPrices InboundCallPrice レコードのリストです。
PriceUnit 料金の単位となる通貨です。ISO 4127フォーマットを使用します(例:usdeurjpy)。

OutboundPrefixPrice レコード:

プロパティ 説明
Prefixes リクエストされた国の同一料金を使用する一連の電話番号プレフィックスです。
FriendlyName この一連のプレフィックスを説明するテキストです。
BasePrice このプレフィックスリストに一致する番号に通話を発信する 1 分あたりの小売料金です。
CurrentPrice このプレフィックスリストに一致する番号に通話を発信する現在の 1 分あたりの料金(数量割引またはカスタム割引の適用対象)です。

InboundCallPrice レコード:

プロパティ 説明
NumberType 電話番号タイプです(localmobilenational、または toll free のいずれか)。
BasePrice この電話番号タイプへの通話を受信する 1 分あたりの小売料金です。
CurrentPrice この電話番号タイプへの通話を受信する現在の 1 分あたりの料金(数量割引またはカスタム割引の適用対象)です。

コードサンプルを読み込んでいます...
Language
SDKバージョン:
  • 4.x
  • 5.x
レスポンス形式:
  • JSON
SDKバージョン:
  • 6.x
  • 7.x
SDKバージョン:
  • 2.x
  • 3.x
SDKバージョン:
  • 4.x
  • 5.x
SDKバージョン:
  • 5.x
  • 6.x
SDKバージョン:
  • 4.x
  • 5.x
形式:
  • JSON
// Download the Node helper library from twilio.com/docs/node/install
// These vars are your accountSid and authToken from twilio.com/user/account
var accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
var authToken = 'your_auth_token';
var PricingClient = require('twilio').PricingClient;
var client = new PricingClient(accountSid, authToken);

client.voice.countries('EE').get(function(err, country) {
    var cpList = country.inboundCallPrices;
    for (var i = 0; i < cpList.length; i++) {
        console.log(cpList[i].numberType + ' ' + cpList[i].currentPrice + '\n');
    }
});
// Get your Account SID and Auth Token from twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';

// Get twilio-node from twilio.com/docs/libraries/node
const client = require('twilio')(accountSid, authToken).pricing;

client.voice.countries('EE').fetch()
  .then((country) => {
    country.inboundCallPrices.forEach((price) => {
      console.log(`${price.number_type} ${price.current_price}`);
    });
  })
  .catch((error) => {
    console.log(error);
    throw error;
  });
// Download the twilio-csharp library from twilio.com/docs/csharp/install
using System;
using Twilio.Pricing;

class Example
{
  static void Main(string[] args)
  {
    // Find your Account Sid and Auth Token at twilio.com/user/account
    const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
    const string authToken = "your_auth_token";
    var pricingClient = new PricingClient(accountSid, authToken);

    // Look up pricing information for the UK
    var country = pricingClient.GetVoiceCountry("EE");
    // Print inbound call pricing for this country
    foreach (InboundCallPrice p in country.InboundCallPrices)
    {
        Console.WriteLine(p.NumberType);
        Console.WriteLine(p.CurrentPrice);
    } 
  }
}
<?php
// Get the PHP helper library from https://twilio.com/docs/libraries/php
require_once('/path/to/twilio-php/Services/Twilio.php'); // Loads the library

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";
$client = new Pricing_Services_Twilio($sid, $token);

$country = $client->voiceCountries->get("EE");

foreach ($country->inbound_call_prices as $p) {
    echo $p->number_type . " " . $p->current_price . "\n";
}
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'twilio-ruby'

# Get your Account Sid and Auth Token from twilio.com/user/account
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::PricingClient.new account_sid, auth_token

@country = @client.voice.countries.get('EE')
@country.inbound_call_prices.each do |p|
  puts "#{p['number_type']} #{p['current_price']}"
end
// Download the twilio-csharp library from twilio.com/docs/libraries/csharp
using System;
using Twilio;
using Twilio.Rest.Pricing.V1.Voice;

public class Example
{
    public static void Main(string[] args)
    {
        // Find your Account SID and Auth Token at twilio.com/console
        const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        const string authToken = "your_auth_token";

        TwilioClient.Init(accountSid, authToken);

        var country = CountryResource.Fetch("EE");

        foreach (var price in country.InboundCallPrices)
        {
            Console.WriteLine(price.CurrentPrice);
        }
    }
}
<?php
// Get the PHP helper library from https://twilio.com/docs/libraries/php
require_once '/path/to/vendor/autoload.php'; // Loads the library

use Twilio\Rest\Client;

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";

$client = new Client($sid, $token);

$country = $client->pricing->voice->countries("EE")->fetch();

foreach ($country->inboundCallPrices as $p) {
    echo "{$p["number_type"]} {$p["current_price"]}\n";
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import TwilioPricingClient

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"
client = TwilioPricingClient(account_sid, auth_token)

country = client.voice.countries.get("EE")

for p in country.inbound_call_prices:
    print("{} {}".format(p['number_type'], p['current_price']))
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'twilio-ruby'

# Get your Account SID and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new(account_sid, auth_token)

country = @client.pricing.voice.countries('EE')
country.fetch.inbound_call_prices.each do |p|
  puts "#{p['number_type']} #{p['current_price']}"
end
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.sdk.TwilioPricingClient;
import com.twilio.sdk.TwilioRestException;
import com.twilio.sdk.resource.instance.pricing.VoiceCountry;

public class Example {

	// Find your Account Sid and Token at twilio.com/user/account
	public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
	public static final String AUTH_TOKEN = "your_auth_token";

	public static void main(String[] args) throws TwilioRestException {
		TwilioPricingClient client = new TwilioPricingClient(ACCOUNT_SID, AUTH_TOKEN);

		// Get Twilio Voice pricing information for a specific country
		VoiceCountry c = client.getVoiceCountry("EE");

		for (VoiceCountry.InboundCallPrice p : c.getInboundCallPrices()) {
			// For each call pricing category, print number type and
			// current (reflecting any discounts your account has) price.
			System.out.println(p.getNumberType().toString());
			System.out.println(p.getCurrentPrice().toString());
		}
	}
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import Client

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"
client = Client(account_sid, auth_token)

country = client.pricing \
                .voice \
                .countries("EE") \
                .fetch()

for p in country.inbound_call_prices:
    print("{} {}".format(p['number_type'], p['current_price']))
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.Twilio;
import com.twilio.rest.pricing.v1.voice.Country;
import com.twilio.type.InboundCallPrice;

public class Example {
  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) {
    Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

    // Get Twilio Voice pricing information for a specific country
    Country voiceCountry = Country.fetcher("EE").fetch();

    for (InboundCallPrice price : voiceCountry.getInboundCallPrices()) {
      // For each call pricing category, print number type and
      // current (reflecting any discounts your account has) price.
      System.out.println(price.getType());
      System.out.println(price.getCurrentPrice());
    }
  }
}
$ curl -XGET https://pricing.twilio.com/v1/Voice/Countries/EE \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
{
    "country" : "Estonia",
    "iso_country": "EE",
    "outbound_prefix_prices": [
	{
            "prefixes": ["37240", "37270", "37281", "37282"],
            "friendly_name": "Programmable Outbound Minute - Estonia - Other",
            "base_price": "0.465",
            "current_price": "0.465"
        },
	{
            "prefixes": ["3725"],
            "friendly_name": "Programmable Outbound Minute - Estonia - Mobile",
            "base_price": "0.0575",
            "current_price": "0.0575"
        },
        {
            "prefixes": ["372"],
            "friendly_name": "Programmable Outbound Minute - Estonia",
            "base_price": "0.033",
            "current_price": "0.030"
        },
    ],
    "inbound_call_prices": [
        {
            "number_type": "national",
            "base_price": "0.0075",
            "current_price": "0.0070"
        }
    ],
    "price_unit": "USD",
    "url" : "https://pricing.twilio.com/v1/Voice/Countries/EE"
}
エストニアの音声の料金を検索する

Pricing Voice Country リストリソース:

リソース URL

https://pricing.twilio.com/v1/Voice/Countries

HTTP GET

Twilio 音声サービスが提供されている国のリストおよび国固有の音声料金を取得するための URL を返します。このリストはページ情報を含みます。

Twilio 音声サービスが提供されている国のリストを取得します。

コードサンプルを読み込んでいます...
Language
SDKバージョン:
  • 4.x
  • 5.x
レスポンス形式:
  • JSON
SDKバージョン:
  • 6.x
  • 7.x
SDKバージョン:
  • 2.x
  • 3.x
SDKバージョン:
  • 4.x
  • 5.x
SDKバージョン:
  • 5.x
  • 6.x
SDKバージョン:
  • 4.x
  • 5.x
形式:
  • JSON
// Download the Node helper library from twilio.com/docs/node/install
// These vars are your accountSid and authToken from twilio.com/user/account
var accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
var authToken = 'your_auth_token';
var PricingClient = require('twilio').PricingClient;
var client = new PricingClient(accountSid, authToken);

client.voice.countries.list(function(error, response) {
    var cList = response.countries;
    for (var i = 0; i < cList.length; i++) {
        console.log(cList[i].isoCountry + '\n');
    }
});
// Get your Account SID and Auth Token from twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';

// Get twilio-node from twilio.com/docs/libraries/node
const client = require('twilio')(accountSid, authToken).pricing;

client.voice.countries.list()
  .then((countries) => {
    countries.forEach((country) => {
      console.log(country.isoCountry);
    });
  })
  .catch((error) => {
    console.log(error);
    throw error;
  });
// Download the twilio-csharp library from twilio.com/docs/csharp/install
using System;
using Twilio.Pricing;

class Example
{
  static void Main(string[] args)
  {
    // Find your Account Sid and Auth Token at twilio.com/user/account
    const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
    const string authToken = "your_auth_token";
    var pricingClient = new PricingClient(accountSid, authToken);

    // List countries where Twilio Phone Numbers are available
    var result = pricingClient.ListVoiceCountries();
    foreach (VoiceCountry c in result.Countries)
    {
        Console.WriteLine(c.IsoCountry);
    }
  }
}
<?php
// Get the PHP helper library from https://twilio.com/docs/libraries/php
require_once('/path/to/twilio-php/Services/Twilio.php'); // Loads the library

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";
$client = new Pricing_Services_Twilio($sid, $token);

foreach ($client->voiceCountries as $c) {
    echo $c->iso_country . "\n";
}
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'twilio-ruby'

# Get your Account Sid and Auth Token from twilio.com/user/account
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::PricingClient.new account_sid, auth_token


@countries = @client.voice.countries.list()
@countries.each do |c|
  puts c.iso_country
end
// Download the twilio-csharp library from twilio.com/docs/libraries/csharp
using System;
using Twilio;
using Twilio.Rest.Pricing.V1.Voice;

public class Example
{
    public static void Main(string[] args)
    {
        // Find your Account SID and Auth Token at twilio.com/console
        const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        const string authToken = "your_auth_token";

        TwilioClient.Init(accountSid, authToken);

        var countries = CountryResource.Read();

        foreach (var country in countries)
        {
            Console.WriteLine(country.IsoCountry);
        }
    }
}
<?php
// Get the PHP helper library from https://twilio.com/docs/libraries/php
require_once '/path/to/vendor/autoload.php'; // Loads the library

use Twilio\Rest\Client;

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";

$client = new Client($sid, $token);

$voiceCountries = $client->pricing->voice->countries->read();

foreach ($voiceCountries as $c) {
    echo $c->isoCountry . PHP_EOL;
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import TwilioPricingClient

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"
client = TwilioPricingClient(account_sid, auth_token)

countries = client.voice.countries.list()

for c in countries:
    print(c.iso_country)
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'twilio-ruby'

# Get your Account SID and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new(account_sid, auth_token)

countries = @client.pricing.voice.countries.list
countries.each do |c|
  puts c.iso_country
end
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.sdk.TwilioPricingClient;
import com.twilio.sdk.TwilioRestException;
import com.twilio.sdk.resource.list.pricing.VoiceCountryList;
import com.twilio.sdk.resource.instance.pricing.VoiceCountry;

public class Example {

	// Find your Account Sid and Token at twilio.com/user/account
	public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
	public static final String AUTH_TOKEN = "your_auth_token";

	public static void main(String[] args) throws TwilioRestException {
		TwilioPricingClient client = new TwilioPricingClient(ACCOUNT_SID, AUTH_TOKEN);

		// Get a list of countries where Twilio Voice is available
		VoiceCountryList list = client.getVoiceCountries();

		for (VoiceCountry c : list.getPageData()) {
			System.out.println(c.getIsoCountry());
		}
	}
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import Client

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"
client = Client(account_sid, auth_token)

voice_countries = client.pricing \
                        .voice \
                        .countries \
                        .list()

for country in voice_countries:
    print(country.iso_country)
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.Twilio;
import com.twilio.base.ResourceSet;
import com.twilio.rest.pricing.v1.voice.Country;

public class Example {
  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) {
    Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

    // Get a list of countries where Twilio Voice is available
    ResourceSet<Country> countries = Country.reader().read();

    for (Country country : countries) {
      System.out.println(country.getIsoCountry());
    }
  }
}
$ curl -XGET https://pricing.twilio.com/v1/Voice/Countries \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
{
    "meta": {
        "page": 0,
        "page_size": 50,
        "first_page_url": "https://pricing.twilio.com/v1/Voice/Countries?PageSize=50&Page=0",
        "previous_page_url": null,
        "url": "https://pricing.twilio.com/v1/Voice/Countries?PageSize=50&Page=0",
        "next_page_url": "https://pricing.twilio.com/v1/Voice/Countries?PageSize=50&Page=1&PageToken=DNDE",
        "key": "countries"
    },
    "countries": [
        {
            "country": "Andorra",
            "iso_country": "AD",
            "url": "https://pricing.twilio.com/v1/Voice/Countries/AD"
        },
        {
            "country": "United Arab Emirates",
            "iso_country": "AE",
            "url": "https://pricing.twilio.com/v1/Voice/Countries/AE"
        }
	...
     ]
}
音声サービスが提供されている国をリストする

Pricing Voice Number インスタンスリソース:

このリソースは、特定の電話番号に音声通話を発信する料金(OutboundCallPrice)およびこの Twilio 電話番号にかけられた音声通話を受信する料金(InboundCallPrice)を表します。通話の発信元は、着信通話料金または発信通話料金に関係ありません。

リソース URL

https://pricing.twilio.com/v1/Voice/Numbers/{Phone Number}

{Phone Number} は、E.164 フォーマットの電話番号です。

リソースのプロパティ

プロパティ 説明
電話番号 料金が適用される E.164 フォーマットの電話番号です。
国の名前です。
IsoCountry ISO 国コードです。
OutboundCallPrice OutboundCallPrice レコードをご覧ください。
InboundCallPrice InboundCallPrice レコードをご覧ください(指定された電話番号がこのアカウントに属する Twilio 番号ではない場合、Null が返されます)。
PriceUnit 料金の単位となる通貨です。ISO 4127フォーマットを使用します(例:usdeurjpy)。

OutboundCallPrice レコード:

プロパティ 説明
BasePrice この番号に通話を発信する 1 分あたりの小売料金です。
CurrentPrice この番号に通話を発信する現在の 1 分あたりの料金(数量割引またはカスタム割引の適用対象)です。

電話番号 +15108675309 への音声通話の料金を取得します。

コードサンプルを読み込んでいます...
Language
SDKバージョン:
  • 4.x
  • 5.x
レスポンス形式:
  • JSON
SDKバージョン:
  • 6.x
  • 7.x
SDKバージョン:
  • 2.x
  • 3.x
SDKバージョン:
  • 4.x
  • 5.x
SDKバージョン:
  • 5.x
  • 6.x
SDKバージョン:
  • 4.x
  • 5.x
形式:
  • JSON
// Download the Node helper library from twilio.com/docs/node/install
// These vars are your accountSid and authToken from twilio.com/user/account
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const PricingClient = require('twilio').PricingClient;
const client = new PricingClient(accountSid, authToken);

client.voice.numbers('+15108675310').get((err, number) => {
  console.log(number.outboundCallPrice.currentPrice);
});
// Get your Account SID and Auth Token from twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';

// Get twilio-node from twilio.com/docs/libraries/node
const client = require('twilio')(accountSid, authToken).pricing;

client.voice
  .numbers('+15108675310')
  .fetch()
  .then(number => {
    console.log(number.outboundCallPrice.current_price);
  })
  .catch(error => {
    console.log(error);
    throw error;
  });
// Download the twilio-csharp library from twilio.com/docs/csharp/install
using System;
using Twilio.Pricing;

class Example
{
  static void Main(string[] args)
  {
    // Find your Account Sid and Auth Token at twilio.com/user/account
    const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
    const string authToken = "your_auth_token";
    var pricingClient = new PricingClient(accountSid, authToken);

    // Look up pricing information for calls to/from a specific number
    var number = pricingClient.GetVoiceNumber("+15108675310");
    Console.WriteLine(number.OutboundCallPrice.CurrentPrice);
  }
}
<?php
// Get the PHP helper library from https://twilio.com/docs/libraries/php
require_once('/path/to/twilio-php/Services/Twilio.php'); // Loads the library

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";
$client = new Pricing_Services_Twilio($sid, $token);

$number = $client->voiceNumbers->get("+15108675310");

echo $number->outbound_call_price->current_price . "\n";
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'twilio-ruby'

# Get your Account Sid and Auth Token from twilio.com/user/account
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::PricingClient.new account_sid, auth_token

@number = @client.voice.numbers.get('+15108675310')
puts @number.outbound_call_price['current_price']
// Download the twilio-csharp library from twilio.com/docs/libraries/csharp
using System;
using Twilio;
using Twilio.Rest.Pricing.V1.Voice;
using Twilio.Types;

public class Example
{
    public static void Main(string[] args)
    {
        // Find your Account SID and Auth Token at twilio.com/console
        const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        const string authToken = "your_auth_token";

        TwilioClient.Init(accountSid, authToken);

        var number = NumberResource.Fetch(new PhoneNumber("+15108675310"));

        Console.WriteLine(number.OutboundCallPrice.CurrentPrice);
    }
}
<?php
// Get the PHP helper library from https://twilio.com/docs/libraries/php
require_once '/path/to/vendor/autoload.php'; // Loads the library

use Twilio\Rest\Client;

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";

$client = new Client($sid, $token);

$number = $client->pricing->voice->numbers("+15108675310")->fetch();

$number->outboundCallPrice["current_price"] . PHP_EOL;
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import TwilioPricingClient

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"
client = TwilioPricingClient(account_sid, auth_token)

number = client.voice.numbers.get("+15108675310")

print(number.outbound_call_price['current_price'])
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'twilio-ruby'

# Get your Account SID and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new(account_sid, auth_token)

number = @client.pricing.voice.numbers('+15108675310')
puts number.fetch.outbound_call_price['current_price']
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.sdk.TwilioPricingClient;
import com.twilio.sdk.TwilioRestException;
import com.twilio.sdk.resource.instance.pricing.VoiceNumber;

public class Example {

	// Find your Account Sid and Token at twilio.com/user/account
	public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
	public static final String AUTH_TOKEN = "your_auth_token";

	public static void main(String[] args) throws TwilioRestException {
		TwilioPricingClient client = new TwilioPricingClient(ACCOUNT_SID, AUTH_TOKEN);

		// Get Twilio Voice pricing for calls to/from a specific number
		VoiceNumber n = client.getVoiceNumber("+15108675310");

		System.out.println(n.getOutboundCallPrice().getCurrentPrice().toString());
	}
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import Client

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"
client = Client(account_sid, auth_token)

number = client.pricing \
               .voice \
               .numbers("+15108675310") \
               .fetch()

print(number.outbound_call_price['current_price'])
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.Twilio;
import com.twilio.rest.pricing.v1.voice.Number;
import com.twilio.type.PhoneNumber;

public class Example {
  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) {
    Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

    // Get Twilio Voice pricing for calls to/from a specific number
    Number voiceNumber = Number.fetcher(new PhoneNumber("+15108675310")).fetch();

    System.out.println(voiceNumber.getOutboundCallPrice().getCurrentPrice());
  }
}
curl -XGET https://pricing.twilio.com/v1/Voice/Numbers/+15108675310 \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
{
    "number": "+15108675310",
    "country": "United States",
    "iso_country" : "US",
    "outbound_call_price": {
        "base_price": "0.015",
        "current_price": "0.015"
    },
    "inbound_call_price": {
        "number_type" : null,
        "base_price" : null,
        "current_price" : null
    },
    "price_unit": "USD",
    "url": "https://pricing.twilio.com/v1/Voice/Numbers/+15108673509"
}
電話番号への音声通話の料金を取得する

ヘルプが必要ですか?

誰しもが一度は考える「コーディングって難しい」。そんな時は、お問い合わせフォームから質問してください。 または、Stack Overflow でTwilioタグのついた情報から欲しいものを探してみましょう。

コードサンプルを読み込んでいます...
SDKバージョン:
  • 4.x
  • 5.x
レスポンス形式:
  • JSON
SDKバージョン:
  • 6.x
  • 7.x
SDKバージョン:
  • 2.x
  • 3.x
SDKバージョン:
  • 4.x
  • 5.x
SDKバージョン:
  • 5.x
  • 6.x
SDKバージョン:
  • 4.x
  • 5.x
形式:
  • JSON
// Download the Node helper library from twilio.com/docs/node/install
// These vars are your accountSid and authToken from twilio.com/user/account
var accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
var authToken = 'your_auth_token';
var PricingClient = require('twilio').PricingClient;
var client = new PricingClient(accountSid, authToken);

client.voice.countries('EE').get(function(err, country) {
    var cpList = country.inboundCallPrices;
    for (var i = 0; i < cpList.length; i++) {
        console.log(cpList[i].numberType + ' ' + cpList[i].currentPrice + '\n');
    }
});
// Get your Account SID and Auth Token from twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';

// Get twilio-node from twilio.com/docs/libraries/node
const client = require('twilio')(accountSid, authToken).pricing;

client.voice.countries('EE').fetch()
  .then((country) => {
    country.inboundCallPrices.forEach((price) => {
      console.log(`${price.number_type} ${price.current_price}`);
    });
  })
  .catch((error) => {
    console.log(error);
    throw error;
  });
// Download the twilio-csharp library from twilio.com/docs/csharp/install
using System;
using Twilio.Pricing;

class Example
{
  static void Main(string[] args)
  {
    // Find your Account Sid and Auth Token at twilio.com/user/account
    const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
    const string authToken = "your_auth_token";
    var pricingClient = new PricingClient(accountSid, authToken);

    // Look up pricing information for the UK
    var country = pricingClient.GetVoiceCountry("EE");
    // Print inbound call pricing for this country
    foreach (InboundCallPrice p in country.InboundCallPrices)
    {
        Console.WriteLine(p.NumberType);
        Console.WriteLine(p.CurrentPrice);
    } 
  }
}
<?php
// Get the PHP helper library from https://twilio.com/docs/libraries/php
require_once('/path/to/twilio-php/Services/Twilio.php'); // Loads the library

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";
$client = new Pricing_Services_Twilio($sid, $token);

$country = $client->voiceCountries->get("EE");

foreach ($country->inbound_call_prices as $p) {
    echo $p->number_type . " " . $p->current_price . "\n";
}
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'twilio-ruby'

# Get your Account Sid and Auth Token from twilio.com/user/account
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::PricingClient.new account_sid, auth_token

@country = @client.voice.countries.get('EE')
@country.inbound_call_prices.each do |p|
  puts "#{p['number_type']} #{p['current_price']}"
end
// Download the twilio-csharp library from twilio.com/docs/libraries/csharp
using System;
using Twilio;
using Twilio.Rest.Pricing.V1.Voice;

public class Example
{
    public static void Main(string[] args)
    {
        // Find your Account SID and Auth Token at twilio.com/console
        const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        const string authToken = "your_auth_token";

        TwilioClient.Init(accountSid, authToken);

        var country = CountryResource.Fetch("EE");

        foreach (var price in country.InboundCallPrices)
        {
            Console.WriteLine(price.CurrentPrice);
        }
    }
}
<?php
// Get the PHP helper library from https://twilio.com/docs/libraries/php
require_once '/path/to/vendor/autoload.php'; // Loads the library

use Twilio\Rest\Client;

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";

$client = new Client($sid, $token);

$country = $client->pricing->voice->countries("EE")->fetch();

foreach ($country->inboundCallPrices as $p) {
    echo "{$p["number_type"]} {$p["current_price"]}\n";
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import TwilioPricingClient

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"
client = TwilioPricingClient(account_sid, auth_token)

country = client.voice.countries.get("EE")

for p in country.inbound_call_prices:
    print("{} {}".format(p['number_type'], p['current_price']))
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'twilio-ruby'

# Get your Account SID and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new(account_sid, auth_token)

country = @client.pricing.voice.countries('EE')
country.fetch.inbound_call_prices.each do |p|
  puts "#{p['number_type']} #{p['current_price']}"
end
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.sdk.TwilioPricingClient;
import com.twilio.sdk.TwilioRestException;
import com.twilio.sdk.resource.instance.pricing.VoiceCountry;

public class Example {

	// Find your Account Sid and Token at twilio.com/user/account
	public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
	public static final String AUTH_TOKEN = "your_auth_token";

	public static void main(String[] args) throws TwilioRestException {
		TwilioPricingClient client = new TwilioPricingClient(ACCOUNT_SID, AUTH_TOKEN);

		// Get Twilio Voice pricing information for a specific country
		VoiceCountry c = client.getVoiceCountry("EE");

		for (VoiceCountry.InboundCallPrice p : c.getInboundCallPrices()) {
			// For each call pricing category, print number type and
			// current (reflecting any discounts your account has) price.
			System.out.println(p.getNumberType().toString());
			System.out.println(p.getCurrentPrice().toString());
		}
	}
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import Client

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"
client = Client(account_sid, auth_token)

country = client.pricing \
                .voice \
                .countries("EE") \
                .fetch()

for p in country.inbound_call_prices:
    print("{} {}".format(p['number_type'], p['current_price']))
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.Twilio;
import com.twilio.rest.pricing.v1.voice.Country;
import com.twilio.type.InboundCallPrice;

public class Example {
  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) {
    Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

    // Get Twilio Voice pricing information for a specific country
    Country voiceCountry = Country.fetcher("EE").fetch();

    for (InboundCallPrice price : voiceCountry.getInboundCallPrices()) {
      // For each call pricing category, print number type and
      // current (reflecting any discounts your account has) price.
      System.out.println(price.getType());
      System.out.println(price.getCurrentPrice());
    }
  }
}
$ curl -XGET https://pricing.twilio.com/v1/Voice/Countries/EE \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
{
    "country" : "Estonia",
    "iso_country": "EE",
    "outbound_prefix_prices": [
	{
            "prefixes": ["37240", "37270", "37281", "37282"],
            "friendly_name": "Programmable Outbound Minute - Estonia - Other",
            "base_price": "0.465",
            "current_price": "0.465"
        },
	{
            "prefixes": ["3725"],
            "friendly_name": "Programmable Outbound Minute - Estonia - Mobile",
            "base_price": "0.0575",
            "current_price": "0.0575"
        },
        {
            "prefixes": ["372"],
            "friendly_name": "Programmable Outbound Minute - Estonia",
            "base_price": "0.033",
            "current_price": "0.030"
        },
    ],
    "inbound_call_prices": [
        {
            "number_type": "national",
            "base_price": "0.0075",
            "current_price": "0.0070"
        }
    ],
    "price_unit": "USD",
    "url" : "https://pricing.twilio.com/v1/Voice/Countries/EE"
}
SDKバージョン:
  • 4.x
  • 5.x
レスポンス形式:
  • JSON
SDKバージョン:
  • 6.x
  • 7.x
SDKバージョン:
  • 2.x
  • 3.x
SDKバージョン:
  • 4.x
  • 5.x
SDKバージョン:
  • 5.x
  • 6.x
SDKバージョン:
  • 4.x
  • 5.x
形式:
  • JSON
// Download the Node helper library from twilio.com/docs/node/install
// These vars are your accountSid and authToken from twilio.com/user/account
var accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
var authToken = 'your_auth_token';
var PricingClient = require('twilio').PricingClient;
var client = new PricingClient(accountSid, authToken);

client.voice.countries.list(function(error, response) {
    var cList = response.countries;
    for (var i = 0; i < cList.length; i++) {
        console.log(cList[i].isoCountry + '\n');
    }
});
// Get your Account SID and Auth Token from twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';

// Get twilio-node from twilio.com/docs/libraries/node
const client = require('twilio')(accountSid, authToken).pricing;

client.voice.countries.list()
  .then((countries) => {
    countries.forEach((country) => {
      console.log(country.isoCountry);
    });
  })
  .catch((error) => {
    console.log(error);
    throw error;
  });
// Download the twilio-csharp library from twilio.com/docs/csharp/install
using System;
using Twilio.Pricing;

class Example
{
  static void Main(string[] args)
  {
    // Find your Account Sid and Auth Token at twilio.com/user/account
    const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
    const string authToken = "your_auth_token";
    var pricingClient = new PricingClient(accountSid, authToken);

    // List countries where Twilio Phone Numbers are available
    var result = pricingClient.ListVoiceCountries();
    foreach (VoiceCountry c in result.Countries)
    {
        Console.WriteLine(c.IsoCountry);
    }
  }
}
<?php
// Get the PHP helper library from https://twilio.com/docs/libraries/php
require_once('/path/to/twilio-php/Services/Twilio.php'); // Loads the library

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";
$client = new Pricing_Services_Twilio($sid, $token);

foreach ($client->voiceCountries as $c) {
    echo $c->iso_country . "\n";
}
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'twilio-ruby'

# Get your Account Sid and Auth Token from twilio.com/user/account
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::PricingClient.new account_sid, auth_token


@countries = @client.voice.countries.list()
@countries.each do |c|
  puts c.iso_country
end
// Download the twilio-csharp library from twilio.com/docs/libraries/csharp
using System;
using Twilio;
using Twilio.Rest.Pricing.V1.Voice;

public class Example
{
    public static void Main(string[] args)
    {
        // Find your Account SID and Auth Token at twilio.com/console
        const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        const string authToken = "your_auth_token";

        TwilioClient.Init(accountSid, authToken);

        var countries = CountryResource.Read();

        foreach (var country in countries)
        {
            Console.WriteLine(country.IsoCountry);
        }
    }
}
<?php
// Get the PHP helper library from https://twilio.com/docs/libraries/php
require_once '/path/to/vendor/autoload.php'; // Loads the library

use Twilio\Rest\Client;

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";

$client = new Client($sid, $token);

$voiceCountries = $client->pricing->voice->countries->read();

foreach ($voiceCountries as $c) {
    echo $c->isoCountry . PHP_EOL;
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import TwilioPricingClient

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"
client = TwilioPricingClient(account_sid, auth_token)

countries = client.voice.countries.list()

for c in countries:
    print(c.iso_country)
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'twilio-ruby'

# Get your Account SID and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new(account_sid, auth_token)

countries = @client.pricing.voice.countries.list
countries.each do |c|
  puts c.iso_country
end
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.sdk.TwilioPricingClient;
import com.twilio.sdk.TwilioRestException;
import com.twilio.sdk.resource.list.pricing.VoiceCountryList;
import com.twilio.sdk.resource.instance.pricing.VoiceCountry;

public class Example {

	// Find your Account Sid and Token at twilio.com/user/account
	public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
	public static final String AUTH_TOKEN = "your_auth_token";

	public static void main(String[] args) throws TwilioRestException {
		TwilioPricingClient client = new TwilioPricingClient(ACCOUNT_SID, AUTH_TOKEN);

		// Get a list of countries where Twilio Voice is available
		VoiceCountryList list = client.getVoiceCountries();

		for (VoiceCountry c : list.getPageData()) {
			System.out.println(c.getIsoCountry());
		}
	}
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import Client

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"
client = Client(account_sid, auth_token)

voice_countries = client.pricing \
                        .voice \
                        .countries \
                        .list()

for country in voice_countries:
    print(country.iso_country)
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.Twilio;
import com.twilio.base.ResourceSet;
import com.twilio.rest.pricing.v1.voice.Country;

public class Example {
  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) {
    Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

    // Get a list of countries where Twilio Voice is available
    ResourceSet<Country> countries = Country.reader().read();

    for (Country country : countries) {
      System.out.println(country.getIsoCountry());
    }
  }
}
$ curl -XGET https://pricing.twilio.com/v1/Voice/Countries \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
{
    "meta": {
        "page": 0,
        "page_size": 50,
        "first_page_url": "https://pricing.twilio.com/v1/Voice/Countries?PageSize=50&Page=0",
        "previous_page_url": null,
        "url": "https://pricing.twilio.com/v1/Voice/Countries?PageSize=50&Page=0",
        "next_page_url": "https://pricing.twilio.com/v1/Voice/Countries?PageSize=50&Page=1&PageToken=DNDE",
        "key": "countries"
    },
    "countries": [
        {
            "country": "Andorra",
            "iso_country": "AD",
            "url": "https://pricing.twilio.com/v1/Voice/Countries/AD"
        },
        {
            "country": "United Arab Emirates",
            "iso_country": "AE",
            "url": "https://pricing.twilio.com/v1/Voice/Countries/AE"
        }
	...
     ]
}
SDKバージョン:
  • 4.x
  • 5.x
レスポンス形式:
  • JSON
SDKバージョン:
  • 6.x
  • 7.x
SDKバージョン:
  • 2.x
  • 3.x
SDKバージョン:
  • 4.x
  • 5.x
SDKバージョン:
  • 5.x
  • 6.x
SDKバージョン:
  • 4.x
  • 5.x
形式:
  • JSON
// Download the Node helper library from twilio.com/docs/node/install
// These vars are your accountSid and authToken from twilio.com/user/account
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const PricingClient = require('twilio').PricingClient;
const client = new PricingClient(accountSid, authToken);

client.voice.numbers('+15108675310').get((err, number) => {
  console.log(number.outboundCallPrice.currentPrice);
});
// Get your Account SID and Auth Token from twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';

// Get twilio-node from twilio.com/docs/libraries/node
const client = require('twilio')(accountSid, authToken).pricing;

client.voice
  .numbers('+15108675310')
  .fetch()
  .then(number => {
    console.log(number.outboundCallPrice.current_price);
  })
  .catch(error => {
    console.log(error);
    throw error;
  });
// Download the twilio-csharp library from twilio.com/docs/csharp/install
using System;
using Twilio.Pricing;

class Example
{
  static void Main(string[] args)
  {
    // Find your Account Sid and Auth Token at twilio.com/user/account
    const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
    const string authToken = "your_auth_token";
    var pricingClient = new PricingClient(accountSid, authToken);

    // Look up pricing information for calls to/from a specific number
    var number = pricingClient.GetVoiceNumber("+15108675310");
    Console.WriteLine(number.OutboundCallPrice.CurrentPrice);
  }
}
<?php
// Get the PHP helper library from https://twilio.com/docs/libraries/php
require_once('/path/to/twilio-php/Services/Twilio.php'); // Loads the library

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";
$client = new Pricing_Services_Twilio($sid, $token);

$number = $client->voiceNumbers->get("+15108675310");

echo $number->outbound_call_price->current_price . "\n";
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'twilio-ruby'

# Get your Account Sid and Auth Token from twilio.com/user/account
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::PricingClient.new account_sid, auth_token

@number = @client.voice.numbers.get('+15108675310')
puts @number.outbound_call_price['current_price']
// Download the twilio-csharp library from twilio.com/docs/libraries/csharp
using System;
using Twilio;
using Twilio.Rest.Pricing.V1.Voice;
using Twilio.Types;

public class Example
{
    public static void Main(string[] args)
    {
        // Find your Account SID and Auth Token at twilio.com/console
        const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        const string authToken = "your_auth_token";

        TwilioClient.Init(accountSid, authToken);

        var number = NumberResource.Fetch(new PhoneNumber("+15108675310"));

        Console.WriteLine(number.OutboundCallPrice.CurrentPrice);
    }
}
<?php
// Get the PHP helper library from https://twilio.com/docs/libraries/php
require_once '/path/to/vendor/autoload.php'; // Loads the library

use Twilio\Rest\Client;

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";

$client = new Client($sid, $token);

$number = $client->pricing->voice->numbers("+15108675310")->fetch();

$number->outboundCallPrice["current_price"] . PHP_EOL;
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import TwilioPricingClient

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"
client = TwilioPricingClient(account_sid, auth_token)

number = client.voice.numbers.get("+15108675310")

print(number.outbound_call_price['current_price'])
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'twilio-ruby'

# Get your Account SID and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new(account_sid, auth_token)

number = @client.pricing.voice.numbers('+15108675310')
puts number.fetch.outbound_call_price['current_price']
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.sdk.TwilioPricingClient;
import com.twilio.sdk.TwilioRestException;
import com.twilio.sdk.resource.instance.pricing.VoiceNumber;

public class Example {

	// Find your Account Sid and Token at twilio.com/user/account
	public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
	public static final String AUTH_TOKEN = "your_auth_token";

	public static void main(String[] args) throws TwilioRestException {
		TwilioPricingClient client = new TwilioPricingClient(ACCOUNT_SID, AUTH_TOKEN);

		// Get Twilio Voice pricing for calls to/from a specific number
		VoiceNumber n = client.getVoiceNumber("+15108675310");

		System.out.println(n.getOutboundCallPrice().getCurrentPrice().toString());
	}
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import Client

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"
client = Client(account_sid, auth_token)

number = client.pricing \
               .voice \
               .numbers("+15108675310") \
               .fetch()

print(number.outbound_call_price['current_price'])
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.Twilio;
import com.twilio.rest.pricing.v1.voice.Number;
import com.twilio.type.PhoneNumber;

public class Example {
  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) {
    Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

    // Get Twilio Voice pricing for calls to/from a specific number
    Number voiceNumber = Number.fetcher(new PhoneNumber("+15108675310")).fetch();

    System.out.println(voiceNumber.getOutboundCallPrice().getCurrentPrice());
  }
}
curl -XGET https://pricing.twilio.com/v1/Voice/Numbers/+15108675310 \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
{
    "number": "+15108675310",
    "country": "United States",
    "iso_country" : "US",
    "outbound_call_price": {
        "base_price": "0.015",
        "current_price": "0.015"
    },
    "inbound_call_price": {
        "number_type" : null,
        "base_price" : null,
        "current_price" : null
    },
    "price_unit": "USD",
    "url": "https://pricing.twilio.com/v1/Voice/Numbers/+15108673509"
}