{"openapi":"3.1.0","info":{"title":"OpenCatalog API","version":"1.0.0","description":"Multi-supplier catalog of industrial parts and supplies. Public operations need no auth; admin operations need a Bearer token. The same public operations are exposed as MCP tools at /mcp."},"servers":[{"url":"https://opencatalog.typelens.com"}],"paths":{"/api/v1/search_products":{"post":{"operationId":"search_products_post","summary":"Search industrial products","description":"Use this when the user looks for an industrial part, spare part or consumable (bearings, lubricants, fasteners, pneumatics, electrical components, tools) and wants to know which supplier sells it, its code, price or availability. Full-text search over supplier catalogs by free text, supplier article code (sku) or manufacturer part number (mpn); exact code matches are ranked first. Optional filters: supplier, brand, category, price range. Prices are public list prices published by the supplier; always link the user to the product url to buy.","tags":["public"],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"query":{"description":"Free text, supplier code or manufacturer part number. Omit to browse with filters only.","type":"string","minLength":1},"supplier":{"description":"Exact supplier name, see list_suppliers","type":"string","minLength":1},"brand":{"description":"Brand / manufacturer name","type":"string","minLength":1},"category":{"description":"Category name or path fragment, see list_categories","type":"string","minLength":1},"price_min":{"type":"number","minimum":0},"price_max":{"type":"number","minimum":0},"limit":{"default":10,"type":"integer","minimum":1,"maximum":50},"offset":{"default":0,"type":"integer","minimum":0,"maximum":10000}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"}}},"get":{"operationId":"search_products","summary":"Search industrial products","description":"Use this when the user looks for an industrial part, spare part or consumable (bearings, lubricants, fasteners, pneumatics, electrical components, tools) and wants to know which supplier sells it, its code, price or availability. Full-text search over supplier catalogs by free text, supplier article code (sku) or manufacturer part number (mpn); exact code matches are ranked first. Optional filters: supplier, brand, category, price range. Prices are public list prices published by the supplier; always link the user to the product url to buy.","tags":["public"],"parameters":[{"name":"query","in":"query","required":false,"description":"Free text, supplier code or manufacturer part number. Omit to browse with filters only.","schema":{"description":"Free text, supplier code or manufacturer part number. Omit to browse with filters only.","type":"string","minLength":1}},{"name":"supplier","in":"query","required":false,"description":"Exact supplier name, see list_suppliers","schema":{"description":"Exact supplier name, see list_suppliers","type":"string","minLength":1}},{"name":"brand","in":"query","required":false,"description":"Brand / manufacturer name","schema":{"description":"Brand / manufacturer name","type":"string","minLength":1}},{"name":"category","in":"query","required":false,"description":"Category name or path fragment, see list_categories","schema":{"description":"Category name or path fragment, see list_categories","type":"string","minLength":1}},{"name":"price_min","in":"query","required":false,"schema":{"type":"number","minimum":0}},{"name":"price_max","in":"query","required":false,"schema":{"type":"number","minimum":0}},{"name":"limit","in":"query","required":false,"schema":{"default":10,"type":"integer","minimum":1,"maximum":50}},{"name":"offset","in":"query","required":false,"schema":{"default":0,"type":"integer","minimum":0,"maximum":10000}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"}}}},"/api/v1/get_product":{"post":{"operationId":"get_product_post","summary":"Get product details","description":"Use this when you need all available data for one product (full description, specs, images, documents, price breaks, availability, supplier url), given its id or supplier + sku from search_products.","tags":["public"],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"description":"Product id from search_products","type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"supplier":{"description":"Supplier name, used with sku","type":"string","minLength":1},"sku":{"description":"Supplier article code, used with supplier","type":"string","minLength":1}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"}}},"get":{"operationId":"get_product","summary":"Get product details","description":"Use this when you need all available data for one product (full description, specs, images, documents, price breaks, availability, supplier url), given its id or supplier + sku from search_products.","tags":["public"],"parameters":[{"name":"id","in":"query","required":false,"description":"Product id from search_products","schema":{"description":"Product id from search_products","type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},{"name":"supplier","in":"query","required":false,"description":"Supplier name, used with sku","schema":{"description":"Supplier name, used with sku","type":"string","minLength":1}},{"name":"sku","in":"query","required":false,"description":"Supplier article code, used with supplier","schema":{"description":"Supplier article code, used with supplier","type":"string","minLength":1}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"}}}},"/api/v1/list_suppliers":{"post":{"operationId":"list_suppliers_post","summary":"List suppliers","description":"Use this when the user asks which suppliers or catalogs are available, or before filtering search_products by supplier. Returns each supplier with website, product count and last update.","tags":["public"],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"}}},"get":{"operationId":"list_suppliers","summary":"List suppliers","description":"Use this when the user asks which suppliers or catalogs are available, or before filtering search_products by supplier. Returns each supplier with website, product count and last update.","tags":["public"],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"}}}},"/api/v1/list_categories":{"post":{"operationId":"list_categories_post","summary":"List categories","description":"Use this when the user wants to browse the catalog by category, or to find a valid category filter for search_products. Returns category paths (\"A > B > C\") with product counts.","tags":["public"],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"}}},"get":{"operationId":"list_categories","summary":"List categories","description":"Use this when the user wants to browse the catalog by category, or to find a valid category filter for search_products. Returns category paths (\"A > B > C\") with product counts.","tags":["public"],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"}}}},"/api/v1/upsert_products":{"post":{"operationId":"upsert_products","summary":"Upsert products","description":"Use this when importing or refreshing catalog data. Inserts or updates up to 1000 products per call, keyed by (supplier, sku). Unknown suppliers are created. Fields not provided are cleared on update.","tags":["admin"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"products":{"minItems":1,"maxItems":1000,"type":"array","items":{"type":"object","properties":{"supplier":{"type":"string","minLength":1},"sku":{"type":"string","minLength":1,"description":"Supplier article code"},"mpn":{"description":"Manufacturer part number","type":"string"},"brand":{"type":"string"},"title":{"type":"string","minLength":1},"description":{"type":"string"},"category":{"description":"Category path, from general to specific","type":"array","items":{"type":"string"}},"price":{"type":"number","minimum":0},"currency":{"type":"string"},"price_includes_vat":{"type":"boolean"},"price_unit":{"type":"string"},"pack_size":{"type":"number"},"min_order_qty":{"type":"number"},"price_breaks":{"type":"array","items":{"type":"object","properties":{"qty":{"type":"number"},"price":{"type":"number"}},"required":["qty","price"]}},"availability":{"type":"string"},"ean":{"type":"string"},"url":{"type":"string","format":"uri"},"images":{"type":"array","items":{"type":"string"}},"documents":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"url":{"type":"string"},"title":{"type":"string"}},"required":["url"]}},"specs":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean"]}},"country_of_origin":{"type":"string"},"weight_kg":{"type":"number"},"scraped_at":{"type":"string"},"demo":{"description":"Demo data, not a real offer","type":"boolean"}},"required":["supplier","sku","title","url"]}}},"required":["products"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"}},"security":[{"bearerAuth":[]}]}},"/api/v1/delete_products":{"post":{"operationId":"delete_products","summary":"Delete products","description":"Use this when products must be removed: pass supplier and skus to delete specific products, or supplier with all=true to delete the whole supplier catalog.","tags":["admin"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"supplier":{"type":"string","minLength":1},"skus":{"minItems":1,"maxItems":10000,"type":"array","items":{"type":"string"}},"all":{"type":"boolean"}},"required":["supplier"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"}},"security":[{"bearerAuth":[]}]}},"/api/v1/upsert_supplier":{"post":{"operationId":"upsert_supplier","summary":"Upsert supplier","description":"Use this when creating a supplier or updating its website, country or notes.","tags":["admin"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Supplier name, unique"},"website":{"type":"string","format":"uri"},"country":{"description":"ISO 3166-1 alpha-2 country code","type":"string"},"notes":{"type":"string"}},"required":["name"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"}},"security":[{"bearerAuth":[]}]}},"/api/v1/stats":{"post":{"operationId":"stats","summary":"Catalog stats","description":"Use this when you need catalog counts, per-supplier totals and recent anonymous call log.","tags":["admin"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"}},"security":[{"bearerAuth":[]}]}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}},"responses":{"Error":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}}