Get quote

Description

Find out the price for your project. For volume discount, please contact contact Mr. VoiceBunny.

Arguments

= required
= only one of these is required
NameTypeDescriptionDefault value
script
textText that will be read by voice actors. Write instructions inside of [ ]. They won't count towards the word/character total. If you want to receive multiple files, submit the different parts as a JSON array, naming the key of each element anyway you wish (see advanced example below). The name of each key will be used to name the audio files.
numberOfCharacters
integerNumber of characters that will be read by voice actors. It should only be used for languages with characters-based pricing.
numberOfWords
integerNumber of words that will be read by voice actors. It should only be used for languages with word-based pricing.
language
stringLanguage (and regional accent) wanted for the read. Valid values can be obtained with the /languages operation.
fulfilmentTypestringHow would you like to obtain your recording?
"speedy": Fastest method. Get your entire script recorded quickly. Mr. VoiceBunny and his entourage pick the best voice actor.
"casting": Get auditions from several voice actors, pick a winner, and he or she will then record the full script.
"booking": Get one full recording from the voice of your choice.
For a full comparison chart: Check our pricing page.
speedy
numberOfPartsintegerNumber of individual files neededNumber of files in script or 1
genderAndAgestringGender and age wanted for the read. Valid values can be obtained with the /genderAndAges operation.middleAgeMale
syncedRecordingintegerSet this argument to "1" if the recording needs to be synced. For example: synchronization with a video or presentation. The price of the project will be 50% higher.0
maxEntrantsintegerFor projects with fulfillmentType "casting", this is the mumber of voice actors requested to submit reads or auditions. Minimum value is 3, maximum value is 50.
talentIDstringUnique identifier of the voice actor wanted for the project.

Response example

{
  "quote":{
    "price":12,
    "listPrice":12,
    "currency":"USD"
  },
  "timestamp":1571320302
}
<?xml version="1.0" encoding="UTF-8"?>
<quote>
  <quote>
    <price>12</price>
    <listPrice>12</listPrice>
    <currency>USD</currency>
  </quote>
  <timestamp>1571320302</timestamp>
</quote>

Errors

  • 5007: The "language" argument is not valid. You can get the list of available languages and accents using the API operation /languages.
  • 5033: Please provide a value for the "language" argument.
  • 5058: Please provide a value either for the "script" or "numberOfWords" arguments, but not both.
  • 5059: Please provide a value either for the "script" or "numberOfCharacters" arguments, but not both.
  • 5060: The value for "numberOfWords" should be positive integer.
  • 5061: The value for "numberOfCharacters" should be positive integer.
  • 5062: Please provide a value for the "script" or "numberOfWords" arguments.
  • 5063: Please provide a value for the "script" or "numberOfCharacters" arguments.
  • 5065: The value for "syncedRecording" should be 0 or 1.
  • 5066: When fulfilmentType = contest, the "maxEntrants" argument should be a value between 3 and 15
  • 5102: The "talentID" argument is not valid.
  • 5103: When fulfilmentType = booking, the 'talentID' argument should not be empty.
  • 5106: Bummer! The talent you chose is not accepting bookings at this time. Please select another voice actor or contact Mr. Bunny for help.
  • 5150:

Basic example

@Grab(group='org.codehaus.groovy.modules.http-builder', module='http-builder', version='0.5.2' )

import groovyx.net.http.*
import groovy.json.*
import static groovyx.net.http.ContentType.*
import static groovyx.net.http.Method.*

http = new HTTPBuilder('https://api.voicebunny.com')
http.handler.success = {response, json -> return json}
http.handler.failure = {response, json -> throw new RuntimeException(json.error.code + ' ' + json.error.message)}
def voicebunnyUser = 'xxXXxx'
def voicebunnyToken = 'xxxxXXXXxxxxXXXX'
http.auth.basic voicebunnyUser, voicebunnyToken
def data = [
	language: 'eng-us',
	script: 'the script I want to quote'
]
def quote = http.post(path: 'projects/quote', body: data, requestContentType: URLENC)
import java.io.*;
import java.net.*;
import java.util.*;
import java.util.Map.Entry;
import org.apache.commons.codec.binary.Base64;

public class Voicebunny {

    private String user = "xxXXxx";

    private String token = "xxxxXXXXxxxxXXXX";

    private String encodedAuthorization = "";

    private String host = "https://api.voicebunny.com";

    public Voicebunny() {
        String userpassword = user + ":" + token;
        encodedAuthorization = Base64.encodeBase64String(userpassword.getBytes());
    }

