REST API

Complete endpoint reference for the ShopGraph extraction API.

Base URL: https://shopgraph.dev

Authentication

Three authentication methods are supported:

MethodHeaderNotes
API KeyAuthorization: Bearer sg_live_...For Starter, Growth, and Enterprise tiers
Stripe MPPX-Payment-Method: pm_...Machine-to-machine payments for agents
Free tierNone500 calls/month, no signup needed

Rate Limits

TierMonthly LimitRate
Free50010/min
Starter ($99)10,00060/min
Growth ($299)50,000200/min
EnterpriseCustomCustom

Rate limit headers are included in every response: X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset.

Endpoints

POST /api/enrich/basic

Free-tier extraction using Schema.org structured data only. No authentication required.

Request

curl
$ curl -X POST https://shopgraph.dev/api/enrich/basic \
  -H "Content-Type: application/json" \
  -d '{"url": "https://www.allbirds.com/products/mens-tree-runners"}'

Request Body

FieldTypeRequiredDescription
urlstringYesProduct page URL

Response

200 OK
{
  "product": {
    "title": "Men's Tree Runners",
    "price": 98,
    "currency": "USD",
    "brand": "Allbirds",
    "availability": "InStock",
    "image": "https://cdn.allbirds.com/image/...",
    "description": "Lightweight, breathable sneakers..."
  },
  "_shopgraph": {
    "extraction_method": "schema_org",
    "confidence_score": 0.93,
    "field_confidence": { "title": 0.98, "price": 0.97 }
  },
  "cached": false,
  "free_tier": { "used": 12, "limit": 500 }
}

POST /api/enrich

Full extraction with LLM, hybrid merge, and Playwright fallback. Requires authentication.

Request

curl
$ curl -X POST https://shopgraph.dev/api/enrich \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer sg_live_abc123" \
  -d '{
    "url": "https://www.grainger.com/product/DAYTON-1-3-HP-4M206",
    "format": "ucp",
    "strict_confidence_threshold": 0.8,
    "include_score": true
  }'

Request Body

FieldTypeRequiredDescription
urlstringYesProduct page URL
formatstringNostandard (default) or ucp
strict_confidence_thresholdnumberNoFilter fields below this confidence (0-1)
include_scorebooleanNoInclude AgentReady score in response
methodstringNoForce extraction method: schema_org, llm, playwright

POST /api/enrich/html

Extract from provided HTML. Useful when you already have the page content.

Request Body

FieldTypeRequiredDescription
htmlstringYesRaw HTML content
urlstringNoSource URL for context and caching
formatstringNostandard or ucp
strict_confidence_thresholdnumberNoConfidence threshold

POST /api/score

Score existing product data for agent readiness without extracting from a URL.

Request Body

FieldTypeRequiredDescription
productProductDataYesProduct data object to score

Response

Returns an AgentReady Score object.


GET /api/stats

Get extraction statistics and test corpus results. No authentication required.


GET /api/health-check

Health check endpoint. Returns system status and success rates.

Error Responses

StatusMeaning
400Invalid request (missing URL, bad format)
401Authentication required
402Payment required (free tier exhausted, no payment method)
429Rate limited
500Internal server error
504Extraction timeout (page too slow or complex)