API Documentation
This documents the real API that powers this website (FastAPI backend). The same endpoints are used by the tool pages.
http://localhost:8000 (production base URL: https://tools.sehazinfo.shop).General rules
- All responses are JSON. Errors use HTTP status codes with a JSON body, for example
{"detail": "..."}. - At most 500 products per extraction or export. Generated files expire after 1 hour.
- Unsupported marketplaces return
422with{"error": "unsupported_platform", ...}— never invented products. - There is no authentication on these endpoints in Phase 1.
GET /api/health
Check the service is up.
GET /api/health
Response 200:
{"ok": true}
GET /api/platforms
Capability matrix: which platforms are fully supported, partially supported, or unsupported and why.
GET /api/platforms
Response 200:
{"platforms": [{"platform": "shopify", "support": "full",
"product": true, "collection": true, "store": true,
"images": true, "variants": true,
"note": "Public products.json / products/{handle}.js endpoints."},
{"platform": "amazon", "support": "unsupported-auth-required",
"product": false, "collection": false, "store": false,
"images": false, "variants": false,
"reason": "Amazon requires the Product Advertising API ..."}]}
GET /api/tools
The 20 Phase-1 tools.
GET /api/tools
Response 200:
{"tools": [{"slug": "shopify-product-exporter",
"title": "Shopify Product Exporter",
"url": "/shopify-product-exporter",
"category": "Product Exporters"}]}
POST /api/extract
Extract products or images from a URL. mode must be single, collection, store or images. limit defaults to 50, maximum 500.
POST /api/extract
{"url": "https://allbirds.com", "mode": "store", "limit": 2}
Response 200:
{"job_id": "7f3bf889e79241d4", "platform": "shopify", "mode": "store",
"total": 2, "products": [...], "images": [...],
"warnings": [], "partial": false}
Each product has id, handle, title, description, html_description, vendor/brand, type, category, tags, collections, url, currency, price, compare_at_price, variants, images, seo_title, seo_description, source_platform, source_store, extracted_at. Fields that are not publicly available are omitted, never invented. partial: true means only part of the request could be fulfilled — read warnings.
POST /api/export
Turn extracted products into a downloadable file. format must be shopify_csv, woocommerce_csv, universal_csv, xlsx or json.
POST /api/export
{"products": [...], "format": "shopify_csv"}
Response 200:
{"file_id": "a1b2c3d4e5f6a7b8", "filename": "products-shopify_csv.csv",
"download_url": "/api/files/a1b2c3d4e5f6a7b8", "rows": 12}
GET /api/files/{file_id}
Download a generated file. Returns 404 if the file has expired (files expire after 1 hour).
GET /api/files/a1b2c3d4e5f6a7b8
Response 200: the file, as a download
POST /api/images
Extract images, plus logo, favicon and banner candidates, from a page.
POST /api/images
{"url": "https://example.com", "min_width": 200, "min_height": 200, "format": "png"}
Response 200:
{"images": [{"url": "...", "alt": "...", "width": 800, "height": 600,
"format": "png", "category": "product"}], "total": 14,
"logos": [...], "favicons": [...], "banners": [...]}
POST /api/images/zip
Download up to 200 images as one ZIP file.
POST /api/images/zip
{"images": [{"url": "https://example.com/a.jpg"}, {"url": "https://example.com/b.jpg"}]}
Response 200:
{"file_id": "...", "filename": "images.zip",
"download_url": "/api/files/..."}
POST /api/csv/validate, /repair, /merge, /split
Multipart file uploads (max 10 MB per file; 20 MB combined for merge). /split takes a form field max_rows (default 1000).
POST /api/csv/validate (form field: file)
Response 200: {"valid": true, "rows": 1, "errors": []}
POST /api/csv/repair (form field: file)
Response 200: {"file_id": "...", "filename": "repaired.csv",
"download_url": "/api/files/..."}
POST /api/csv/merge (form fields: files — at least 2)
Response 200: {"file_id": "...", "filename": "merged.csv",
"download_url": "/api/files/..."}
POST /api/csv/split (form fields: file, max_rows)
Response 200: {"parts": [{"file_id": "...", "filename": "split-part-1.csv",
"download_url": "/api/files/...", "part": 1}], "total_parts": 2}
Errors
400— bad request (unsafe URL, no products to export, file too large, fewer than 2 files for merge).404— file not found or expired.422— unsupported platform, or an invalidmode/formatvalue.502— extraction failed (for example the store returned 403 or the page could not be fetched).
Full interactive docs are served by the backend itself at /docs when it is running.