Metadata-Version: 2.4
Name: langchain-wellmarked
Version: 0.1.0
Summary: Official LangChain integration for the WellMarked API — load any URL as clean Markdown.
Project-URL: Homepage, https://wellmarked.io
Project-URL: Documentation, https://wellmarked.io/docs
Project-URL: Source, https://github.com/WellMarkedAPI/langchain-wellmarked
Project-URL: Issues, https://github.com/WellMarkedAPI/langchain-wellmarked/issues
Author-email: WellMarked <support@wellmarked.io>
License: MIT
License-File: LICENSE
Keywords: document-loader,langchain,llm,markdown,rag,scraping,wellmarked
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.9
Requires-Dist: langchain-core<2.0,>=0.3
Requires-Dist: wellmarked<2.0,>=1.1
Provides-Extra: dev
Requires-Dist: pytest>=7; extra == 'dev'
Requires-Dist: ruff>=0.6; extra == 'dev'
Description-Content-Type: text/markdown

# langchain-wellmarked

The official [LangChain](https://www.langchain.com/) integration for **[WellMarked](https://wellmarked.io)** — load any URL as clean Markdown `Document`s.

```bash
pip install langchain-wellmarked
```

## Quick start

Set your API key (get one at [wellmarked.io](https://wellmarked.io)):

```bash
export WELLMARKED_API_KEY="wm_..."
```

Load a single page:

```python
from langchain_wellmarked import WellMarkedLoader

loader = WellMarkedLoader("https://example.com/article")
docs = loader.load()

docs[0].page_content   # clean Markdown
docs[0].metadata       # {"source": ..., "title": ..., "author": ..., "retrieved_at": ...}
```

Or crawl a whole site BFS-style — one `Document` per successfully extracted page (Pro plan and above):

```python
loader = WellMarkedLoader("https://docs.example.com", mode="crawl", depth=2)
docs = loader.load()

docs[0].metadata["depth"]   # how far from the root URL this page sits
```

`lazy_load()` works too, and the loader passes `render_js=True` through to the API for JS-heavy pages.

## Options

| Parameter     | Default     | Description                                                        |
|---------------|-------------|--------------------------------------------------------------------|
| `url`         | (required)  | Page to extract, or root URL to crawl from                          |
| `api_key`     | env var     | WellMarked API key; falls back to `WELLMARKED_API_KEY`              |
| `mode`        | `"extract"` | `"extract"` (single page) or `"crawl"` (same-site BFS)              |
| `depth`       | `1`         | Crawl depth (`mode="crawl"` only)                                   |
| `render_js`   | `False`     | Render JS-heavy pages with a headless browser (Pro and above)       |
| `job_timeout` | `300.0`     | Seconds to wait for a crawl job; `None` waits forever               |

In `crawl` mode, pages that fail to extract (timeouts, robots-disallowed, no content) are skipped; only successful pages become `Document`s.

## Related

- [`wellmarked`](https://pypi.org/project/wellmarked/) — the underlying Python SDK (this package wraps it)
- [WellMarked API docs](https://wellmarked.io/docs)
- [`llama-index-readers-wellmarked`](https://github.com/WellMarkedAPI/llama-index-readers-wellmarked) — the LlamaIndex equivalent
