{"openapi":"3.1.0","info":{"title":"Bookproof API","version":"1.0.0","description":"Read-only, fee- and depth-aware Polymarket order-book intelligence paid per call with x402.","x-guidance":"Call the free GET /api/v1/resolve-market first when the input is a Polymarket URL, token ID, or search phrase. Use GET or POST /api/v1/market-health for spread, depth, imbalance, fee configuration, and freshness. Use POST /api/v1/execution-quote before evaluating a hypothetical BUY budget; the result is indicative and never places an order.","license":{"name":"Proprietary API; public documentation"}},"servers":[{"url":"https://bookproof-api.sn95wjq846.chatgpt.site"}],"paths":{"/api/v1/resolve-market":{"get":{"operationId":"resolvePolymarketMarket","summary":"Resolve a Polymarket URL, slug, token ID, or search phrase","description":"Free pre-payment resolver. Returns one selected active binary market plus alternatives and copy-ready inputs for the paid tools.","tags":["Market resolution"],"parameters":[{"name":"input","in":"query","required":true,"schema":{"type":"string","minLength":2,"maxLength":500},"example":"https://polymarket.com/event/will-the-fed-decrease-interest-rates-by-25-bps-after-the-july-2026-meeting"}],"responses":{"200":{"description":"Resolved market and alternatives","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarketResolution"}}}},"400":{"description":"Invalid market input"},"404":{"description":"No matching active binary market"},"502":{"description":"Polymarket upstream unavailable"}}}},"/api/v1/market-health":{"get":{"operationId":"getMarketHealth","summary":"Inspect a binary Polymarket order book","description":"Returns per-outcome best bid/ask, spread, 1/2/5 cent depth, two-cent imbalance, snapshot age, and the applicable taker fee model.","tags":["Market data"],"parameters":[{"name":"market","in":"query","required":true,"schema":{"type":"string","minLength":2,"maxLength":500},"example":"https://polymarket.com/event/will-the-fed-decrease-interest-rates-by-25-bps-after-the-july-2026-meeting"}],"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.005"},"protocols":[{"x402":{}}],"network":"eip155:8453","payTo":"0x83f6EEaE1F332Ec627fAF6467a378118fb775752"},"responses":{"200":{"description":"Current market-health snapshot","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarketHealth"}}}},"400":{"description":"Invalid slug"},"402":{"description":"Payment Required"},"404":{"description":"Market not found"},"502":{"description":"Upstream unavailable"}}},"post":{"operationId":"createMarketHealth","summary":"Inspect a binary Polymarket order book (agent-compatible POST)","description":"POST-compatible form of getMarketHealth for agent clients that send tool inputs as JSON.","tags":["Market data"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarketHealthRequest"},"example":{"market":"https://polymarket.com/event/will-the-fed-decrease-interest-rates-by-25-bps-after-the-july-2026-meeting"}}}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.005"},"protocols":[{"x402":{}}],"network":"eip155:8453","payTo":"0x83f6EEaE1F332Ec627fAF6467a378118fb775752"},"responses":{"200":{"description":"Current market-health snapshot","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarketHealth"}}}},"400":{"description":"Invalid request"},"402":{"description":"Payment Required"},"404":{"description":"Market not found"},"502":{"description":"Upstream unavailable"}}}},"/api/v1/execution-quote":{"get":{"operationId":"getExecutionQuote","summary":"Model a fee- and depth-aware BUY quote with query parameters","description":"GET-compatible form for agents that cannot send JSON bodies. It returns the same indicative quote and never places an order.","tags":["Market data"],"parameters":[{"name":"market","in":"query","required":true,"schema":{"type":"string","minLength":2,"maxLength":500}},{"name":"outcome","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}},{"name":"budgetUsd","in":"query","required":true,"schema":{"type":"number","minimum":1,"maximum":10000}}],"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.015"},"protocols":[{"x402":{}}],"network":"eip155:8453","payTo":"0x83f6EEaE1F332Ec627fAF6467a378118fb775752"},"responses":{"200":{"description":"Indicative execution quote","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExecutionQuote"}}}},"400":{"description":"Invalid request"},"402":{"description":"Payment Required"},"404":{"description":"Market not found"},"422":{"description":"Unsupported or empty market"},"502":{"description":"Upstream unavailable"}}},"post":{"operationId":"createExecutionQuote","summary":"Model a fee- and depth-aware BUY quote","description":"Sweeps the current asks until the all-in USD budget is exhausted. Returns modeled shares, VWAP, price impact, taker fee, and any unfilled budget. It never places an order.","tags":["Market data"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuoteRequest"},"example":{"market":"https://polymarket.com/event/will-the-fed-decrease-interest-rates-by-25-bps-after-the-july-2026-meeting","outcome":"Yes","budgetUsd":100}}}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.015"},"protocols":[{"x402":{}}],"network":"eip155:8453","payTo":"0x83f6EEaE1F332Ec627fAF6467a378118fb775752"},"responses":{"200":{"description":"Indicative execution quote","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExecutionQuote"}}}},"400":{"description":"Invalid request"},"402":{"description":"Payment Required"},"404":{"description":"Market not found"},"422":{"description":"Unsupported or empty market"},"502":{"description":"Upstream unavailable"}}}}},"components":{"schemas":{"MarketHealthRequest":{"type":"object","additionalProperties":false,"required":["market"],"properties":{"market":{"type":"string","minLength":2,"maxLength":500}}},"QuoteRequest":{"type":"object","additionalProperties":false,"required":["market","outcome","budgetUsd"],"properties":{"market":{"type":"string","minLength":2,"maxLength":500},"outcome":{"type":"string","minLength":1,"maxLength":80},"budgetUsd":{"type":"number","minimum":1,"maximum":10000}}},"MarketHealth":{"type":"object","required":["service","generatedAt","market","health","fee","books"],"properties":{"service":{"const":"bookproof"},"generatedAt":{"type":"string","format":"date-time"},"market":{"type":"object"},"health":{"type":"object"},"fee":{"type":"object"},"books":{"type":"array","items":{"type":"object"}}}},"MarketResolution":{"type":"object","required":["service","free","resolution","next"],"properties":{"service":{"const":"bookproof"},"free":{"const":true},"resolution":{"type":"object","required":["inputType","selected","alternatives","confidence"],"properties":{"inputType":{"enum":["url","slug","token_id","search"]},"selected":{"type":"object"},"alternatives":{"type":"array","items":{"type":"object"}},"confidence":{"enum":["exact","high","best_match"]}}},"next":{"type":"object"}}},"ExecutionQuote":{"type":"object","required":["service","generatedAt","quoteExpiresAt","market","request","quote"],"properties":{"service":{"const":"bookproof"},"generatedAt":{"type":"string","format":"date-time"},"quoteExpiresAt":{"type":"string","format":"date-time"},"market":{"type":"object"},"request":{"type":"object"},"quote":{"type":"object"},"fee":{"type":"object"},"fills":{"type":"array","items":{"type":"object"}}}}}},"externalDocs":{"description":"Bookproof landing page and usage notes","url":"https://bookproof-api.sn95wjq846.chatgpt.site"}}