Skip to content

lucaengelhard/ao3-toolkit

Repository files navigation

ao3-toolkit

A Toolkit for interfacing with the Archive of Our Own

Installation

ao3-toolkit runs on Node.js and is available as a NPM package.

npm install ao3-toolkit

Usage

Important

In a blog post the admins talk about how they handle data scraping: "We've put in place certain technical measures to hinder large-scale data scraping on AO3, such as rate limiting, and we're constantly monitoring our traffic for signs of abusive data collection. We do not make exceptions for researchers or those wishing to create datasets. However, we don't have a policy against responsible data collection — such as those done by academic researchers, fans backing up works to Wayback Machine or Google's search indexing. Putting systems in place that attempt to block all scraping would be difficult or impossible without also blocking legitimate uses of the site."

Logging in to ao3

import { LoginSession } from "ao3-toolkit";

const session = await new LoginSession({
  username: string,
  password: string,
}).login();

Fetching single works

import { getWorkInfo } from "ao3-toolkit";

const work = await getWorkInfo(id: number)

Fetching work content

import { getWorkContent } from "ao3-toolkit";

const work = await getWorkContent(id: number)

Fetching work stats

import { getWorkStats } from "ao3-toolkit";

const work = await getWorkStats(id: number)

Fetching user history

import { LoginSession, getWorkList } from "ao3-toolkit";

const session = await new LoginSession({
  username: string,
  password: string,
}).login();

const history = await getWorkList(
  logindata,
  session.instance,
  Listtype.History
);

Fetching user bookmarks

import { LoginSession, getWorkList } from "ao3-toolkit";

const session = await new LoginSession({
  username: string,
  password: string,
}).login();

const history = await getWorkList(
  logindata,
  session.instance,
  Listtype.Bookmark
);

Roadmap

  • Fetching work comments
  • Fetching user stats
    • favourite tags
    • favourite fandoms
  • Fetching user stats
    • words read
    • fics read

Documentation

Documentation is generated with TypeDoc

Contributing

This project is written by a lone developer who learns as they go. Contributions are welcome and appreciated. So clone the repository, make a Pull request and add a Changeset. If you have any feedback, please open an Issue or reach out to me at [email protected].

Inspiration and similar Projects:

https://github.com/cyrusae/AO3.js
https://github.com/misaalanshori/ao3webapi
https://github.com/timing1337/ao3_ts
https://github.com/ReyhanArdiya/stories-scrapper
https://github.com/dr-off/ao3-api
https://github.com/Dramatycznie/AO3_Scraper
https://github.com/rsanjabi/narratives
https://github.com/syrtis-m/ao3-bookmark-getter
https://github.com/niacdoial/AO3-stylish-downloader
https://github.com/gmastergreatee/Fanfiction-Manager

License

MIT