KosmoKrator

data

NewsAPI CLI for AI Agents

Use the NewsAPI CLI from KosmoKrator to call NewsAPI tools headlessly, return JSON, inspect schemas, and automate workflows from coding agents, scripts, and CI.

NewsAPI CLI Setup

NewsAPI can be configured headlessly with `kosmokrator integrations:configure newsapi`.

Install, configure, and verify
# Install KosmoKrator first if it is not available on PATH.
curl -fsSL https://raw.githubusercontent.com/OpenCompanyApp/kosmokrator/main/install.sh | bash

# Configure and verify this integration.
kosmokrator integrations:configure newsapi --set api_key="$NEWSAPI_API_KEY" --enable --read allow --write ask --json
kosmokrator integrations:doctor newsapi --json
kosmokrator integrations:status --json

Credentials

Authentication type: API key api_key. Configure credentials once, then reuse the same stored profile from scripts, coding CLIs, Lua, and MCP.

KeyEnv varTypeRequiredLabel
api_key NEWSAPI_API_KEY Secret secret yes API Key

Command Patterns

The generic command is stable across every integration. The provider shortcut is shorter for humans.

Generic CLI call
kosmo integrations:call newsapi.newsapi_everything '{}' --json
Provider shortcut
kosmo integrations:newsapi newsapi_everything '{}' --json

Discovery

These commands return structured output for coding agents that need to inspect capabilities before choosing a function.

Discovery commands
kosmo integrations:docs newsapi --json
kosmo integrations:docs newsapi.newsapi_everything --json
kosmo integrations:schema newsapi.newsapi_everything --json
kosmo integrations:search "NewsAPI" --json
kosmo integrations:list --json

Automation Contexts

The same configured command surface works in these environments. The command does not change unless the host wrapper, credentials, or permissions change.

CLI Functions

Every function below can be called headlessly. Commands are highlighted, copyable, and scroll horizontally when payloads are long.

newsapi.newsapi_everything

Search across indexed news articles.

Read read
Parameters
none
Generic call
kosmo integrations:call newsapi.newsapi_everything '{}' --json
Shortcut
kosmo integrations:newsapi newsapi_everything '{}' --json

newsapi.newsapi_top_headlines

Retrieve live top and breaking headlines.

Read read
Parameters
none
Generic call
kosmo integrations:call newsapi.newsapi_top_headlines '{}' --json
Shortcut
kosmo integrations:newsapi newsapi_top_headlines '{}' --json

newsapi.newsapi_sources

List news sources available for top headlines.

Read read
Parameters
none
Generic call
kosmo integrations:call newsapi.newsapi_sources '{}' --json
Shortcut
kosmo integrations:newsapi newsapi_sources '{}' --json

Function Schemas

Use these parameter tables when building CLI payloads without calling integrations:schema first.

newsapi.newsapi_everything 0 parameters
Schema command
kosmo integrations:schema newsapi.newsapi_everything --json
ParameterTypeRequiredDescription
No parameters.
newsapi.newsapi_top_headlines 0 parameters
Schema command
kosmo integrations:schema newsapi.newsapi_top_headlines --json
ParameterTypeRequiredDescription
No parameters.
newsapi.newsapi_sources 0 parameters
Schema command
kosmo integrations:schema newsapi.newsapi_sources --json
ParameterTypeRequiredDescription
No parameters.

Permissions

Headless calls still follow the integration read/write permission policy. Configure read/write defaults with integrations:configure. Add --force only for trusted automation that should bypass that policy.