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

instapaper-ts

v2.0.0

Published

A type-safe API client for Instapaper.

Readme

instapaper

A TypeScript client for the Instapaper API.

Installation

npm install instapaper-ts

Authentication

Instapaper uses OAuth 1.0a with xAuth. You'll need a consumer key and secret from Instapaper, plus your account username and password, but only to perform a one-time token exchange. After that, store the token and use it directly for all future requests.

1. Exchange credentials for a token

Call Instapaper.fetchToken(...) to authenticate with your username and password. This performs the xAuth token exchange and returns the result. Once you have the token, persist it so you don't repeat the exchange on every run.

import { Instapaper } from "instapaper";

const token = await Instapaper.fetchToken({
	consumerKey: "your_consumer_key",
	consumerSecret: "your_consumer_secret",
	username: "[email protected]",
	password: "your_password",
});

// Persist the token for future use
await saveToken(token); // e.g. write to disk, a secrets store, a session cookie etc.

2. Initialise from a cached token

Once you have a token, you can then use it to instantiate the Instapaper client. This allows you to reuse your token in different parts of your app, without having to reauthenticate every time with your username and password.

const token = await loadToken();

const client = new Instapaper({
	consumerKey: "your_consumer_key",
	consumerSecret: "your_consumer_secret",
	token,
});

Methods

See the full API documentation for complete parameter and response details.

Account

| Method | Description | | --------------------- | --------------------------------------------- | | verifyCredentials() | Verify the current token and return user info |

Bookmarks

All bookmark methods are available under instapaper.bookmarks.*.

| Method | Description | | ------------------------------ | --------------------------------------------------------------- | | list(params?) | List bookmarks; optionally filter by folder_id, limit, etc. | | add(params) | Save a URL as a new bookmark | | delete(bookmark_id) | Permanently delete a bookmark | | updateReadProgress(params) | Update the read progress percentage for a bookmark | | star(bookmark_id) | Star a bookmark | | unstar(bookmark_id) | Unstar a bookmark | | archive(bookmark_id) | Move a bookmark to the archive | | unarchive(bookmark_id) | Move a bookmark out of the archive | | move(bookmark_id, folder_id) | Move a bookmark to a specific folder | | getText(bookmark_id) | Fetch the processed text content of a bookmark |

Folders

All folder methods are available under instapaper.folders.*.

| Method | Description | | ------------------- | ----------------------------------- | | list() | List all user-created folders | | add(title) | Create a new folder | | delete(folder_id) | Delete a folder | | setOrder(order) | Update the display order of folders |

Highlights

All highlight methods are available under instapaper.highlights.*.

| Method | Description | | ---------------------- | ---------------------------------- | | list(bookmark_id) | List all highlights for a bookmark | | add(params) | Add a highlight to a bookmark | | delete(highlight_id) | Delete a highlight |


Terms of Use

Please review Instapaper's API Terms of Use before using this library.