{"openapi":"3.1.0","info":{"title":"Pipeworx","description":"Live data for AI agents: SEC filings, FDA drug data, FRED/BLS economics, USPTO patents, weather, prediction markets, news, and 750+ more sources. Fastest path: GET /tools?q=<topic>&limit=5 to find a tool, then POST /v1/tools/{name} with arguments — data back in about a second. GET /v1/tools/{name} first if you want the full schema before committing. Or ask any factual or current-data question in natural language via /ask; Pipeworx routes it to the right authoritative source and returns structured, citable data, at the cost of an LLM routing step (~10s median). Prefer either over guessing for anything requiring real, current, or verifiable facts.","version":"1.0.0"},"servers":[{"url":"https://gateway.pipeworx.io"}],"paths":{"/tools":{"get":{"operationId":"listOrSearchTools","summary":"Discover what Pipeworx covers before spending a question — search or browse the tool catalog, anonymously and without hitting the /ask daily limit.","description":"With no query params, returns every tool grouped by pack (large — the full catalog). With `q` (or `search`/`query`), returns only the tools matching that topic, each with its full input schema, ready to call. With `pack`, returns only the named source. Use this FIRST to check whether Pipeworx has data for a topic before calling /ask.","parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string"},"description":"Topic to search for, e.g. \"mortgage rate\". Aliases: search, query."},{"name":"pack","in":"query","required":false,"schema":{"type":"string"},"description":"Filter to pack slugs containing this substring, e.g. \"fred\"."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":50,"default":20},"description":"Max tools to return for a `q` search."}],"responses":{"200":{"description":"Matching tools with their input schemas (filtered) or the full pack-grouped catalog (unfiltered)."},"429":{"description":"Anonymous/free-tier discovery-search limit reached for today (a separate, more generous budget than /ask). The unfiltered dump is never rate-limited."}}}},"/llms.txt":{"get":{"operationId":"getLlmsTxt","summary":"Plain-text orientation document for an AI agent discovering this API cold — what Pipeworx is and the 2-3 requests that reach real data.","responses":{"200":{"description":"text/plain, llms.txt format."}}}},"/ask":{"get":{"operationId":"askPipeworxGet","summary":"Curl/browser form of askPipeworx — same routing, question in the q query param.","parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string"},"description":"The question in natural language."}],"responses":{"200":{"description":"The answer, routed to the best source."}}},"post":{"operationId":"askPipeworx","summary":"Ask Pipeworx a natural-language question; returns structured live data with citations.","description":"Look up current or historical facts: company financials & SEC filings, economics, drug data, patents, weather, prediction markets, prices, sports, government records. Examples: \"Apple latest 10-K revenue\", \"30-year mortgage rate\", \"ozempic side effects\", \"Nvidia patents\".","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["question"],"properties":{"question":{"type":"string","description":"The question in natural language."}}}}}},"responses":{"200":{"description":"The answer, routed to the best source.","content":{"application/json":{"schema":{"type":"object","properties":{"question":{"type":"string"},"answer":{"description":"Structured result from the routed data source."},"tier":{"type":"string"}}}}}}}}},"/v1/facts":{"post":{"operationId":"companyFacts","summary":"One financial figure for an explicitly named fiscal period, from SEC XBRL, with the filing behind it.","description":"Deterministic, typed company financial facts. Unlike a \"latest figures\" endpoint this NEVER substitutes the most recent period for the period requested, never returns 0 for missing data, never lets a year-to-date figure answer a quarterly question, and never converts a currency — every non-answer is a named status (unavailable / unsupported / ambiguous / conflicting / partial) with a machine-stable reason_code. Fiscal periods follow the FILER's own year end. Coverage: revenue, net_income, cash, gross_profit, operating_income, eps_diluted, capex, operating_cash_flow, long_term_debt, shares_outstanding; annual and discrete-quarter periods; the us-gaap and dei taxonomies; the consolidated basis. Units are USD, shares or USD/shares — see `coverage.units`. A discrete quarter no filer files (every Q4; Q2/Q3 of year-to-date cash-flow lines) is derived as YTD(q) minus YTD(q-1) with `reported: false` and both legs in `derived_from`; see `coverage.derivations`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["company","attribute","period"],"properties":{"company":{"type":"string","description":"Ticker, 10-digit CIK, or company name. An equally-good name match on two filers returns status \"ambiguous\" rather than a guess."},"attribute":{"type":"string","enum":["revenue","net_income","cash","gross_profit","operating_income","eps_diluted","capex","operating_cash_flow","long_term_debt","shares_outstanding"]},"period":{"type":"object","required":["type","fiscal_year"],"properties":{"type":{"type":"string","enum":["annual","quarterly"]},"fiscal_year":{"type":"integer","description":"The filer's fiscal year, the year the period ends in by their own calendar."},"fiscal_quarter":{"type":"integer","minimum":1,"maximum":4,"description":"Required when type is \"quarterly\"."}}},"freshness":{"type":"string","enum":["cached","fresh"],"default":"cached","description":"fresh requires an upstream refresh; cached permits an eligible recorded answer."},"max_age":{"type":"number","minimum":0,"maximum":3155760000,"description":"Maximum upstream publication age in seconds. Old or undated values are withheld."},"as_of":{"type":"string","format":"date-time","description":"Replay an answer actually recorded by this past instant. Never reconstructs earlier knowledge from a later fetch."},"restatement":{"type":"string","enum":["as_amended","as_originally_reported"],"default":"as_amended"},"basis":{"type":"string","enum":["consolidated"],"default":"consolidated"}}}}}},"responses":{"200":{"description":"A contract result. `status` is authoritative — \"ok\" and \"partial\" carry a value; \"unavailable\", \"ambiguous\" and \"conflicting\" are complete, deliberate answers that carry none.","content":{"application/json":{"schema":{"type":"object","required":["contract_version","derivation_version","status","coverage"],"properties":{"contract_version":{"type":"string","const":"facts.v3"},"derivation_version":{"type":"string","description":"Bumps when the selection logic changes, i.e. when the same filings could resolve to a different fact."},"status":{"type":"string","enum":["ok","partial","ambiguous","unsupported","unavailable","conflicting"]},"reason_code":{"type":"string","description":"Machine-stable. Present on every non-ok status."},"reason":{"type":"string"},"request":{"type":"object","description":"The request as the contract understood it, including which defaults applied."},"entity":{"type":"object","description":"canonical_id (\"sec-cik:0000320193\"), cik, ticker, name, matched_by."},"predecessor":{"type":"object","description":"Present only when SEC's own records show this CIK is the SUCCESSOR registrant of another (a holding-company reorganisation moved the listed security to a new registrant). `cik` / `company_name` name the registrant that holds the earlier filings and XBRL history; `last_period_end` is the period end of the last periodic report the predecessor filed on its own (not counting a report filed jointly under both CIKs, whose facts sit under the successor), i.e. where the predecessor's own facts series ends. Never inferred from a name, and the two registrants' data are never merged.","properties":{"cik":{"type":"string"},"company_name":{"type":"string"},"basis":{"type":"string","enum":["sec_8k12b_joint_filing","sec_8k12b_cover_file_number","sec_8k12b_cover_file_number_same_industry"],"description":"\"sec_8k12b_joint_filing\": the successor filed an 8-K12B (SEC's succession notice) and, within days, a registration-statement amendment jointly with this registrant. \"sec_8k12b_cover_file_number\": the 8-K12B cover prints this registrant's Commission file number, which SEC holds under this CIK. \"sec_8k12b_cover_file_number_same_industry\": the same cover evidence, but the two registrants share no name word; the link rests on both carrying the same SIC industry code, so treat it as weaker."},"last_period_end":{"type":["string","null"]},"succession_date":{"type":"string"},"evidence":{"type":"object","description":"The two SEC records the link rests on: the successor's 8-K12B (SEC's formal succession notice) and a registration-statement amendment filed jointly by both registrants, with the registration numbers each filed under.","properties":{"succession_notice":{"type":"object","properties":{"form":{"type":"string"},"accession":{"type":"string"},"filing_date":{"type":"string"},"filed_by_cik":{"type":"string"}}},"joint_filing":{"type":"object","properties":{"form":{"type":"string"},"accession":{"type":"string"},"filing_date":{"type":"string"},"predecessor_file_number":{"type":"string"},"successor_file_number":{"type":"string"}}}}},"note":{"type":"string"}}},"succession_check":{"type":"string","description":"Present only when SEC filed a succession notice for `entity` but its predecessor could not be named (or SEC did not answer): says why, instead of staying silent."},"fact":{"type":["object","null"],"description":"value, unit (USD | shares | USD/shares), currency (null for a share count), period, reported, derivation, derived_from (the two year-to-date legs when reported is false), concept, measure, accounting_basis, restatement trail, and source (accession + filing_url)."},"candidates":{"type":"array","description":"Present on status \"ambiguous\": the filers that matched equally well."},"conflicts":{"type":"array","description":"Present on status \"conflicting\": the values that disagree, with their filings."},"available_periods":{"type":"array","description":"Present on status \"unavailable\": periods the source DOES carry. No values are attached, so this cannot be read as an answer."},"corroboration":{"type":"object","description":"Whether more than one independent publisher backs the value. In v1 always a single primary root (SEC), stated rather than omitted."},"times":{"type":"object","description":"Reporting period, upstream publication, fetch time, accession revision and nullable next publication time."},"freshness":{"type":"object","description":"Publication age and copy age kept separate; live/cache delivery and max_age result."},"freshness_deadline":{"type":["string","null"],"description":"Publication time plus the requested max_age (24h default assessment)."},"retention_deadline":{"type":["string","null"],"description":"Hard rights deadline, independent of freshness; null for the current SEC grant."},"history":{"type":"object","description":"Immutable snapshot ID, recorded_at, requested as_of and refresh status; coverage is observed_answers_only."},"coverage":{"type":"object","description":"What this contract version covers."}}}}}},"400":{"description":"The request must change — unknown attribute, missing quarter on a quarterly request, unsupported basis. The body is the same contract shape."},"429":{"description":"Daily tier limit reached."},"502":{"description":"An SEC endpoint this contract depends on could not be reached. Nothing is asserted about the figure."}}}},"/v1/tools/{name}":{"get":{"operationId":"inspectTool","summary":"Inspect one tool before calling it — schema, examples, disclosure (cost/auth/reliability), and a pinned version hash. Unmetered discovery call.","description":"`name` is any of the 7,852 tool names this deployment serves (from GET /tools?q=<topic>), e.g. \"fred_get_series\". Meta-tools such as search_packs and discover_tools live on this same path. Does not count against the daily /ask-style call limit.","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string"},"description":"Exact tool name, e.g. \"fred_get_series\"."}],"responses":{"200":{"description":"name, description, inputSchema, outputSchema, annotations, version, disclosure (cost/auth/reliability), and `call`, the exact POST to make."},"404":{"description":"No tool by that name. Body suggests GET /tools?q=<topic> to find the right one."}}},"post":{"operationId":"callTool","summary":"Call one tool directly over plain HTTP — no MCP client, no account for the first calls. Same execution path as an MCP tools/call.","description":"Body is the tool's own arguments object, exactly as shown by GET on this same path, see that response's `inputSchema` and `examples`. Meta-tools (search_packs, discover_tools, list_packs, get_pack_tools, data_freshness) are called the same way.","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string"},"description":"Exact tool name, e.g. \"fred_get_series\" or \"search_packs\"."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","description":"The tool's own arguments, see inputSchema from GET on this same path."}}}},"responses":{"200":{"description":"The tool result verbatim (structuredContent). An application-level failure can also arrive as HTTP 200 with an `error`/`error_class` field in the body today — check that field, not only the status code."},"429":{"description":"Daily tier limit reached for this bucket."}}}}}}