Forvo’s API gives you access to 4 million audio pronunciations and translations in over 340 languages.
First you need to have Forvo to be installed locally.
npm i --save forvo
Now you can get the best pronunciation for a word pronounced by native speaker. You need to have an API key for Forvo.
import forvoApi from 'forvo';
const forvo = forvoApi({ key: 'your api key' });
const start = async () => {
const wordPronunciations = await forvo.standardPronunciation({ word: 'auf Wiederschauen', language: 'de' })
// {
// items:[
// { id: 5943, word: 'auf_wiederschauen', original: 'auf Wiederschauen', pathmp3: 'https://apifree.forvo.com/audio/3h3h...
// ]
// }
}
start().catch(err => console.log(err.stack));
- forvoApi
- Api
- Api.wordPronunciations
- Api.standardPronunciation
- Api.languageList
- Api.popularLanguages
- Api.pronouncedWordsSearch
- Api.wordsSearch
- Api.popularPronouncedWords
This function creates forvo api.
import forvoApi from 'forvo';
const forvo = forvoApi({ key: 'your api key' });
Returns API Api
This object represents a forvo Api.
Type: Object
wordPronunciations
Api.wordPronunciations This function gets all the pronunciations from a word.standardPronunciation
Api.standardPronunciation This function gets the standard (top rated) pronunciation from a word.languageList
Api.languageList This function gets languages availables at Forvo.popularLanguages
Api.popularLanguages This function gets the most popular languages.pronouncedWordsSearch
Api.pronouncedWordsSearch This function gets words starting with a pattern alphabetically ordered with one or more pronunciations.wordsSearch
Api.wordsSearch This function gets words starting with a pattern alphabetically ordered.popularPronouncedWords
Api.popularPronouncedWords This function gets the most popular words with, at least, one pronunciation..
This function gets all the pronunciations from a word.
parameters
object Parameters object provided for forvo apiparameters.word
string The word you want to get its pronunciations.parameters.language
string? To get only the pronunciations recorded in the given language.parameters.country
string? To get only the pronunciations recorded by users of this country. You should use the Alpha-3 code.parameters.username
string? Returns the pronunciation recorded by a specific user.parameters.sex
string? m (for male), f (for female)parameters.rate
number? To get only the pronunciations rated with at least the given value.parameters.order
string? date-desc (pronunciations order by pronounced time, from recent to older) date-asc (pronunciations order by pronounced time, older to recent) rate-desc (pronunciations order by rate, high rated first) rate-asc (pronunciations order by rate, low rated first)parameters.limit
number? Max. pronunciations returned.parameters.groupInLanguages
boolean? Group pronunciations in languages. Default value is false.
import forvoApi from 'forvo';
const forvo = forvoApi({ key: 'your api key' });
const start = async () => {
const wordPronunciations = await forvo.wordPronunciations({ word: 'Apfel', language: 'de' })
// {
// attributes: { total: 11 },
// items:[
// { id: 5943, word: 'apfel', original: 'Apfel', pathmp3: 'https://apifree.forvo.com/audio/3h3h...
// ]
// }
}
start().catch(err => console.log(err.stack));
Returns Promise<Object> All the pronunciations from a word
This function gets the standard (top rated) pronunciation from a word.
parameters
object Parameters object provided for forvo api
import forvoApi from 'forvo';
const forvo = forvoApi({ key: 'your api key' });
const start = async () => {
const wordPronunciations = await forvo.standardPronunciation({ word: 'auf Wiederschauen', language: 'de' })
// {
// items:[
// { id: 5943, word: 'auf_wiederschauen', original: 'auf Wiederschauen', pathmp3: 'https://apifree.forvo.com/audio/3h3h...
// ]
// }
}
start().catch(err => console.log(err.stack));
Returns Promise<Object> Standard (top rated) pronunciation from a word
This function gets languages availables at Forvo.
parameters
object Parameters object provided for forvo apiparameters.language
string? Language code or "native" to get the language list with the names of the languages in their native languages. Default is English (en).parameters.order
string? Values: "name" or "code". Default is name.parameters.minPronunciations
number? Values: any integer number. To get only the languagues with, at least, the given number of pronunciations.
import forvoApi from 'forvo';
const forvo = forvoApi({ key: 'your api key' });
const start = async () => {
const wordPronunciations = await forvo.languageList()
// {
// attributes: { total: 349 },
// items:[
// { code: 'abq', en: 'Abaza' },
// { code: 'ab', en: 'Abkhazian' },
// ...
// ]
// }
}
start().catch(err => console.log(err.stack));
Returns Promise<Object> Languages availables at Forvo.
This function gets the most popular languages.
parameters
object Parameters object provided for forvo apiparameters.language
string? Values: Language code or "native" to get the language list with the names of the languages in their native languages. Default is English (en).parameters.order
string? Values: "popular", "name" or "code". Default is "popular".parameters.limit
string? Values: any integer number. Max. languages returned. Default is 10.
import forvoApi from 'forvo';
const forvo = forvoApi({ key: 'your api key' });
const start = async () => {
const wordPronunciations = await forvo.popularLanguages()
// {
// attributes: { total: 10 },
// items:[
// { code: 'de', en: 'German' },
// { code: 'tt', en: 'Tatar' },
// ...
// ]
// }
}
start().catch(err => console.log(err.stack));
Returns Promise<Object> The most popular languages
This function gets words starting with a pattern alphabetically ordered with one or more pronunciations.
parameters
object Parameters object provided for forvo apiparameters.search
string The pattern you want to search.parameters.language
string? To get only the pronunciations recorded in the given language.parameters.pagesize
number? Values: any integer number between 1-100. Set the page size in results. Default is 20.parameters.page
number? Values: any integer number. Set the page results you want to retrieve. Default is 1.
import forvoApi from 'forvo';
const forvo = forvoApi({ key: 'your api key' });
const start = async () => {
const wordPronunciations = await forvo.pronouncedWordsSearch({ search: 'aus', language: 'de' })
// {
// attributes: attributes: { page: 1, pagesize: 20, total_pages: 7, total: 121 },
// items:[
// { id: 20945, word: 'aus', original: 'aus', num_pronunciations: '4', standard_pronunciation: ... },
// { id: 20945, word: 'aus_dem_weg_gehen', original: 'aus dem Weg gehen', num_pronunciations ... }
// ...
// ]
// }
}
start().catch(err => console.log(err.stack));
Returns Promise<Object> Words starting with a pattern alphabetically ordered with one or more pronunciations
This function gets words starting with a pattern alphabetically ordered.
parameters
object Parameters object provided for forvo apiparameters.search
string The pattern you want to search.parameters.language
string? To get only the pronunciations recorded in the given language.parameters.pagesize
number? Values: any integer number between 1-100. Set the page size in results. Default is 20.parameters.page
number? Values: any integer number. Set the page results you want to retrieve. Default is 1.
import forvoApi from 'forvo';
const forvo = forvoApi({ key: 'your api key' });
const start = async () => {
const wordPronunciations = await forvo.wordsSearch({ search: 'aus', language: 'de' })
// {
// attributes: attributes: { page: 1, pagesize: 20, total_pages: 7, total: 121 },
// items:[
// { id: 20945, word: 'aus', original: 'aus', num_pronunciations: '4', standard_pronunciation: ... },
// { id: 20945, word: 'aus_dem_weg_gehen', original: 'aus dem Weg gehen', num_pronunciations ... }
// ...
// ]
// }
}
start().catch(err => console.log(err.stack));
Returns Promise<Object> Words starting with a pattern alphabetically ordered
This function gets the most popular words with, at least, one pronunciation.
parameters
object Parameters object provided for forvo api
import forvoApi from 'forvo';
const forvo = forvoApi({ key: 'your api key' });
const start = async () => {
const wordPronunciations = await forvo.popularPronouncedWords({ language: 'de' })
// {
// attributes: { total: 993 },
// items:[
// { id: 5619, word: 'adidas', original: 'Adidas', num_pronunciations: '4' },
// { id: 3697234, word: 'airbagbereich', original: 'Airbagbereich', num_pronunciations: '3' }
// ...
// ]
// }
}
start().catch(err => console.log(err.stack));
Returns Promise<Object> The most popular words with, at least, one pronunciation.