# langchain-stripe-loader

> LangChain loader for Stripe data

Latest version **0.2.0** (published 2026-11-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install langchain-stripe-loader
pnpm add langchain-stripe-loader
yarn add langchain-stripe-loader
bun add langchain-stripe-loader
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2026-11-28 |
| First published | 2025-03-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=20 |
| Dependencies | 3 |
| Unpacked size | 125.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | hideokamoto |
| Maintainers | hideokamoto |
| Keywords | stripe, documentation, loader, langchain, llm, ai, document-loader |

## Links

- npm: https://www.npmjs.com/package/langchain-stripe-loader
- Repository: https://github.com/hideokamoto/stripe-docs-loader
- Homepage: https://github.com/hideokamoto/stripe-docs-loader/tree/main/packages/langchain-stripe-loader#readme
- Issues: https://github.com/hideokamoto/stripe-docs-loader/issues
- npm.io page: https://npm.io/package/langchain-stripe-loader

## Dependencies (3)

- [@langchain/core](https://npm.io/package/@langchain/core.md) ^1.4.0
- [node-html-markdown](https://npm.io/package/node-html-markdown.md) ^1.3.0
- [stripe-loaders-core](https://npm.io/package/stripe-loaders-core.md) ^0.2.0

## Alternatives

- [@expo/fingerprint](https://npm.io/package/@expo/fingerprint.md) — 6.2M weekly downloads
- [@azure/monitor-opentelemetry-exporter](https://npm.io/package/@azure/monitor-opentelemetry-exporter.md) — 850.0K weekly downloads
- [@azure/monitor-opentelemetry](https://npm.io/package/@azure/monitor-opentelemetry.md) — 624.0K weekly downloads
- [@posthog/ai](https://npm.io/package/@posthog/ai.md) — 423.3K weekly downloads
- [fakefilter](https://npm.io/package/fakefilter.md) — 63.9K weekly downloads

## Recent versions

- 0.2.0 (latest) — 2026-11-28
- 0.1.0 — 2025-03-11
- 0.0.0 — 2025-03-11

## README

# LangChain Stripe Loader

A LangChain document loader for Stripe documentation and website content. This package provides tools to extract and process content from Stripe's documentation and website for use with LangChain applications.

## Installation

```bash
npm install langchain-stripe-loader
```

## Features

- Extract content from Stripe's official documentation (docs.stripe.com)
- Extract content from Stripe's main website (stripe.com)
- Support for different locales
- Convert HTML content to Markdown for better compatibility with LLMs
- Metadata extraction (title, description, source URL)

## Usage

### Loading Content from Stripe Documentation

```typescript
import { StripeDocsDocumentLoader } from 'langchain-stripe-loader';

// Create a loader instance
const loader = new StripeDocsDocumentLoader();

// Load documents with default locale (en-US)
const documents = await loader.load();

// Or specify a different locale
const jaDocuments = await loader.load({
  locale: 'ja-JP',
});

// Load documents with specific options
const customDocuments = await loader.load({
  resource: 'connect', // Filter by resource path
  excludeResources: ['connect/account-balances'],
});

// Fetch the Markdown version that docs.stripe.com serves at `<page>.md`
// (no HTML extraction; titles come without the " | Stripe Documentation" suffix)
const markdownDocuments = await loader.load({
  locale: 'ja-JP',
  resource: 'payments',
  format: 'markdown',
});

// Use the documents with your LangChain application
console.log(`Loaded ${documents.length} documents`);
```

### Options: rate limiting, logging, and format

Requests are sent one at a time with a delay between them, and HTTP 429 / 5xx responses are
retried with exponential backoff (honouring `Retry-After`). A full sitemap contains thousands of
pages, so narrow it down with `resource` or `urls` where you can.

```typescript
const loader = new StripeDocsDocumentLoader({
  format: 'markdown', // default format for load(); 'html' when omitted
  debug: true, // print log / warn messages with the default console logger
  logger: myLogger, // any object with log / warn / error; defaults to console
  rateLimit: {
    requestDelayMs: 1000, // delay between requests (default 1000)
    requestJitterMs: 500, // random variation, ±half of this value (default 500)
    maxRetries: 3, // retries for 429 / 5xx and network errors (default 3)
    backoffBaseMs: 1000, // exponential backoff base (default 1000)
    backoffMaxMs: 30000, // upper bound for a single wait (default 30000)
  },
});
```

`new StripeDocsDocumentLoader(true)` (debug only) is still supported.

### Loading Content from Stripe.com Website

```typescript
import { StripeComDocumentLoader } from 'langchain-stripe-loader';

// Create a loader instance
const loader = new StripeComDocumentLoader();

// Load all documents
const documents = await loader.load();

// Load documents with specific options
const customDocuments = await loader.load({
  resource: '/jobs', // Filter by resource path
  locale: 'en-US', // Specify locale
});

// Load specific URLs
const specificDocuments = await loader.load({
  urls: ['https://stripe.com/docs/payments', 'https://stripe.com/docs/billing'],
});
```

## API Reference

### StripeDocsDocumentLoader

Document loader for Stripe's official documentation (docs.stripe.com).

**Constructor**

```typescript
constructor(options?: boolean | StripeDocsLoaderOptions)
```

- `options.format`: `'html'` (default) or `'markdown'`
- `options.debug`, `options.logger`, `options.rateLimit`, `options.fetch`, `options.sleep`: see "Options" above
- Passing a boolean sets `debug` (legacy signature)

**Methods**

- `load(options?: { locale?: string; urls?: string[]; resource?: string; excludeResources?: string[]; format?: 'html' | 'markdown' }): Promise<Document[]>` - Load documents from Stripe Docs. `locale` defaults to `en-US`

### StripeComDocumentLoader

Document loader for Stripe's main website (stripe.com).

**Constructor**

```typescript
constructor(options?: boolean | StripeLoaderOptions)
```

- `options.debug`, `options.logger`, `options.rateLimit`, `options.fetch`, `options.sleep`: see "Options" above
- Passing a boolean sets `debug` (legacy signature)

**Methods**

- `load(options?: { resource?: string; locale?: string; urls?: string[] }): Promise<Document[]>` - Load documents from Stripe.com with optional filtering. Pages that return HTTP 400 or higher are skipped

## How It Works

1. The loaders fetch URLs from Stripe's sitemaps
2. Each page is downloaded one at a time, with a delay between requests and retries on 429 / 5xx
3. With `format: 'html'`, relevant content is extracted using regex patterns and converted to Markdown using node-html-markdown
4. With `format: 'markdown'` (docs.stripe.com only), the `<page>.md` Markdown is used as-is
5. Content is wrapped in LangChain Document objects with metadata

## Dependencies

- `@langchain/core`: LangChain core functionality
- `stripe-loaders-core`: Core utilities for Stripe loaders
- `turndown`: HTML to Markdown conversion

## License

MIT

---
_Source: https://npm.io/package/langchain-stripe-loader · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
