-
Notifications
You must be signed in to change notification settings - Fork 0
API Reference
The ShelfWise backend exposes a FastAPI REST API. All endpoints are served from the root path by default (http://localhost:8000).
-
application/jsonfor most requests and responses -
multipart/form-datafor CSV uploads -
text/event-streamfor job progress streams
Returns app info, version, and a list of available endpoints.
Serves the frontend single-page application.
Health check with feature flags, scraper counts, and cache stats.
{
"status": "ok",
"version": "1.0.0",
"scrapers": 10,
"registry_sources": 271,
"cache_size": 42
}Loads 3 demo products without scraping.
Submit a list of UPCs for processing.
Request body:
{
"upcs": ["049000050088", "038000183005"],
"auto_scrape": true
}Response:
{
"job_id": "abc123",
"total": 2,
"queued": 2,
"running": 0,
"completed": 0,
"failed": 0
}Upload a CSV file with a required upc column.
Form field: file
Response: job status object.
Get current job status.
Server-Sent Events stream of live job updates. Connect from the browser or any SSE client.
List enriched products.
Upload a product image. Saved to backend/uploads/ and attached to the product record.
Form field: file (image: jpg, png, webp, gif)
Response:
{
"upc": "123456789012",
"image_url": "/uploads/123456789012_abc123.jpg",
"images": [...]
}Remove an image from a product record and delete the uploaded file if it is local.
Query parameter: url — the image URL to remove
Query parameters:
| Parameter | Type | Description |
|---|---|---|
q |
string | Full-text search by name or UPC |
brand |
string | Filter by brand |
category |
string | Filter by category |
status |
string | Filter by status (complete, partial, error) |
min_confidence |
float | Minimum confidence score (0–1) |
limit |
int | Page size |
offset |
int | Pagination offset |
Get a single consolidated product.
Compare the consolidated record with raw source notes.
The pipeline automatically uses name-based image search as a fallback when no verified images are found for a UPC (especially useful for local PLUs). The backend/image_search.py module tries, in order:
- Brave Images API (requires
BRAVE_API_KEY) - Google Custom Search (requires
GOOGLE_API_KEY+GOOGLE_CX) - DuckDuckGo Images (no API key)
- Bing Images (no API key)
Full-text search across product names and UPCs.
Portfolio analytics: total products, confidence distribution, status breakdown, top brands/categories.
Performance metrics for scrapers and reasoning engine.
Export the current portfolio, optionally filtered.
Request body:
{
"format": "csv",
"status": "complete",
"min_confidence": 0.7,
"q": "coca",
"preview": false,
"preview_limit": 5
}Supported formats: csv, json, shopify, amazon, woocommerce, ebay, etsy, bigcommerce, doordash, ubereats, grubhub.
Filters:
| Field | Description |
|---|---|
status |
Only export products with this status (complete, partial, error) |
min_confidence |
Only export products with confidence >= this value |
q |
Search query matched against name, brand, category, UPC |
preview |
If true, return a JSON preview instead of a file |
preview_limit |
Number of products to include in preview (default 5, max 50) |
Response: downloadable file, or JSON preview when preview: true.
Foundry IQ service health.
Natural-language knowledge query.
Reason about a specific UPC.
Export product ontology.
Semantic search over the knowledge graph.
Get related graph nodes.
Query history.
Force re-ingestion of the product catalog into the knowledge graph.
Clear all products and jobs.
{
"upc": "049000050088",
"name": "Coca-Cola Classic 12 Pack",
"brand": "Coca-Cola",
"category": "Beverages",
"description": "12-pack of 12 fl oz cans...",
"image_url": "https://example.com/image.jpg",
"images": [...],
"attributes": {"size": "12 fl oz", "pack": "12"},
"confidence": 0.92,
"status": "complete",
"citations": [...],
"reasoning_trace": [...],
"foundry_enriched": false,
"foundry_sdk": null
}{
"job_id": "abc123",
"total": 10,
"queued": 0,
"running": 2,
"completed": 7,
"failed": 1,
"created_at": "2026-06-14T17:00:00Z",
"updated_at": "2026-06-14T17:05:00Z"
}FastAPI serves an interactive OpenAPI UI at:
- Swagger UI: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc
Use the OpenAPI schema to generate clients in TypeScript, Python, Go, etc.
ShelfWise — AI Product Portfolio Builder · GitHub · MIT License
- Home
- Getting Started
- Use Cases
- Roadmap
- Architecture
- API Reference
- Configuration
- Backend Guide
- Frontend Guide
- Scraping & Reasoning
- Testing
- Deployment
- Changelog
Quick Start
docker-compose up --build
# open http://localhost:8000/app