{"openapi":"3.1.0","info":{"title":"B2B Tool Studio Data & Compliance API","version":"2.0.0","description":"Deterministic regulatory intelligence, vulnerability prioritization, OpenAPI contract diffing, and Remote MCP (2025-06-18). Daily quotas reset at 00:00 UTC.","contact":{"email":"support@b2btoolstudio.com","url":"https://b2btoolstudio.com/support.html"}},"servers":[{"url":"https://api.b2btoolstudio.com"}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Polar.sh Data API Pro (500/day, $19/mo) or Team (2,500/day, $49/mo) license key. Quotas reset daily at 00:00 UTC."}},"schemas":{"ErrorResponse":{"type":"object","required":["ok","error"],"properties":{"ok":{"type":"boolean","const":false},"error":{"type":"string"},"upgradeUrl":{"type":"string","format":"uri"},"resetAt":{"type":"string","format":"date-time"}}},"UsageResponse":{"type":"object","required":["ok","tier","dailyLimit","usedToday","remainingToday","dayBucket","resetAt"],"properties":{"ok":{"type":"boolean"},"tier":{"type":"string","enum":["free","pro","team"]},"dailyLimit":{"type":"integer"},"usedToday":{"type":"integer"},"remainingToday":{"type":"integer"},"dayBucket":{"type":"string"},"resetAt":{"type":"string","format":"date-time"},"resetSchedule":{"type":"string"}}},"StatusResponse":{"type":"object","required":["ok","studioName","lastCheckedAt","targets"],"properties":{"ok":{"type":"boolean"},"studioName":{"type":"string"},"lastCheckedAt":{"type":"string","format":"date-time"},"checkedAgeSeconds":{"type":"integer"},"targets":{"type":"array","items":{"type":"object"}}}},"FdaRiskResponse":{"type":"object","required":["ok","query","riskLevel","riskScore","hasActiveClassIRecall","totals","asOf","source","rulesVersion"],"properties":{"ok":{"type":"boolean"},"query":{"type":"string"},"riskLevel":{"type":"string","enum":["LOW","MODERATE","HIGH","CRITICAL"]},"riskScore":{"type":"integer"},"hasActiveClassIRecall":{"type":"boolean"},"asOf":{"type":"string","format":"date-time"},"source":{"type":"string"},"rulesVersion":{"type":"string"},"reasons":{"type":"array","items":{"type":"string"}},"totals":{"type":"object"}}},"Sec8kResponse":{"type":"object","required":["ok","ticker","cik","count","events","asOf","source","rulesVersion"],"properties":{"ok":{"type":"boolean"},"ticker":{"type":"string"},"cik":{"type":"string"},"companyName":{"type":"string"},"count":{"type":"integer"},"events":{"type":"array","items":{"type":"object"}},"asOf":{"type":"string","format":"date-time"},"source":{"type":"string"},"rulesVersion":{"type":"string"}}},"NpiResponse":{"type":"object","required":["ok","count","leads","asOf","source","rulesVersion"],"properties":{"ok":{"type":"boolean"},"resultCount":{"type":"integer"},"count":{"type":"integer"},"leads":{"type":"array","items":{"type":"object"}},"asOf":{"type":"string","format":"date-time"},"source":{"type":"string"},"rulesVersion":{"type":"string"}}},"KevResponse":{"type":"object","required":["ok","count","items","asOf","source","rulesVersion"],"properties":{"ok":{"type":"boolean"},"catalogVersion":{"type":["string","null"]},"count":{"type":"integer"},"items":{"type":"array","items":{"type":"object"}},"asOf":{"type":"string","format":"date-time"},"source":{"type":"string"},"rulesVersion":{"type":"string"}}},"OpenApiDiffRequest":{"type":"object","required":["base","target"],"properties":{"base":{"oneOf":[{"type":"object"},{"type":"string"}]},"target":{"oneOf":[{"type":"object"},{"type":"string"}]}}},"OpenApiDiffResponse":{"type":"object","required":["ok","recommendedSemverBump","breakingChanges","nonBreakingChanges","summary"],"properties":{"ok":{"type":"boolean"},"recommendedSemverBump":{"type":"string","enum":["MAJOR","MINOR","NONE"]},"breakingChanges":{"type":"array","items":{"type":"object"}},"nonBreakingChanges":{"type":"array","items":{"type":"object"}},"summary":{"type":"object"}}},"UsaSpendingResponse":{"type":"object","required":["ok","naics","count","contracts"],"properties":{"ok":{"type":"boolean"},"naics":{"type":"string"},"count":{"type":"integer"},"contracts":{"type":"array","items":{"type":"object"}}}}}},"paths":{"/":{"get":{"summary":"API discovery index","responses":{"200":{"description":"Discovery links","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/health":{"get":{"summary":"Service health check","responses":{"200":{"description":"Healthy","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/status":{"get":{"summary":"Upstream feed health telemetry","responses":{"200":{"description":"Upstream status list","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatusResponse"}}}}}}},"/api/account/usage":{"get":{"summary":"Check daily API quota tier, remaining calls, and 00:00 UTC reset schedule","security":[{},{"bearerAuth":[]}],"responses":{"200":{"description":"Quota summary","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageResponse"}}}},"401":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/tools/fda-risk":{"get":{"summary":"Cross-reference openFDA 510(k), PMA, recalls & ongoing Class I/II enforcements","security":[{},{"bearerAuth":[]}],"parameters":[{"name":"query","in":"query","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":25}}],"responses":{"200":{"description":"FDA risk dossier","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FdaRiskResponse"}}}},"400":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"502":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/tools/sec-8k":{"get":{"summary":"Extract and classify SEC EDGAR Form 8-K filings","security":[{},{"bearerAuth":[]}],"parameters":[{"name":"ticker","in":"query","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":20}}],"responses":{"200":{"description":"SEC 8-K events","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Sec8kResponse"}}}},"404":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"502":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/tools/npi-search":{"get":{"summary":"Search CMS NPPES v2.1 healthcare providers (requires >=2 criteria)","security":[{},{"bearerAuth":[]}],"parameters":[{"name":"state","in":"query","schema":{"type":"string"}},{"name":"city","in":"query","schema":{"type":"string"}},{"name":"taxonomy","in":"query","schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":25}}],"responses":{"200":{"description":"NPI leads","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NpiResponse"}}}},"422":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"502":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/tools/kev-priority":{"get":{"summary":"Prioritize CISA KEV vulnerabilities with FIRST EPSS enrichment","security":[{},{"bearerAuth":[]}],"parameters":[{"name":"vendor","in":"query","schema":{"type":"string"}},{"name":"product","in":"query","schema":{"type":"string"}},{"name":"ransomware","in":"query","schema":{"type":"boolean"}},{"name":"overdueOnly","in":"query","schema":{"type":"boolean"}},{"name":"minScore","in":"query","schema":{"type":"number","minimum":0,"maximum":100}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"Prioritized KEV items","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KevResponse"}}}},"400":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"502":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/tools/openapi-diff":{"post":{"summary":"Deterministic OpenAPI 3.x path/method/param breaking-change diff","security":[{},{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiDiffRequest"}}}},"responses":{"200":{"description":"Diff report","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiDiffResponse"}}}},"400":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/tools/usaspending-expiring":{"get":{"summary":"Find expiring federal contracts by NAICS code","security":[{},{"bearerAuth":[]}],"parameters":[{"name":"naics","in":"query","schema":{"type":"string"}},{"name":"months","in":"query","schema":{"type":"integer","minimum":1,"maximum":36}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":25}}],"responses":{"200":{"description":"Expiring contracts","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsaSpendingResponse"}}}},"429":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"502":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"504":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/recompete/search":{"get":{"summary":"Search option-year-aware Federal Recompete Radar index (D1-backed, <50ms)","security":[{},{"bearerAuth":[]}],"parameters":[{"name":"naics","in":"query","schema":{"type":"string"}},{"name":"agency","in":"query","schema":{"type":"string"}},{"name":"stage","in":"query","schema":{"type":"string"}},{"name":"setAside","in":"query","schema":{"type":"string"}},{"name":"minAmount","in":"query","schema":{"type":"number"}},{"name":"months","in":"query","schema":{"type":"integer","minimum":1,"maximum":60}},{"name":"q","in":"query","schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"Option-year-aware recompete contracts","content":{"application/json":{"schema":{"type":"object"}}}},"429":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/recompete/award/{id}":{"get":{"summary":"Get award details and change history events (extensions, bridge detections, stage changes)","security":[{},{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Award detail + changeHistory","content":{"application/json":{"schema":{"type":"object"}}}},"404":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/recompete/sample":{"get":{"summary":"Public 0-quota Federal Recompete Radar sample board (KV cached)","responses":{"200":{"description":"Sample contracts","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/watchlists":{"get":{"summary":"List your saved watchlists (Pro/Team Polar key required)","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Watchlist array","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"summary":"Create a watchlist with signed Slack/Discord/Webhook + ICS/RSS/CSV feeds (Pro/Team key required)","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"201":{"description":"Created watchlist","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v2/sec8k/board":{"get":{"summary":"Public 0-quota Red-Flag 8-Ks (Last 24h) board served from KV","responses":{"200":{"description":"24h red-flag 8-K board","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/v2/sec8k/feed":{"get":{"summary":"Cross-company SEC Form 8-K Red-Flag feed indexed every 5 minutes (D1-backed)","security":[{},{"bearerAuth":[]}],"parameters":[{"name":"item","in":"query","schema":{"type":"string"}},{"name":"tier","in":"query","schema":{"type":"string"}},{"name":"date","in":"query","schema":{"type":"string"}},{"name":"q","in":"query","schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"SEC 8-K filings feed","content":{"application/json":{"schema":{"type":"object"}}}},"429":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v2/sec8k/issuers/{id}/timeline":{"get":{"summary":"Issuer 8-K timeline by ticker or 10-digit CIK","security":[{},{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Issuer 8-K timeline","content":{"application/json":{"schema":{"type":"object"}}}},"429":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/mcp":{"post":{"summary":"Remote MCP JSON-RPC 2.0 endpoint (protocol 2025-06-18)","security":[{},{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"JSON-RPC response","content":{"application/json":{"schema":{"type":"object"}}}}}}}}}