    public static void main(String[] args) throws IOException {
        Voicebunny vb = new Voicebunny();
        System.out.println(vb.quoteProject());
    }

    private String quoteProject() throws UnsupportedEncodingException, MalformedURLException, ProtocolException, IOException {
        Map<String, String> params = new HashMap<String, String>();
        params.put("script", "testing the qouting functionality");
        params.put("language", "eng-us");
        return post("projects/quote", params);
    }

    private String post(String resource, Map<String, String> params) throws UnsupportedEncodingException, MalformedURLException, IOException, ProtocolException {
        String data = "";
        for (Entry<String, String> entry : params.entrySet()) {
            if (!data.isEmpty()) {
                data += "&";
            }
            data += (URLEncoder.encode(entry.getKey(), "UTF-8") + "=" + URLEncoder.encode(entry.getValue(), "UTF-8"));
        }

        URL url = new URL(host + "/" + resource);
        HttpURLConnection connection = (HttpURLConnection) url.openConnection();
        connection.setRequestMethod("POST");
        connection.setRequestProperty("Authorization", "Basic " + encodedAuthorization);
        connection.setDoOutput(true);
        OutputStreamWriter wr = new OutputStreamWriter(connection.getOutputStream());
        wr.write(data);
        wr.flush();
        InputStream in = connection.getInputStream();
        BufferedReader reader = new BufferedReader(new InputStreamReader(in));
        StringBuffer sb = new StringBuffer();
        String line = "";
        while ((line = reader.readLine()) != null) {
            sb.append(line);
        }
        wr.close();
        reader.close();
        return sb.toString();
    }

}
<?php
$url_api = 'https://api.voicebunny.com/projects/quote/';
$postVars = array(
	'script'=>'this is sample text',
	'language'=>'eng-us'
);
$vars = http_build_query($postVars);
$opts = array(
	CURLOPT_URL => $url_api,
	CURLOPT_RETURNTRANSFER => TRUE,
	CURLOPT_INFILESIZE => -1,
	CURLOPT_TIMEOUT => 60,
	CURLOPT_SSL_VERIFYPEER => false,
	CURLOPT_POST => TRUE,
	CURLOPT_POSTFIELDS => $vars,
);
$curl = curl_init();
curl_setopt_array($curl, $opts);
$response = curl_exec($curl);
$status = curl_getinfo($curl, CURLINFO_HTTP_CODE);
curl_close($curl);
print_r($response);
?>
import requests
import simplejson
from requests.auth import HTTPBasicAuth

url = 'https://api.voicebunny.com'
api_id = 'XX'
api_key = "xxxxXXXXxxxxXXXX"
req = requests.get(url+'/projects/quote', 
    data={'text': 'Script sample',
    'language': 'eng-us'},
    auth=HTTPBasicAuth(api_id, api_key),verify=False)
data = simplejson.loads(req.text)
response = data['quote']
require 'faraday'
require 'faraday_middleware'

@conn = nil
@api_id = "XX"
@api_key = "xxxxXXXXxxxxXXXX"
resp = nil

@conn = Faraday.new(:url =>("https://"+ @api_id+":"+@api_key +"@api.voicebunny.com"),:ssl => {:verify => false}) do |builder|
	builder.use Faraday::Request::Multipart
	builder.use Faraday::Request::UrlEncoded
	builder.use Faraday::Response::ParseJson
	builder.use Faraday::Adapter::NetHttp		  
end
end

resp = @conn.post '/projects/add.json', {
	text: 'Script sample',
        language: 'eng-us'
}
resp.body

Advanced example

@Grab(group='org.codehaus.groovy.modules.http-builder', module='http-builder', version='0.5.2' )

import groovyx.net.http.*
import groovy.json.*
import static groovyx.net.http.ContentType.*
import static groovyx.net.http.Method.*

http = new HTTPBuilder('https://api.voicebunny.com')
http.handler.success = {response, json -> return json}
http.handler.failure = {response, json -> throw new RuntimeException(json.error.code + ' ' + json.error.message)}
def voicebunnyUser = 'xxXXxx'
def voicebunnyToken = 'xxxxXXXXxxxxXXXX'
http.auth.basic voicebunnyUser, voicebunnyToken
def data = [
	language: 'wuu-zh',
	numberOfCharacters: 5,
	fulfilmentType: 'speedy',
	syncedRecording: 1
]
def quote = http.post(path: 'projects/quote', body: data, requestContentType: URLENC)
import java.io.*;
import java.net.*;
import java.util.*;
import java.util.Map.Entry;
import org.apache.commons.codec.binary.Base64;

