{"openapi":"3.1.0","info":{"title":"CNBot China Product Search","version":"0.2.0","description":"Search Taobao and 1688 listings. No authentication during the bounded public prototype. Call searchProducts, then getSearch every 8 seconds, at most 12 times. Advertised prices, not confirmed quotations. Submit no secrets or personal data."},"servers":[{"url":"https://api.cnbot.io"}],"security":[],"paths":{"/api/search":{"post":{"operationId":"searchProducts","summary":"Search Chinese marketplace listings","description":"Returns a queued, running or cached job. Follow poll_url until completed or failed. This creates a temporary search job and consumes the shared allowance.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchInput"}}}},"responses":{"200":{"description":"Cached completed job","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchJob"}}}},"202":{"description":"Accepted; wait retry_after_seconds before polling","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchJob"}}}},"400":{"description":"Request rejected; inspect error and respect Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request rejected; inspect error and respect Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Request rejected; inspect error and respect Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/search/{id}":{"get":{"operationId":"getSearch","summary":"Read a product search job","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Completed or failed; inspect status, result, error and warnings","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchJob"}}}},"202":{"description":"Pending; wait before polling","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchJob"}}}},"404":{"description":"Request rejected; inspect error and respect Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request rejected; inspect error and respect Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"schemas":{"SearchInput":{"type":"object","additionalProperties":false,"required":["query"],"properties":{"query":{"type":"string","minLength":4,"maxLength":700,"description":"Non-confidential product requirements in any language. Not instructions to contact a seller."},"quantity":{"type":"integer","minimum":1,"maximum":100000,"description":"Requested number of units, when known."},"platforms":{"type":"array","minItems":1,"maxItems":2,"items":{"type":"string","enum":["1688","taobao"]}}}},"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"retry_after_seconds":{"type":"integer"}}},"SearchJob":{"type":"object","required":["id","status","poll_url","result_url","retry_after_seconds","expires_at"],"properties":{"id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["queued","running","completed","failed"]},"poll_url":{"type":"string","format":"uri"},"result_url":{"type":"string","format":"uri"},"retry_after_seconds":{"type":"integer"},"expires_at":{"type":"string","format":"date-time"},"error":{"type":"string"},"result":{"$ref":"#/components/schemas/SearchResult"}}},"SearchResult":{"type":"object","properties":{"query":{"type":"string"},"quantity":{"type":"integer"},"summary":{"type":"string"},"fetched_at":{"type":"string","format":"date-time"},"plan":{"type":"object","additionalProperties":true},"sources":{"type":"array","items":{"type":"object","additionalProperties":true}},"warnings":{"type":"array","items":{"type":"string"}},"limitations":{"type":"array","items":{"type":"string"}},"offers":{"type":"array","items":{"$ref":"#/components/schemas/Offer"}}}},"Offer":{"type":"object","properties":{"id":{"type":"string"},"platform":{"type":"string","enum":["1688","taobao"]},"title_original":{"type":"string"},"url":{"type":"string","format":"uri"},"seller":{"type":["string","null"]},"advertised_unit_price_cny":{"type":["number","null"]},"indicative_subtotal_cny":{"type":["number","null"]},"moq":{"type":["number","null"]},"match":{"type":"string","enum":["likely","uncertain","mismatch"]},"reason":{"type":"string"},"missing":{"type":"array","items":{"type":"string"}},"price_basis":{"type":"string"}}}}}}