ShopGraph
显示其工作的提取API。发送URL或原始HTML,获得带有per-field置信度评分和提取出处的结构化JSON-每个字段都显示产生它的方法(Schema.org、LLM推理或无头浏览器)以及系统的置信度。设置 strict_confidence_threshold 不确定的字段在到达代理之前会在服务器端被删除。每月50次免费通话。
网站: https://shopgraph.dev | API https://shopgraph.dev/api/enrich/basic | MCP: https://shopgraph.dev/mcp
UCP输出已通过验证 ucp-schema v1.1.0版本 --官方通用商务协议模式验证器。
快速开始
# Free — no API key, no signup
curl -X POST https://shopgraph.dev/api/enrich/basic \
-H "Content-Type: application/json" \
-d '{"url": "https://www.allbirds.com/products/mens-tree-runners"}'返回具有每个字段置信度分数的结构化JSON:
{
"product": {
"product_name": "Men's Tree Runners",
"brand": "Allbirds",
"price": { "amount": 100, "currency": "USD" },
"availability": "in_stock",
"categories": ["Shoes", "Running"],
"confidence": { "overall": 0.95 },
"_shopgraph": {
"field_confidence": {
"product_name": 0.97,
"brand": 0.95,
"price": 0.98,
"availability": 0.90
}
}
},
"free_tier": { "used": 1, "limit": 50 }
}工具/端点
| 工具 | REST端点 | 价格 | 它的作用 |
|---|---|---|---|
enrich_basic | POST /api/enrich/basic | 免费(共享配额) | 仅用于Schema.org提取。快速、零LLM成本。 |
enrich_product | POST /api/enrich | 每月免费50美元,然后订阅或每调用0.02美元 | 完整管道,每个字段的置信度评分和提取来源。 |
enrich_html | POST /api/enrich/html | 订阅或$0.02/call | 自带HTML。适用于Bright Data、Firecrawl或任何获取/代理工具。 |
定价: 免费(每月50次)|起步价每月99美元(1万次通话)|增长价每月299美元(5万个通话)|企业(定制)。代理人仍可通过Stripe MPP按通话付费。缓存结果(24小时)是免费的。提取失败不收费。
运作原理
Your agent sends a URL (or raw HTML)
→ Tier 1: Schema.org/JSON-LD parsing (0.93 baseline confidence, instant)
→ Tier 2: LLM extracts from page text when structured data is absent (0.70 baseline)
→ Tier 3: Headless Playwright renders JavaScript, then extracts (additional inference step)
→ Returns ProductData with per-field confidence scores and extraction provenance
(which tier produced each field) in _shopgraph.field_confidence
→ Set strict_confidence_threshold to remove low-confidence fields server-side
before they reach your agent
→ Add format=ucp for Universal Commerce Protocol output身份验证: API密钥(sg_live_ 密钥)用于订阅层或Stripe MPP用于按呼叫付费代理。
ShopGraph是一个 结构化层,不是一个搬运工。它与Bright Data、Firecrawl和其他获取/代理工具相辅相成。他们负责检索。ShopGraph处理提取来源和每个字段的置信度评分。
REST API
POST /api/enrich/basic (免费套餐)
curl -X POST https://shopgraph.dev/api/enrich/basic \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com/product"}'仅限Schema.org。与共享免费等级配额 /api/enrich。无需注册。
POST /api/enrich (完全提取)
# With API key (subscription)
curl -X POST https://shopgraph.dev/api/enrich \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sg_live_..." \
-d '{"url": "https://example.com/product", "strict_confidence_threshold": 0.8, "format": "ucp"}'
# With Stripe MPP (pay-per-call)
curl -X POST https://shopgraph.dev/api/enrich \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com/product", "payment_method_id": "pm_..."}'完整管道:Schema.org→ 大语言模型推理→ 无头浏览器。每月50次免费通话。使用API密钥进行身份验证(sg_live_)或条纹MPP以获得更高的限制。
POST /api/enrich/html (带上自己的HTML)
curl -X POST https://shopgraph.dev/api/enrich/html \
-H "Content-Type: application/json" \
-d '{"html": "...", "url": "https://example.com/product", "payment_method_id": "pm_..."}'已经获取页面了吗?将HTML传输到ShopGraph进行结构化。
MCP配置
{
"mcpServers": {
"shopgraph": {
"type": "url",
"url": "https://shopgraph.dev/mcp"
}
}
}适用于Claude、Claude Code、Cursor、Windsurf、CrewAI、LangGraph、AutoGen和任何MCP客户端。
提取的数据
每个回复都包括:
| 字段 | 描述 |
|---|---|
product_name | 产品名称 |
brand | 制造商或品牌 |
price | 金额+币种+售价 |
availability | in_stock, out_of_stock, preorder, unknown |
categories | 产品分类 |
image_urls | 产品图片(仅限rich_Product/rerich_html) |
color | 可用颜色 |
material | 材料/织物 |
dimensions | 尺寸/重量信息 |
confidence | 总体得分+每个领域得分(0-1) |
_shopgraph.field_confidence | 带字段类型修饰符的每个字段置信度 |
自托管设置
git clone https://github.com/laundromatic/shopgraph.git
cd shopgraph
npm install必需 .env:
| 变量 | 目的 |
|---|---|
STRIPE_TEST_SECRET_KEY | 条纹密钥(测试或实时) |
GOOGLE_API_KEY | 用于二级(LLM)推理的Gemini API密钥 |
UPSTASH_REDIS_REST_URL | 用于统计/监控的Uptash Redis(可选) |
UPSTASH_REDIS_REST_TOKEN | Uptash Redis令牌(可选) |
npm run build # Compile TypeScript
npm start # Run MCP server (stdio)
npm run start:http # Run HTTP server
npm run dev # Dev mode (no build needed)
npm run test:run # Run 118 tests监控
ShopGraph在22个产品垂直领域运行了118个自动化测试。具有断路器、URL验证和健康警报的自愈管道。
- 健康: https://shopgraph.dev/health
- 统计数据: https://shopgraph.dev/api/stats
- 仪表板: 在shopgraph.dev主页上直播
许可证
Apache 2.0
建造于
克里希纳·布朗 |加利福尼亚州洛杉矶