public class Voicebunny {

    private String user = "xxXXxx";

    private String token = "xxxxXXXXxxxxXXXX";

    private String encodedAuthorization = "";

    private String host = "https://api.voicebunny.com";

    public Voicebunny() {
        String userpassword = user + ":" + token;
        encodedAuthorization = Base64.encodeBase64String(userpassword.getBytes());
    }

    public static void main(String[] args) throws IOException {
        Voicebunny vb = new Voicebunny();
        System.out.println(vb.quoteProject());
    }

    private String quoteProject() throws UnsupportedEncodingException, MalformedURLException, ProtocolException, IOException {
        Map<String, String> params = new HashMap<String, String>();
        params.put("numberOfCharacters", "5");
	params.put("language", "wuu-zh");
	params.put("fulfilmentType", "speedy");
	params.put("timedRecording", "1");
        return post("projects/quote", params);
    }

    private String post(String resource, Map<String, String> params) throws UnsupportedEncodingException, MalformedURLException, IOException, ProtocolException {
        String data = "";
        for (Entry<String, String> entry : params.entrySet()) {
            if (!data.isEmpty()) {
                data += "&";
            }
            data += (URLEncoder.encode(entry.getKey(), "UTF-8") + "=" + URLEncoder.encode(entry.getValue(), "UTF-8"));
        }

        URL url = new URL(host + "/" + resource);
        HttpURLConnection connection = (HttpURLConnection) url.openConnection();
        connection.setRequestMethod("POST");
        connection.setRequestProperty("Authorization", "Basic " + encodedAuthorization);
        connection.setDoOutput(true);
        OutputStreamWriter wr = new OutputStreamWriter(connection.getOutputStream());
        wr.write(data);
        wr.flush();
        InputStream in = connection.getInputStream();
        BufferedReader reader = new BufferedReader(new InputStreamReader(in));
        StringBuffer sb = new StringBuffer();
        String line = "";
        while ((line = reader.readLine()) != null) {
            sb.append(line);
        }
        wr.close();
        reader.close();
        return sb.toString();
    }

}
<?php
$url_api = 'https://api.voicebunny.com/projects/quote/';
$postVars = array(
	'numberOfCharacters'=>5,
	'language'=>'wuu-zh',
	'fulfilmentType'=>'speedy',
	'syncedRecording'=>1
);
$vars = http_build_query($postVars);
$opts = array(
	CURLOPT_URL => $url_api,
	CURLOPT_RETURNTRANSFER => TRUE,
	CURLOPT_INFILESIZE => -1,
	CURLOPT_TIMEOUT => 60,
	CURLOPT_SSL_VERIFYPEER => false,
	CURLOPT_POST => TRUE,
	CURLOPT_POSTFIELDS => $vars,
);
$curl = curl_init();
curl_setopt_array($curl, $opts);
$response = curl_exec($curl);
$status = curl_getinfo($curl, CURLINFO_HTTP_CODE);
curl_close($curl);
print_r($response);
?>
import requests
import simplejson
from requests.auth import HTTPBasicAuth

url = 'https://api.voicebunny.com'
api_id = 'XX'
api_key = "xxxxXXXXxxxxXXXX"
req = requests.get(url+'/projects/quote', 
    data={'numberOfCharacters': '5',
    'fulfilmentType': 'speedy',
    'syncedRecording': '1',
    'language': 'wuu-zh'},
    auth=HTTPBasicAuth(api_id, api_key),verify=False)
data = simplejson.loads(req.text)
response = data['quote']
require 'faraday'
require 'faraday_middleware'

@conn = nil
@api_id = "XX"
@api_key = "xxxxXXXXxxxxXXXX"
resp = nil

@conn = Faraday.new(:url =>("https://"+ @api_id+":"+@api_key +"@api.voicebunny.com"),:ssl => {:verify => false}) do |builder|
	builder.use Faraday::Request::Multipart
	builder.use Faraday::Request::UrlEncoded
	builder.use Faraday::Response::ParseJson
	builder.use Faraday::Adapter::NetHttp		  
end
end

resp = @conn.post '/projects/add.json', {
	numberOfCharacters: '5',
	fulfilmentType: 'speedy',
	syncedRecording: '1',
        language: 'wuu-zh'
}
resp.body