{"openapi":"3.1.0","info":{"title":"News Bias Analyzer","description":"Fetches current headlines, searches news, extracts clean article text, and draws bias charts (political lean vs tone) and word clouds. Charts are attached as a zip (openaiFileResponse) so ChatGPT can display them with Code Interpreter.","version":"2.0.0"},"servers":[{"url":"https://cybrix.ai/newsbiasanalyzer","description":"News Bias Analyzer API"}],"paths":{"/health":{"get":{"tags":["meta"],"summary":"Service health","operationId":"health","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"x-openai-isConsequential":false}},"/headlines":{"post":{"tags":["news"],"summary":"Current top headlines by country, category or keyword","operationId":"get_headlines","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HeadlinesRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"x-openai-isConsequential":false}},"/search":{"post":{"tags":["news"],"summary":"Search news from the last 1-30 days across outlets","operationId":"search_news","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"x-openai-isConsequential":false}},"/sources":{"post":{"tags":["news"],"summary":"List available news publishers","operationId":"list_sources","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SourcesRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"x-openai-isConsequential":false}},"/article":{"post":{"tags":["news"],"summary":"Fetch an article URL and return clean text, title and byline","operationId":"read_article","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArticleRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"x-openai-isConsequential":false}},"/bias-chart":{"post":{"tags":["charts"],"summary":"Plot outlets on political lean vs tone, and/or lean bars","operationId":"create_bias_chart","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BiasChartRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"x-openai-isConsequential":false}},"/wordcloud":{"post":{"tags":["charts"],"summary":"Word cloud from a weighted word list","operationId":"create_wordcloud","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WordCloudRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"x-openai-isConsequential":false}}},"components":{"schemas":{"ArticleRequest":{"properties":{"url":{"type":"string","maxLength":2000,"title":"Url","description":"Article URL to fetch and clean."}},"type":"object","required":["url"],"title":"ArticleRequest"},"BiasChartRequest":{"properties":{"topic":{"type":"string","maxLength":90,"title":"Topic","description":"What the chart is about; used as the title."},"outlets":{"items":{"$ref":"#/components/schemas/Outlet"},"type":"array","maxItems":14,"minItems":1,"title":"Outlets"},"chart":{"type":"string","enum":["map","bars","both"],"title":"Chart","description":"map = lean vs tone, bars = lean only.","default":"both"}},"type":"object","required":["topic","outlets"],"title":"BiasChartRequest"},"HeadlinesRequest":{"properties":{"country":{"anyOf":[{"type":"string","maxLength":2},{"type":"null"}],"title":"Country","description":"2-letter code, e.g. us, gb, de."},"category":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}],"title":"Category","description":"business|entertainment|general|health|science|sports|technology"},"query":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Query","description":"Keyword filter."},"limit":{"type":"integer","maximum":50.0,"minimum":1.0,"title":"Limit","default":10}},"type":"object","title":"HeadlinesRequest"},"Outlet":{"properties":{"name":{"type":"string","maxLength":40,"title":"Name","description":"Outlet or article label."},"lean":{"type":"number","maximum":5.0,"minimum":-5.0,"title":"Lean","description":"-5 far left, 0 centre, +5 far right."},"sentiment":{"type":"number","maximum":5.0,"minimum":-5.0,"title":"Sentiment","description":"-5 very negative, 0 neutral, +5 very positive.","default":0}},"type":"object","required":["name","lean"],"title":"Outlet"},"SearchRequest":{"properties":{"query":{"type":"string","maxLength":400,"title":"Query","description":"Keywords; supports AND/OR/NOT and \"quoted phrases\"."},"language":{"anyOf":[{"type":"string","maxLength":2},{"type":"null"}],"title":"Language","description":"2-letter code, e.g. en."},"sort_by":{"type":"string","enum":["publishedAt","relevancy","popularity"],"title":"Sort By","default":"publishedAt"},"days_back":{"type":"integer","maximum":30.0,"minimum":1.0,"title":"Days Back","default":7},"domains":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}],"title":"Domains","description":"Comma-separated, e.g. bbc.co.uk,reuters.com"},"limit":{"type":"integer","maximum":50.0,"minimum":1.0,"title":"Limit","default":12}},"type":"object","required":["query"],"title":"SearchRequest"},"SourcesRequest":{"properties":{"category":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}],"title":"Category"},"language":{"anyOf":[{"type":"string","maxLength":2},{"type":"null"}],"title":"Language"},"country":{"anyOf":[{"type":"string","maxLength":2},{"type":"null"}],"title":"Country"}},"type":"object","title":"SourcesRequest"},"WordCloudRequest":{"properties":{"words":{"items":{"type":"string"},"type":"array","maxItems":600,"minItems":3,"title":"Words","description":"Repeat a word to weight it."},"title":{"anyOf":[{"type":"string","maxLength":90},{"type":"null"}],"title":"Title"}},"type":"object","required":["words"],"title":"WordCloudRequest"}}}}