{"openapi":"3.1.0","info":{"title":"Poizon/dewu API","description":"Manufacturer article -> dewu spuId, exact CNY price, sizes with availability, photo. Authenticate with the x-api-key header.","version":"1.3"},"paths":{"/v1/product":{"get":{"summary":"V1 Product","operationId":"v1_product_v1_product_get","parameters":[{"name":"article","in":"query","required":true,"schema":{"type":"string","description":"manufacturer article, e.g. IG3773","title":"Article"},"description":"manufacturer article, e.g. IG3773"},{"name":"size","in":"query","required":false,"schema":{"type":"string","description":"keep only this size, e.g. 42 or M","default":"","title":"Size"},"description":"keep only this size, e.g. 42 or M"},{"name":"fresh","in":"query","required":false,"schema":{"type":"boolean","description":"force a dewu re-read","default":false,"title":"Fresh"},"description":"force a dewu re-read"},{"name":"resolve","in":"query","required":false,"schema":{"type":"boolean","description":"may look up an unknown article","default":true,"title":"Resolve"},"description":"may look up an unknown article"},{"name":"sizes","in":"query","required":false,"schema":{"type":"boolean","default":true,"title":"Sizes"}},{"name":"x-api-key","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/find":{"get":{"summary":"V1 Find","description":"One door for whatever the caller happens to have.\n\nA seller holding a box has the article number; one holding a screenshot has\na dewu link with an spuId in it; one who saved a size has a skuId; one who\nhas neither types the name. All four end at the same product, so all four\nare answered here instead of making the caller pick the right endpoint.","operationId":"v1_find_v1_find_get","parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string","minLength":2,"description":"article, spuId, skuId or a product name","title":"Q"},"description":"article, spuId, skuId or a product name"},{"name":"x-api-key","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/sku":{"get":{"summary":"V1 Sku","description":"One size, addressed by dewu's own permanent id for it.\n\n`/v1/product` answers \"what about this shoe\"; this answers \"what about this\nshoe in 42\". The skuId never changes, so it is a stable link a seller can\nsave next to a listing and re-check later.","operationId":"v1_sku_v1_sku_get","parameters":[{"name":"sku","in":"query","required":true,"schema":{"type":"integer","description":"dewu skuId - one size of one product","title":"Sku"},"description":"dewu skuId - one size of one product"},{"name":"x-api-key","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/products":{"get":{"summary":"V1 Products","description":"Batch lookup. dewu refuses after roughly 60 quick reads, so the budget is\nreal: what it does not cover is answered from cache and marked stale rather\nthan being passed off as current.","operationId":"v1_products_v1_products_get","parameters":[{"name":"articles","in":"query","required":true,"schema":{"type":"string","description":"comma-separated","title":"Articles"},"description":"comma-separated"},{"name":"budget","in":"query","required":false,"schema":{"type":"integer","maximum":40,"minimum":0,"description":"how many dewu page reads this call may spend","default":8,"title":"Budget"},"description":"how many dewu page reads this call may spend"},{"name":"resolve","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Resolve"}},{"name":"sizes","in":"query","required":false,"schema":{"type":"boolean","default":true,"title":"Sizes"}},{"name":"x-api-key","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/resolve":{"post":{"summary":"V1 Resolve","description":"Teach the service one product.\n\nA link shared from the dewu app carries its spuId, so pasting it is enough;\nan article number goes through the reseller and is only accepted once dewu\nprints the same number on the page it points at.","operationId":"v1_resolve_v1_resolve_post","parameters":[{"name":"value","in":"query","required":true,"schema":{"type":"string","description":"article, spuId, product URL or dw4.co link","title":"Value"},"description":"article, spuId, product URL or dw4.co link"},{"name":"x-api-key","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/usage":{"get":{"summary":"V1 Usage","description":"What this key has spent. Same table the invoice is built from, so what a\ncustomer reads here is what they are charged for.\n\nDeliberately reachable with an empty balance: someone who has run out needs\nto see what they used before they can decide what to buy, and a paywall in\nfront of the bill would be a strange way to ask for money.","operationId":"v1_usage_v1_usage_get","parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":90,"minimum":1,"default":30,"title":"Days"}},{"name":"x-api-key","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"type":"string","default":"","title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/status":{"get":{"summary":"V1 Status","description":"Public: is the service up and how much does it know.\n\nThe index size is the product - a resolver that knows 21k articles answers\ninstantly where an empty one has to go and fetch. No key needed; there is\nnothing here a customer could not learn by asking for a product.","operationId":"v1_status_v1_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/docs":{"get":{"summary":"V1 Docs","operationId":"v1_docs_v1_docs_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/playground":{"get":{"summary":"V1 Playground","description":"A page that calls this very service, served by it.\n\nSame origin on purpose: the browser talks to /v1 directly, so what a visitor\nsees is the real answer with the real latency, not a mock behind CORS. The\nkey lives in the visitor's browser; the only key this page can carry is the\ndemo one, and only if the environment supplies it.","operationId":"v1_playground_v1_playground_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/plans":{"get":{"summary":"V1 Plans","description":"Public: what each plan allows and what it costs. No key needed.","operationId":"v1_plans_v1_plans_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}},"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"x-api-key"}}},"security":[{"ApiKey":[]}]}