Metadata-Version: 2.4
Name: langchain-synoppy
Version: 1.0.0
Summary: LangChain tools for the Synoppy web-data API — read, search, crawl, map, extract, classify, enrich, images, and screenshot the live web from your agent.
Project-URL: Homepage, https://synoppy.com
Project-URL: Documentation, https://synoppy.com/docs
Project-URL: Repository, https://github.com/Synoppy/synoppy-langchain-python
Author-email: Saanora <support@synoppy.com>
License: MIT
License-File: LICENSE
Keywords: agents,langchain,llm,markdown,rag,synoppy,tools,web-scraping,web-search
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.9
Requires-Dist: langchain-core>=0.3
Requires-Dist: pydantic>=2
Requires-Dist: synoppy>=1.1.1
Description-Content-Type: text/markdown

# langchain-synoppy

[![PyPI](https://img.shields.io/pypi/v/langchain-synoppy.svg)](https://pypi.org/project/langchain-synoppy/) [![license](https://img.shields.io/pypi/l/langchain-synoppy.svg)](./LICENSE)

**Give your LangChain agent the whole web.** [Synoppy](https://synoppy.com) tools for [LangChain](https://python.langchain.com) — read, search, crawl, map, extract, classify, enrich, screenshot, and pull images from the live web, all on one key.

[**Get a free key →**](https://synoppy.com/dashboard) · [Docs](https://synoppy.com/docs) · [synoppy.com](https://synoppy.com)

## Install

```bash
pip install langchain-synoppy
```

## Quickstart

```python
from langchain_openai import ChatOpenAI
from langchain_synoppy import get_synoppy_tools

tools = get_synoppy_tools(api_key="syn_live_...")

# Bind them to any tool-calling model…
model = ChatOpenAI(model="gpt-4o").bind_tools(tools)

# …or drop them into an agent (e.g. LangGraph's create_react_agent):
# from langgraph.prebuilt import create_react_agent
# agent = create_react_agent(model, tools)
```

`get_synoppy_tools()` returns a list of `StructuredTool`s. Want a subset? Filter by name:

```python
tools = [t for t in get_synoppy_tools(api_key="...") if t.name in {"synoppy_read", "synoppy_search"}]
```

## Tools

| Tool | Endpoint | What it does |
| --- | --- | --- |
| `synoppy_read` | `/api/scrape` | URL → clean markdown (nav/ads stripped) |
| `synoppy_search` | `/api/search` | Ranked live-web results, optionally read to markdown |
| `synoppy_crawl` | `/api/crawl` | Crawl a site → markdown per page (RAG ingest) |
| `synoppy_map` | `/api/map` | Every URL on a domain |
| `synoppy_extract` | `/api/extract` | Page → structured JSON from a prompt |
| `synoppy_classify` | `/api/classify` | NAICS/SIC industry codes, or custom labels |
| `synoppy_enrich` | `/api/brand` | Domain / email → brand profile (logo, colors, fonts, socials) |
| `synoppy_images` | `/api/images` | Every image on a page + alt text |
| `synoppy_screenshot` | `/api/screenshot` | URL → PNG (base64 data URL) for vision models |

Each tool returns a compact JSON string plus `creditsUsed`, and hands back `{"error", "code"}` on failure so the model can recover.

For typed extraction (a JSON Schema), custom timeouts, or raw responses, use the [`synoppy`](https://pypi.org/project/synoppy/) client directly.

MIT licensed · built by [Saanora](https://synoppy.com)
