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

ao3-api-nodejs

v0.0.4

Published

An unofficial AO3 API client for Node.js, written in TypeScript.

Readme

AO3 API for Node.js

What is this?

This is an unofficial API client for accessing data from Archive of Our Own (AO3). Written in TypeScript and designed for Node.js.

Inspired by ao3_api.

Table of Contents

Installation

npm i ao3-api-nodejs

Quick Start

Here is how to quickly fetch the details of a a work:

import { getWork } from 'ao3-api';

// Use an async IIFE (Immediately Invoked Function Expression) to use await
(async () => {
  try {
    const workId = '35961484';
    const work = await getWork(workId);
    
    console.log(`Title: ${work.title}`);
    console.log(`Author: ${work.author}`);
    console.log(`Words: ${work.stats.words}`);
  } catch (error) {
    console.error(error);
  }
})();

A Note on AO3's Terms of Service

This is an unofficial API and is not affiliated with the Organization for Transformative Works. Please respect the AO3's Terms of Service. To avoid being IP-banned, please do not make an excessive number of requests. It is recommended to introduce a delay between requests.

API Reference

Works


getWork

Get the full meta data for a single work.

Signature: getWork(workId: string, options?: { proxyUrl?: string }): Promise<Work>

Example:

import { getWork } from 'ao3-api-nodejs'
const work = await getWork(workId)
console.log(work.tags.rating); // 'Teen And Up Audiences'

getChapters

Get the list of chapters info for a work. If the work has only one chapter, it returns a single row representing the work itself.

Signature: getChapters(workId: string, options?: { proxyUrl?: string }): Promise<Chapter[]>

Example:

import { getChapters } from 'ao3-api-nodejs'
const chaptersList = await getChapters(workId)
console.log(chaptersList[0]) // { id: '89650822', title: 'Chapter 1' }

getChapterContent

Get the meta data and content for a single chapter.

Signature: getChapterContent(workId: string, chapterId: string, options?: { proxyUrl?: string }): Promise<ChapterContent>

Example:

import { getChapterContent } from 'ao3-api-nodejs'
const content = await getChapterContent(workId, chapterId)
console.log(content.notes) // '<p>Probably not the sequel you were expecting, sorry :)</p>'

Search


search

Accept the same query parameters as the AO3 website.

Signature: search(options: SearchOptions, requestOptions?: { proxyUrl?: string }): Promise<SearchResults>

Example:

import { search } from 'ao3-api';

const results = await search({
  query: 'coffee shop au',
  fandoms: ['Arcane: League of Legends (Cartoon 2021)'],
  ratings: ['Teen And Up Audiences'],
  complete: true,
  sortColumn: 'kudos_count'
});

console.log(`First result: ${results.works[0].title} by ${results.works[0].author}`); // Piltover's Finest (cup of coffee) by SunsetSharkbite

getWorksByTag

Get a paginated list of works for a specific tag.

Signature: getTagWorks(tag: string, page: number = 1, options?: SearchOptions, requestOptions?: { proxyUrl?: string }): Promise<SearchResults>

Example:

import { getTagWorks } from 'ao3-api';

const results = await getTagWorks('CaitlynTop', 1);
console.log(`Found ${results.totalResults} works with this tag.`);

Series


getSeries

Get details for a series, including the description, stats, and a list of containing works.

Signature: getSeries(seriesId: string, requestOptions?: { proxyUrl?: string }): Promise<Series>

Example:

import { getSeries } from 'ao3-api';

const series = await getSeries('2662264');
console.log(series.title); // 'Roommates AU'
console.log(`This series has ${series.stats.works} works.`); // This series has 3 works.

User


getUserProfile

Get the public profile info of a specific user.

Signature: getUserProfile(username: string, requestOptions?: { proxyUrl?: string }): Promise<UserProfile>

Example:

import { getUserProfile } from 'ao3-api';

const profile = await getUserProfile('TheHomelyBadger');
console.log(`${profile.username} joined on ${profile.joined}.`); // 2016-09-16

getUserWorks

Get a paginated list of works published by a user.

Signature: getUserWorks(username: string, page: number = 1, requestOptions?: { proxyUrl?: string }): Promise<SearchResults>

Example:

import { getUserWorks } from 'ao3-api';

const results = await getUserWorks('TheHomelyBadger');
console.log(`Found ${results.totalResults} works by TheHomelyBadger.`); // Found 49 works by TheHomelyBadger.

License

MIT