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 🙏

© 2026 – Pkg Stats / Ryan Hefner

audible-api-ts

v0.2.0

Published

A fully typed TypeScript client for the Audible API — authentication, library, wishlist, and catalog search

Readme

audible-api-ts

CI npm License: MIT TypeScript

A fully typed TypeScript client for the Audible API.

Authentication, library, wishlist, catalog search — all with complete type safety. The first maintained TypeScript alternative to mkb79/Audible (Python).

Documentation

Features

  • Complete PKCE authentication — Same OAuth flow as the official Audible iOS app
  • Signed API requests — RSA SHA256 request signing with device private key
  • Library & wishlist — Fetch all audiobooks with automatic pagination
  • Catalog search — Browse by category, sort by bestsellers or rating
  • Full data — Ratings (overall/performance/story), categories, listening progress, series, cover images, and more
  • 10 locales — US, UK, France, Germany, Italy, Spain, Canada, Australia, India, Japan
  • Fully typed — Every function, response, and credential has TypeScript types

Install

bun add audible-api-ts
# or
npm install audible-api-ts

Requires Node.js 18+ (for native fetch and crypto).

Quick Start

import { login, register, library } from 'audible-api-ts'

// 1. Authenticate
const { loginUrl, session, cookies } = await login('com')
// → Redirect user to loginUrl (set cookies first)
const credentials = await register(authorizationCode, session)

// 2. Fetch library
const { items } = await library(credentials)

items.map((book) => {
  console.log(`${book.title} by ${book.authors.join(', ')}`)
  console.log(`  Rating: ${book.rating?.overallDistribution?.averageRating}/5`)
  console.log(`  Duration: ${Math.floor(book.durationMinutes / 60)}h${book.durationMinutes % 60}m`)
  if (book.series) console.log(`  Series: ${book.series.name} #${book.series.position}`)
  if (book.listeningStatus?.percentComplete) {
    console.log(`  Progress: ${book.listeningStatus.percentComplete}%`)
  }
})

Output:

Primal Hunter by Zogarth
  Rating: 4.8/5
  Duration: 29h30m
  Series: Primal Hunter #4
  Progress: 5%
Dune by Frank Herbert
  Rating: 4.7/5
  Duration: 18h0m

Catalog Search

Use genre names instead of opaque category IDs — the library resolves them per locale:

import { catalog } from 'audible-api-ts'

// Top Science Fiction by relevance (default sort)
const { items } = await catalog(credentials, {
  category: 'science-fiction',     // resolved per locale, no ID needed
  limit: 10,
})

// Or sort by release date, bestsellers, etc.
const { items: latest } = await catalog(credentials, {
  category: 'science-fiction',
  sortBy: 'ReleaseDate',
})

// ⚠️ MostVoted fetches ALL pages (up to 1000 items) then sorts client-side.
// Can take 10-60 seconds on large categories.
const { items: topVoted } = await catalog(credentials, {
  category: 'science-fiction',
  sortBy: 'MostVoted',
  limit: 10,
})

items.map((book) => {
  const r = book.rating?.overallDistribution
  console.log(`${book.title} — ${r?.numRatings} ratings, ${r?.averageRating?.toFixed(1)}/5`)
})

Output:

L'apprenti assassin — 4453 ratings, 4.8/5
Dune — 2112 ratings, 4.6/5
Projet Dernière chance — 832 ratings, 4.7/5

Available genres: 'science-fiction', 'fantasy', 'thriller', 'romance', 'horror', 'mystery', 'biography', 'history', 'business', 'comedy', and more. Sub-genres use slash notation: 'science-fiction/space-opera', 'fantasy/epic', 'thriller/psychological', 'romance/historical', etc.

API

| Function | Description | |----------|-------------| | login(locale) | Generate PKCE login URL + session + cookies | | register(code, session) | Exchange auth code for credentials | | refresh(credentials) | Manually refresh an access token (usually not needed — auto-refresh is built-in) | | library(credentials) | Fetch all library audiobooks | | wishlist(credentials) | Fetch all wishlist audiobooks | | catalog(credentials, options) | Search catalog by category with sorting | | verify(credentials) | Check if credentials are valid |

See the full documentation for guides and API reference.

License

MIT