@synoppy/langchain
v1.0.0
Published
LangChain.js tools for Synoppy — give your agent the whole web: read, search, crawl, map, extract, classify, enrich, images, and screenshot on one key.
Maintainers
Readme
@synoppy/langchain
Give your LangChain.js agent the whole web. Synoppy tools for LangChain.js — read, search, crawl, map, extract, classify, enrich, screenshot, and pull images from the live web, all on one key.
Get a free key → · Docs · synoppy.com
Install
npm install @synoppy/langchain @langchain/core zod@langchain/core (v0.3+) and zod are peer dependencies.
Quickstart
import { ChatOpenAI } from "@langchain/openai";
import { synoppyTools } from "@synoppy/langchain";
const tools = synoppyTools({ apiKey: process.env.SYNOPPY_API_KEY! });
// Bind them to any tool-calling model…
const model = new ChatOpenAI({ model: "gpt-4o" }).bindTools(tools);
// …or drop them into an agent (e.g. LangGraph's createReactAgent):
// const agent = createReactAgent({ llm, tools });synoppyTools() returns an array of StructuredTools. Want a subset? Filter by name:
const tools = synoppyTools({ apiKey }).filter((t) =>
["synoppy_read", "synoppy_search"].includes(t.name),
);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. Failures come back as { "error", "code" } so the model can read them and recover.
Configuration
synoppyTools(options) takes the same options as the @synoppy/sdk client:
synoppyTools({
apiKey: process.env.SYNOPPY_API_KEY!, // required
baseUrl: "https://synoppy.com", // optional override
});For typed extraction (a JSON Schema), custom timeouts, or raw responses, use @synoppy/sdk directly — it's re-exported here as Synoppy.
MIT licensed · built by Saanora
