npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

forvo

v1.0.0

Published

Forvo’s API gives you access to 4 million audio pronunciations and translations in over 340 languages.

Downloads

13

Readme

forvo

Forvo’s API gives you access to 4 million audio pronunciations and translations in over 340 languages.

Getting started

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));

API

Table of Contents

forvoApi

This function creates forvo api.

Parameters

  • options object Configuration object for forvo api
    • options.key string Your forvo api key

Examples

import forvoApi from 'forvo';

const forvo = forvoApi({ key: 'your api key' });

Returns API Api

Api

This object represents a forvo Api.

Type: Object

Properties

  • 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..

Api.wordPronunciations

This function gets all the pronunciations from a word.

Parameters

  • parameters object Parameters object provided for forvo api
    • parameters.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.

Examples

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

Api.standardPronunciation

This function gets the standard (top rated) pronunciation from a word.

Parameters

  • parameters object Parameters object provided for forvo api
    • parameters.word string The word you want to get its pronunciations.
    • parameters.language string? To get only the pronunciations recorded in the given language.

Examples

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

Api.languageList

This function gets languages availables at Forvo.

Parameters

  • parameters object Parameters object provided for forvo api
    • parameters.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.

Examples

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.

Api.popularLanguages

This function gets the most popular languages.

Parameters

  • parameters object Parameters object provided for forvo api
    • parameters.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.

Examples

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

Api.pronouncedWordsSearch

This function gets words starting with a pattern alphabetically ordered with one or more pronunciations.

Parameters

  • parameters object Parameters object provided for forvo api
    • parameters.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.

Examples

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

Api.wordsSearch

This function gets words starting with a pattern alphabetically ordered.

Parameters

  • parameters object Parameters object provided for forvo api
    • parameters.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.

Examples

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

Api.popularPronouncedWords

This function gets the most popular words with, at least, one pronunciation.

Parameters

  • parameters object Parameters object provided for forvo api
    • parameters.language string? To get only the words in the given language.
    • parameters.limit number? Values: any integer number. Max. word returned. Default is 1000.

Examples

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.