Get call price
Agent Skill
Automate this endpoint with an AI agent using the 2chat-calls skill:
npx skills add 2ChatCo/agent-skills -s 2chat-calls
Retrieve the estimated per-minute price for calling a given destination phone number. Use this endpoint to check the cost of a call before placing it.
Path parameters
| Parameter | Description | Example |
|---|---|---|
phone-number | The destination phone number in international format. Can be provided with or without the leading + | +595984153762 |
- cURL
- Python
- JavaScript
curl -L 'https://api.p.2chat.io/open/voip/estimated-call-price/+595984153762' \
--header 'X-User-API-Key: your_api_key_here'
import requests
url = "https://api.p.2chat.io/open/voip/estimated-call-price/+595984153762"
payload = ""
headers = {
'X-User-API-Key': 'your_api_key_here'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
var axios = require('axios');
var data = '';
var config = {
method: 'get',
url: 'https://api.p.2chat.io/open/voip/estimated-call-price/+595984153762',
headers: {
'X-User-API-Key': 'your_api_key_here'
},
data : data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
Response
The API returns the estimated per-minute price for calling the destination number, along with the matched dialing prefix and location.
{
"success": true,
"call_price": {
"prefix": "595",
"location_name": "Paraguay",
"price_per_minute": 0.0379
}
}
Response fields
| Field | Description | Example values |
|---|---|---|
prefix | The international dialing prefix matched for the destination number | 595 |
location_name | Human-readable name of the country or region associated with the prefix | Paraguay |
price_per_minute | Estimated price per minute in USD for calling the destination | 0.0379 |