@emergentmethods/asknews-cli 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +121 -0
- package/dist/bin.js +12287 -0
- package/dist/bin.js.map +7 -0
- package/package.json +79 -0
- package/scripts/postinstall.mjs +26 -0
- package/skills/asknews-cli/SKILL.md +94 -0
- package/skills/asknews-cli/references/commands/alerts.md +135 -0
- package/skills/asknews-cli/references/commands/api-alerts.md +186 -0
- package/skills/asknews-cli/references/commands/api-analytics.md +31 -0
- package/skills/asknews-cli/references/commands/api-autofilter.md +31 -0
- package/skills/asknews-cli/references/commands/api-byok.md +72 -0
- package/skills/asknews-cli/references/commands/api-charts.md +28 -0
- package/skills/asknews-cli/references/commands/api-chat.md +108 -0
- package/skills/asknews-cli/references/commands/api-distribution.md +46 -0
- package/skills/asknews-cli/references/commands/api-forecast.md +44 -0
- package/skills/asknews-cli/references/commands/api-graph.md +41 -0
- package/skills/asknews-cli/references/commands/api-index-urls.md +32 -0
- package/skills/asknews-cli/references/commands/api-news.md +164 -0
- package/skills/asknews-cli/references/commands/api-newsletters.md +236 -0
- package/skills/asknews-cli/references/commands/api-ping.md +19 -0
- package/skills/asknews-cli/references/commands/api-profile.md +27 -0
- package/skills/asknews-cli/references/commands/api-reddit.md +34 -0
- package/skills/asknews-cli/references/commands/api-stories.md +75 -0
- package/skills/asknews-cli/references/commands/api-websearch.md +37 -0
- package/skills/asknews-cli/references/commands/api-wiki.md +33 -0
- package/skills/asknews-cli/references/commands/api.md +52 -0
- package/skills/asknews-cli/references/commands/auth.md +50 -0
- package/skills/asknews-cli/references/commands/cli.md +31 -0
- package/skills/asknews-cli/references/commands/index.md +41 -0
- package/skills/asknews-cli/references/commands/news.md +89 -0
- package/skills/asknews-cli/references/commands/reddit.md +38 -0
- package/skills/asknews-cli/references/commands/request.md +34 -0
- package/skills/asknews-cli/references/commands/research.md +73 -0
- package/skills/asknews-cli/references/commands/stories.md +74 -0
- package/skills/asknews-cli/references/commands/web.md +40 -0
- package/skills/asknews-cli/references/commands/wiki.md +39 -0
- package/skills/asknews-cli/references/task-recipes.md +164 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# api charts
|
|
2
|
+
|
|
3
|
+
Generated from AskNews API 0.24.95.
|
|
4
|
+
|
|
5
|
+
## Operations
|
|
6
|
+
|
|
7
|
+
### `asknews api charts create-charts-endpoint`
|
|
8
|
+
|
|
9
|
+
Create charts.
|
|
10
|
+
|
|
11
|
+
- Request: `POST /v1/chat/charts`
|
|
12
|
+
- Operation ID: `create_charts_endpoint`
|
|
13
|
+
- Safety: `high-cost`
|
|
14
|
+
|
|
15
|
+
**Request body fields:**
|
|
16
|
+
|
|
17
|
+
| Option | Type | Required | Description |
|
|
18
|
+
| --- | --- | --- | --- |
|
|
19
|
+
| `--query` | string | yes | The chart query to create |
|
|
20
|
+
|
|
21
|
+
Use direct kebab-case body options, `--body '{...}'`, or `--body @request.json`.
|
|
22
|
+
Direct body options override values supplied through `--body`.
|
|
23
|
+
|
|
24
|
+
## Global options
|
|
25
|
+
|
|
26
|
+
All commands support `--output human|table|json|jsonl|yaml`, `--json`, API/auth URL
|
|
27
|
+
overrides, request timeout, and color control. Result data is written to stdout; diagnostics
|
|
28
|
+
are written to stderr.
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
# api chat
|
|
2
|
+
|
|
3
|
+
Generated from AskNews API 0.24.95.
|
|
4
|
+
|
|
5
|
+
## Operations
|
|
6
|
+
|
|
7
|
+
### `asknews api chat deep-news`
|
|
8
|
+
|
|
9
|
+
Deep research into real-time news, archive news, and Google.
|
|
10
|
+
|
|
11
|
+
- Request: `POST /v1/chat/deepnews`
|
|
12
|
+
- Operation ID: `deep_news`
|
|
13
|
+
- Safety: `high-cost`
|
|
14
|
+
|
|
15
|
+
**Request body fields:**
|
|
16
|
+
|
|
17
|
+
| Option | Type | Required | Description |
|
|
18
|
+
| --- | --- | --- | --- |
|
|
19
|
+
| `--messages` | array<object> | yes | The messages to send to DeepNews. Each message should have 'role' and 'content' keys. Use this to specify what research/monitoring task DeepNews should perform. The 'content' for the final 'user' message should be your Alert query. |
|
|
20
|
+
| `--model` | string or null | no | The model to use for DeepNews research. Defaults to claude-sonnet-4-6. Default: `"claude-sonnet-4-6"`. |
|
|
21
|
+
| `--filter-params` | object or null | no | Filter parameters to apply to the AskNews search within DeepNews. |
|
|
22
|
+
| `--search-depth` | integer | no | The search depth for deep research. Higher values mean more thorough research. Default: `2`. |
|
|
23
|
+
| `--max-depth` | integer | no | The maximum research depth allowed. Default: `6`. |
|
|
24
|
+
| `--sources` | string or array | no | Which data sources DeepNews should use. Can be a single source or a list. Available sources are: asknews, google, graph, wiki, x, reddit, charts, email, full_text_discovery Default: `"asknews"`. |
|
|
25
|
+
| `--inline-citations` | string | no | How to format inline citations in the response. Defaults to: markdown_link. Available options: markdown_link, numbered, none Choices: markdown_link, numbered, none. Default: `"markdown_link"`. |
|
|
26
|
+
| `--start-citation-number` | integer | no | Starting number for inline citations. Offsets fetched source citation keys. Useful if you are providing the agent outside sources with numbered citation keys. Default: `1`. |
|
|
27
|
+
| `--return-sources` | boolean | no | Whether return a list of sources used by the agent. Default: `true`. |
|
|
28
|
+
| `--only-cited-sources` | boolean | no | Whether to return only of sources that are cited/referenced in the generated response content. Default: `true`. |
|
|
29
|
+
| `--append-references` | boolean | no | Whether to append a 'Cited Articles' section at the end of the response. Default: `true`. |
|
|
30
|
+
| `--journalist-mode` | boolean | no | Whether to use journalist mode for more factual reporting. Default: `true`. |
|
|
31
|
+
| `--conversational-awareness` | boolean | no | Whether to use conversational awareness. Default: `true`. |
|
|
32
|
+
| `--include-entities` | boolean | no | Whether to provide extracted entities to the agent. Default: `true`. |
|
|
33
|
+
| `--include-graphs` | boolean | no | Whether to provide knowledge graphs to the agent Default: `false`. |
|
|
34
|
+
| `--include-coordinates` | boolean | no | Whether to provide geo coordinates to the agent. Default: `false`. |
|
|
35
|
+
| `--asknews-watermark` | boolean | no | Append 'Generated by AskNews AI' watermark Default: `true`. |
|
|
36
|
+
| `--stream` | boolean | no | Whether to stream the response as server-sent events. Default: `false`. |
|
|
37
|
+
| `--stop` | string or array or null | no | Sequence(s) where the model will stop generating further tokens. |
|
|
38
|
+
| `--temperature` | number | no | The temperature of the DeepNews agent model. Controls randomness in the output. Higher values (e.g., 1.0) make output more random, lower values (e.g., 0.1) make it more deterministic. Default: `0.9`. |
|
|
39
|
+
| `--top-p` | number | no | Nucleus sampling parameter. Only tokens with cumulative probability up to top_p are considered. Default: `1`. |
|
|
40
|
+
| `--n` | integer | no | Number of completions to generate. Default: `1`. |
|
|
41
|
+
| `--max-tokens` | integer | no | Maximum number of tokens to generate in the response. Default: `9999`. |
|
|
42
|
+
| `--presence-penalty` | integer | no | Penalizes new tokens based on whether they appear in the text so far, encouraging new topics. Default: `0`. |
|
|
43
|
+
| `--frequency-penalty` | integer | no | Penalizes new tokens based on their frequency in the text so far, reducing repetition. Default: `0`. |
|
|
44
|
+
| `--user` | string or null | no | A unique identifier for the end-user, useful for tracking and abuse detection. |
|
|
45
|
+
| `--thread-id` | string or null | no | ID of an existing thread to continue the conversation. |
|
|
46
|
+
| `--max-parallel-tool-calls` | integer | no | Maximum number of parallel tool calls (e.g., searches) the agent can make during generation. Higher values may speed up responses, but may reduce on-the-fly adaptivity. Default: `1`. |
|
|
47
|
+
| `--engine` | string | no | The engine to use for the DeepNews agent. 'v1' is deprecated while 'v1.5' is our next-generation research agent with access to more tools, better contextual understanding, and improved reasoning capabilities.'v1.5' streams thinking and tool use using tags <think> </think>, <tool_a> </tool_a> Meanwhile, 'v2.0' is the same underlying agent as 'v1.5', but the thinking and tool use chunks are typed content_block_delta's streamed between content_block_start and content_block_stop events, mimicking Anthropic's approach to streaming tool use/thinking events. Choices: v1, v1.5, v2.0. Default: `"v1.5"`. |
|
|
48
|
+
| `--enable-source-pruning` | boolean | no | Whether to enable source pruning, which removes sources that are deemed irrelevant to the final response. This can help reduce noise in the sources and improve the quality of the response, but may also remove some relevant sources if not used carefully. Default: `false`. |
|
|
49
|
+
| `--cutoff-datetime` | string or null | no | The knowledge cutoff datetime for the agent prompt and all tool calls. |
|
|
50
|
+
|
|
51
|
+
Use direct kebab-case body options, `--body '{...}'`, or `--body @request.json`.
|
|
52
|
+
Direct body options override values supplied through `--body`.
|
|
53
|
+
|
|
54
|
+
### `asknews api chat get-chat-completions`
|
|
55
|
+
|
|
56
|
+
Get the chat completions for a given user message. This endpoint follows the
|
|
57
|
+
OpenAI API spec. It includes a couple extra params, which include:
|
|
58
|
+
|
|
59
|
+
- **journalist_mode**: Whether to activate an auto prompt that is more keen on AP styling,
|
|
60
|
+
citations, and fair reporting. Setting to false, you get a vanilla LLM with the news pre
|
|
61
|
+
added to the system prompt. No other prompting.
|
|
62
|
+
- **inline_citations**: Decides how you want the bot to cite sources. It can use brackets,
|
|
63
|
+
or it can also include the markdown with URL automatically.
|
|
64
|
+
- **asknews_watermark**: Whether to include the AskNews watermark in the response.
|
|
65
|
+
|
|
66
|
+
- Request: `POST /v1/openai/chat/completions`
|
|
67
|
+
- Operation ID: `get_chat_completions`
|
|
68
|
+
- Safety: `high-cost`
|
|
69
|
+
|
|
70
|
+
**Request body fields:**
|
|
71
|
+
|
|
72
|
+
| Option | Type | Required | Description |
|
|
73
|
+
| --- | --- | --- | --- |
|
|
74
|
+
| `--model` | string | no | Default: `"gpt-4o-mini"`. |
|
|
75
|
+
| `--messages` | array<object> | yes | |
|
|
76
|
+
| `--temperature` | number | no | Default: `0.9`. |
|
|
77
|
+
| `--top-p` | number | no | Default: `1`. |
|
|
78
|
+
| `--n` | integer | no | Default: `1`. |
|
|
79
|
+
| `--stream` | boolean | no | Default: `false`. |
|
|
80
|
+
| `--stop` | string or array or null | no | |
|
|
81
|
+
| `--max-tokens` | integer | no | Default: `9999`. |
|
|
82
|
+
| `--presence-penalty` | integer | no | Default: `0`. |
|
|
83
|
+
| `--frequency-penalty` | integer | no | Default: `0`. |
|
|
84
|
+
| `--thread-id` | string or null | no | |
|
|
85
|
+
| `--user` | string or null | no | |
|
|
86
|
+
| `--inline-citations` | string | no | Choices: numbered, markdown_link, none. Default: `"markdown_link"`. |
|
|
87
|
+
| `--append-references` | boolean | no | Default: `true`. |
|
|
88
|
+
| `--journalist-mode` | boolean | no | Default: `true`. |
|
|
89
|
+
| `--asknews-watermark` | boolean | no | Default: `true`. |
|
|
90
|
+
| `--conversational-awareness` | boolean | no | Default: `true`. |
|
|
91
|
+
| `--filter-params` | object or null | no | |
|
|
92
|
+
|
|
93
|
+
Use direct kebab-case body options, `--body '{...}'`, or `--body @request.json`.
|
|
94
|
+
Direct body options override values supplied through `--body`.
|
|
95
|
+
|
|
96
|
+
### `asknews api chat list-deepnews-models`
|
|
97
|
+
|
|
98
|
+
List the available DeepNews models with their public type (standard/lite/advanced).
|
|
99
|
+
|
|
100
|
+
- Request: `GET /v1/chat/deepnews-models`
|
|
101
|
+
- Operation ID: `list_deepnews_models`
|
|
102
|
+
- Safety: `read-only`
|
|
103
|
+
|
|
104
|
+
## Global options
|
|
105
|
+
|
|
106
|
+
All commands support `--output human|table|json|jsonl|yaml`, `--json`, API/auth URL
|
|
107
|
+
overrides, request timeout, and color control. Result data is written to stdout; diagnostics
|
|
108
|
+
are written to stderr.
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# api distribution
|
|
2
|
+
|
|
3
|
+
Generated from AskNews API 0.24.95.
|
|
4
|
+
|
|
5
|
+
## Operations
|
|
6
|
+
|
|
7
|
+
### `asknews api distribution find-domains`
|
|
8
|
+
|
|
9
|
+
Find domains with optional filters.
|
|
10
|
+
|
|
11
|
+
- Request: `GET /v1/distribution/domains`
|
|
12
|
+
- Operation ID: `find_domains`
|
|
13
|
+
- Safety: `read-only`
|
|
14
|
+
|
|
15
|
+
**Options:**
|
|
16
|
+
|
|
17
|
+
| Option | Description |
|
|
18
|
+
| --- | --- |
|
|
19
|
+
| `--page` | Page number for pagination Location: query. Type: integer. Optional. Default: `1`. Minimum: 1. |
|
|
20
|
+
| `--per-page` | Number of items per page Location: query. Type: integer. Optional. Default: `10`. Minimum: 1. Maximum: 100. |
|
|
21
|
+
| `--names` | List of domain names to filter by Location: query. Type: string. Optional. |
|
|
22
|
+
| `--is-tollbit` | Filter by tollbit status Location: query. Type: string. Optional. |
|
|
23
|
+
| `--publisher` | Filter by publisher status Location: query. Type: string. Optional. |
|
|
24
|
+
|
|
25
|
+
### `asknews api distribution top-n-domains-by-hits`
|
|
26
|
+
|
|
27
|
+
Get the top N domains by hits.
|
|
28
|
+
|
|
29
|
+
- Request: `GET /v1/distribution/domains/top_n`
|
|
30
|
+
- Operation ID: `top_n_domains_by_hits`
|
|
31
|
+
- Safety: `read-only`
|
|
32
|
+
|
|
33
|
+
**Options:**
|
|
34
|
+
|
|
35
|
+
| Option | Description |
|
|
36
|
+
| --- | --- |
|
|
37
|
+
| `--limit` | Number of top domains to return Location: query. Type: integer. Optional. Default: `10`. Minimum: 1. Maximum: 100. |
|
|
38
|
+
| `--start-date` | Start date to filter by (timestamp in seconds since epoch) Location: query. Type: string. Optional. |
|
|
39
|
+
| `--end-date` | End date to filter by (timestamp in seconds since epoch) Location: query. Type: string. Optional. |
|
|
40
|
+
| `--names` | List of domain names to filter by Location: query. Type: string. Optional. |
|
|
41
|
+
|
|
42
|
+
## Global options
|
|
43
|
+
|
|
44
|
+
All commands support `--output human|table|json|jsonl|yaml`, `--json`, API/auth URL
|
|
45
|
+
overrides, request timeout, and color control. Result data is written to stdout; diagnostics
|
|
46
|
+
are written to stderr.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# api forecast
|
|
2
|
+
|
|
3
|
+
Generated from AskNews API 0.24.95.
|
|
4
|
+
|
|
5
|
+
## Operations
|
|
6
|
+
|
|
7
|
+
### `asknews api forecast get-forecast`
|
|
8
|
+
|
|
9
|
+
Make an expert forecast for a news event.
|
|
10
|
+
|
|
11
|
+
This endpoint reaches into the news archive, looking back `lookback` days to
|
|
12
|
+
extract the most relevant news articles, building a timeline of events, and
|
|
13
|
+
then making an expert forecast.
|
|
14
|
+
|
|
15
|
+
This endpoint is more expensive than the search endpoint, it is calling
|
|
16
|
+
gpt-4o or claude 3-5 on approx 15k tokens to build the forecast.
|
|
17
|
+
This endpoint counts toward "deep" calls in the billing system.
|
|
18
|
+
|
|
19
|
+
It returns the forecast, the reasoning, and the sources.
|
|
20
|
+
|
|
21
|
+
- Request: `GET /v1/chat/forecast`
|
|
22
|
+
- Operation ID: `get_forecast`
|
|
23
|
+
- Safety: `high-cost`
|
|
24
|
+
|
|
25
|
+
**Options:**
|
|
26
|
+
|
|
27
|
+
| Option | Description |
|
|
28
|
+
| --- | --- |
|
|
29
|
+
| `--query` | The requested forecast. Location: query. Type: string. Required. |
|
|
30
|
+
| `--lookback` | The number of days to look back for the forecast. Location: query. Type: integer. Optional. Default: `14`. |
|
|
31
|
+
| `--articles-to-use` | The total number of relevant articles to be extracted from the news archive and used for the forecast. Location: query. Type: integer. Optional. Default: `15`. |
|
|
32
|
+
| `--method` | Method to use for the context search Currently only 'kw' is supported. Location: query. Type: string. Optional. Default: `"kw"`. |
|
|
33
|
+
| `--model` | The model to use for the forecast. Location: query. Type: string. Optional. Choices: gpt-4o, gpt-4o-mini, gpt-4.1-2025-04-14, claude-3-5-sonnet-latest, claude-3-5-sonnet-20240620, claude-sonnet-4-20250514, claude-opus-4-20250514, claude-sonnet-4-5-20250929, claude-opus-4-6, claude-sonnet-4-6, o1-mini, o3-mini, o3. Default: `"gpt-4.1-2025-04-14"`. |
|
|
34
|
+
| `--cutoff-date` | The cutoff date for the forecast. String format is 'YYYY-MM-DD-HH:MM'. This is useful for backtesting forecasts. Location: query. Type: string. Optional. |
|
|
35
|
+
| `--use-reddit` | Whether to use Reddit data for the forecast.enterprise customers only. Location: query. Type: boolean. Optional. Default: `false`. |
|
|
36
|
+
| `--additional-context` | Additional context to use for the forecast. Location: query. Type: string. Optional. |
|
|
37
|
+
| `--web-search` | Whether to run a live web search and include results in the forecast. enterprise customers only. Location: query. Type: boolean. Optional. Default: `false`. |
|
|
38
|
+
| `--expert` | The type of expert to use for the forecast. Location: query. Type: string. Optional. Choices: general, sports. Default: `"general"`. |
|
|
39
|
+
|
|
40
|
+
## Global options
|
|
41
|
+
|
|
42
|
+
All commands support `--output human|table|json|jsonl|yaml`, `--json`, API/auth URL
|
|
43
|
+
overrides, request timeout, and color control. Result data is written to stdout; diagnostics
|
|
44
|
+
are written to stderr.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# api graph
|
|
2
|
+
|
|
3
|
+
Generated from AskNews API 0.24.95.
|
|
4
|
+
|
|
5
|
+
## Operations
|
|
6
|
+
|
|
7
|
+
### `asknews api graph build-graph`
|
|
8
|
+
|
|
9
|
+
Explore our mega-news-knowledge-graph at which ever level of resolution you need.
|
|
10
|
+
|
|
11
|
+
Fully disambiguated and ready to be used in any downstream application.
|
|
12
|
+
|
|
13
|
+
Pass a natural language query to get a graph of the latest news. Add parameters
|
|
14
|
+
to build a graph from our archive, filter your graph by language, country, reporting voice,
|
|
15
|
+
sentiment, provocative levels, and much more.
|
|
16
|
+
|
|
17
|
+
- Request: `POST /v1/news/graph`
|
|
18
|
+
- Operation ID: `build_graph`
|
|
19
|
+
- Safety: `high-cost`
|
|
20
|
+
|
|
21
|
+
**Request body fields:**
|
|
22
|
+
|
|
23
|
+
| Option | Type | Required | Description |
|
|
24
|
+
| --- | --- | --- | --- |
|
|
25
|
+
| `--query` | string | no | Query string that can be any phrase, keyword, question, or paragraph. If method='nl', then this will be used as a natural language query. If method='kw', then this will be used as a direct keyword query. Default: `""`. |
|
|
26
|
+
| `--return-articles` | boolean | no | Whether to return articles or not. Default: `false`. |
|
|
27
|
+
| `--min-cluster-probability` | number | no | Minimum cluster probability to use for disambiguation Default: `0.9`. |
|
|
28
|
+
| `--geo-disambiguation` | boolean | no | Whether to use geo disambiguation or not. Default: `false`. |
|
|
29
|
+
| `--filter-params` | object or null | no | All parameters available on the search_news endpoint located here: https://docs.asknews.app/en/reference#get-/v1/news/search |
|
|
30
|
+
| `--constrained-disambiguations` | array or null | no | Disambiguation correction parameters. |
|
|
31
|
+
| `--docs-upload` | array or null | no | Document upload parameters. |
|
|
32
|
+
| `--visualize-with` | string or null | no | Request a visualization graph returned in the response. |
|
|
33
|
+
|
|
34
|
+
Use direct kebab-case body options, `--body '{...}'`, or `--body @request.json`.
|
|
35
|
+
Direct body options override values supplied through `--body`.
|
|
36
|
+
|
|
37
|
+
## Global options
|
|
38
|
+
|
|
39
|
+
All commands support `--output human|table|json|jsonl|yaml`, `--json`, API/auth URL
|
|
40
|
+
overrides, request timeout, and color control. Result data is written to stdout; diagnostics
|
|
41
|
+
are written to stderr.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# api index-urls
|
|
2
|
+
|
|
3
|
+
Generated from AskNews API 0.24.95.
|
|
4
|
+
|
|
5
|
+
## Operations
|
|
6
|
+
|
|
7
|
+
### `asknews api index-urls index-urls`
|
|
8
|
+
|
|
9
|
+
Index a list of news article URLs.
|
|
10
|
+
|
|
11
|
+
- Request: `POST /v1/news/index_urls`
|
|
12
|
+
- Operation ID: `index_urls`
|
|
13
|
+
- Safety: `mutating`
|
|
14
|
+
|
|
15
|
+
**Request body fields:**
|
|
16
|
+
|
|
17
|
+
| Option | Type | Required | Description |
|
|
18
|
+
| --- | --- | --- | --- |
|
|
19
|
+
| `--start-time` | string | yes | Format: date-time. |
|
|
20
|
+
| `--end-time` | string | yes | Format: date-time. |
|
|
21
|
+
| `--urls` | array<object> | yes | |
|
|
22
|
+
|
|
23
|
+
Use direct kebab-case body options, `--body '{...}'`, or `--body @request.json`.
|
|
24
|
+
Direct body options override values supplied through `--body`.
|
|
25
|
+
|
|
26
|
+
This operation requires confirmation and `--yes` in non-interactive use.
|
|
27
|
+
|
|
28
|
+
## Global options
|
|
29
|
+
|
|
30
|
+
All commands support `--output human|table|json|jsonl|yaml`, `--json`, API/auth URL
|
|
31
|
+
overrides, request timeout, and color control. Result data is written to stdout; diagnostics
|
|
32
|
+
are written to stderr.
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
# api news
|
|
2
|
+
|
|
3
|
+
Generated from AskNews API 0.24.95.
|
|
4
|
+
|
|
5
|
+
## Operations
|
|
6
|
+
|
|
7
|
+
### `asknews api news get-article`
|
|
8
|
+
|
|
9
|
+
Get a single article given a UUID.
|
|
10
|
+
|
|
11
|
+
- Request: `GET /v1/news/{article_id}`
|
|
12
|
+
- Operation ID: `get_article`
|
|
13
|
+
- Safety: `read-only`
|
|
14
|
+
|
|
15
|
+
**Options:**
|
|
16
|
+
|
|
17
|
+
| Option | Description |
|
|
18
|
+
| --- | --- |
|
|
19
|
+
| `--article-id` | Article ID to retrieve Location: path. Type: string. Required. |
|
|
20
|
+
|
|
21
|
+
### `asknews api news get-articles`
|
|
22
|
+
|
|
23
|
+
Get articles given a list of UUIDs.
|
|
24
|
+
|
|
25
|
+
- Request: `GET /v1/news`
|
|
26
|
+
- Operation ID: `get_articles`
|
|
27
|
+
- Safety: `read-only`
|
|
28
|
+
|
|
29
|
+
**Options:**
|
|
30
|
+
|
|
31
|
+
| Option | Description |
|
|
32
|
+
| --- | --- |
|
|
33
|
+
| `--article-ids` | Article UUIDs to fetch. Location: query. Type: array<string>. Required. |
|
|
34
|
+
| `--full-text` | Whether to return the full text of the articles. Location: query. Type: boolean. Optional. Default: `false`. |
|
|
35
|
+
|
|
36
|
+
### `asknews api news get-index-counts`
|
|
37
|
+
|
|
38
|
+
This endpoint is primarly used for the publisher dashboard, to
|
|
39
|
+
show the number of articles indexed per source.
|
|
40
|
+
|
|
41
|
+
- Request: `GET /v1/index_counts`
|
|
42
|
+
- Operation ID: `get_index_counts`
|
|
43
|
+
- Safety: `read-only`
|
|
44
|
+
|
|
45
|
+
**Options:**
|
|
46
|
+
|
|
47
|
+
| Option | Description |
|
|
48
|
+
| --- | --- |
|
|
49
|
+
| `--start-datetime` | Start timestamp to filter by Location: query. Type: string. Optional. |
|
|
50
|
+
| `--end-datetime` | End timestamp to filter by Location: query. Type: string. Optional. |
|
|
51
|
+
| `--domains` | Domain or list of domains to get indexing counts for Location: query. Type: string. Optional. |
|
|
52
|
+
| `--sampling` | Sampling to use Location: query. Type: string. Optional. Choices: 5m, 1h, 12h, 1d, 1w, 1m. Default: `"1d"`. |
|
|
53
|
+
| `--time-filter` | Control which date type to filter on. 'crawl_date' is the date the article was crawled, 'pub_date' is the date the article was published. Location: query. Type: string. Optional. Choices: crawl_date, pub_date. Default: `"pub_date"`. |
|
|
54
|
+
| `--categories` | Categories of news to filter on Location: query. Type: string. Optional. |
|
|
55
|
+
| `--provocative` | Filter articles based on how provocative they are deemed based on the use of provocative language and emotional vocabulary. Location: query. Type: string. Optional. |
|
|
56
|
+
| `--reporting-voice` | Type of reporting voice to filer by. Location: query. Type: string. Optional. |
|
|
57
|
+
| `--bad-domain-url` | blacklist of domains that must be excluded from resultsThis can be a single domain url or a list of domain urls. Location: query. Type: string. Optional. |
|
|
58
|
+
| `--page-rank` | maximum allowed pagerank for returned articles Location: query. Type: string. Optional. |
|
|
59
|
+
| `--string-guarantee` | If defined, the search will only occur on articles that contain this string. Location: query. Type: string. Optional. |
|
|
60
|
+
| `--string-guarantee-op` | Operator to use for string guarantee. Location: query. Type: string. Optional. Choices: AND, OR. Default: `"AND"`. |
|
|
61
|
+
| `--reverse-string-guarantee` | If defined, the search will only occur on articles that do not contain this string. Location: query. Type: string. Optional. |
|
|
62
|
+
| `--entity-guarantee` | Entity guarantee to filter by. This is a list of strings, where each string includes entity type and entity value separated by a colon. The first element is the entity type and the second element is the entity value. For example ['Location:Paris', 'Person:John'] Location: query. Type: string. Optional. |
|
|
63
|
+
| `--entity-guarantee-op` | Operator to use for entity guarantee. Location: query. Type: string. Optional. Choices: AND, OR. Default: `"OR"`. |
|
|
64
|
+
| `--languages` | Languages to filter by. This is the two-letter 'set 1' of the ISO 639-1 standard. For example: English is 'en'. Location: query. Type: string. Optional. |
|
|
65
|
+
| `--countries` | Source countries to filter by (this is only for the publisher location, not the locations mentioned in articles. For Locations mentioned in articles, refer to entity_guarantee), countries must be the two-letter ISO country codeFor example: United States is 'US', France is 'FR', Sweden is 'SE'. Location: query. Type: string. Optional. |
|
|
66
|
+
| `--countries-blacklist` | Source countries to blacklist from search (this is only for the publisher location, not the locations mentioned in articles. For Locations mentioned in articles, refer to reverse_entity_guarantee), countries must be the two-letter ISO country codeFor example: United States is 'US', France is 'FR', Sweden is 'SE'. Location: query. Type: string. Optional. |
|
|
67
|
+
| `--continents` | Continents to filter by Location: query. Type: string. Optional. |
|
|
68
|
+
| `--sentiment` | Sentiment to filter news articles by. Location: query. Type: string. Optional. |
|
|
69
|
+
|
|
70
|
+
### `asknews api news get-sources-report`
|
|
71
|
+
|
|
72
|
+
This endpoint is primarly used for transparency and monitoring the
|
|
73
|
+
diversity of the data.
|
|
74
|
+
|
|
75
|
+
Visualized at `https://asknews.app/transparency`.
|
|
76
|
+
|
|
77
|
+
Get the distribution of sources/languages/countries underlying AskNews content.
|
|
78
|
+
|
|
79
|
+
- Request: `GET /v1/sources`
|
|
80
|
+
- Operation ID: `get_sources_report`
|
|
81
|
+
- Safety: `read-only`
|
|
82
|
+
|
|
83
|
+
**Options:**
|
|
84
|
+
|
|
85
|
+
| Option | Description |
|
|
86
|
+
| --- | --- |
|
|
87
|
+
| `--n-points` | Number of points to return Location: query. Type: integer. Optional. Default: `100`. |
|
|
88
|
+
| `--start-timestamp` | Start timestamp to filter by Location: query. Type: string. Optional. |
|
|
89
|
+
| `--end-timestamp` | End timestamp to filter by Location: query. Type: string. Optional. |
|
|
90
|
+
| `--metric` | Metric to filter by Location: query. Type: string. Optional. Choices: duplication, countries_diversity, languages_diversity, sources_diversity, bucket_loss. Default: `"countries_diversity"`. |
|
|
91
|
+
| `--sampling` | Sampling to use Location: query. Type: string. Optional. Choices: 5m, 1h, 4h, 1d. Default: `"1h"`. |
|
|
92
|
+
|
|
93
|
+
### `asknews api news search-news`
|
|
94
|
+
|
|
95
|
+
Search for any news, up to the last 5 minutes or in our extensive historical archive
|
|
96
|
+
filled with 100s of millions of articles.
|
|
97
|
+
|
|
98
|
+
Geared toward low-latency applications, where time is of the essence. For example, this
|
|
99
|
+
endpoint is commonly used for quickly getting news context for an LLM.
|
|
100
|
+
|
|
101
|
+
This endpoint is also commonly used for synthetic data curation. For example, say you
|
|
102
|
+
are fine-tuning a model for sports. You could filter with `classification="Sports"`
|
|
103
|
+
and build a dataset of sports articles.
|
|
104
|
+
|
|
105
|
+
News articles come with an abundance of valuable metadata, including full summaries, sentiment,
|
|
106
|
+
entities, reporting voice, page rank, language, and much much more.
|
|
107
|
+
|
|
108
|
+
An example of this data in action can be found and interacted with at `https://asknews.app/chat`
|
|
109
|
+
|
|
110
|
+
- Request: `GET /v1/news/search`
|
|
111
|
+
- Operation ID: `search_news`
|
|
112
|
+
- Safety: `read-only`
|
|
113
|
+
|
|
114
|
+
**Options:**
|
|
115
|
+
|
|
116
|
+
| Option | Description |
|
|
117
|
+
| --- | --- |
|
|
118
|
+
| `--query` | Query string that can be any phrase, keyword, question, or paragraph. If method='nl', then this will be used as a natural language query. If method='kw', then this will be used as a direct keyword query. This is not required, if it is not passed, then the search is based on the remaining filters only. Location: query. Type: string. Optional. Default: `""`. |
|
|
119
|
+
| `--n-articles` | Number of articles to return Location: query. Type: integer. Optional. Default: `10`. Maximum: 101. |
|
|
120
|
+
| `--start-timestamp` | Timestamp to start search from Location: query. Type: string. Optional. |
|
|
121
|
+
| `--end-timestamp` | Timestamp to end search at Location: query. Type: string. Optional. |
|
|
122
|
+
| `--time-filter` | Control which date type to filter on. 'crawl_date' is the date the article was crawled, 'pub_date' is the date the article was published. Location: query. Type: string. Optional. Choices: crawl_date, pub_date. Default: `"crawl_date"`. |
|
|
123
|
+
| `--return-type` | Type of return value. 'string' means that the return is prompt-optimized and ready to be immediately injected into any prompt. 'dicts' means that the return is a structured dictionary, containing additional metadata (like a classic news api). Can be 'string' or 'dicts', or 'both'. 'string' guarantees the lowest-latency response 'dicts' requires more I/O, therefore increases latency (very slightly, depending on your network connection). Location: query. Type: string. Optional. Choices: string, dicts, both. Default: `"dicts"`. |
|
|
124
|
+
| `--historical` | Search on archive of historical news. Defaults to False, meaning that the search will only look through the most recent news (48 hours) Location: query. Type: boolean. Optional. Default: `false`. |
|
|
125
|
+
| `--method` | Method to use for searching. 'nl' means Natural Language, which is a string that can be any phrase, keyword, question, or paragraph that will be used for semantic search on the news. 'kw' means Keyword, which can also be any keyword(s), phrase, or paragraph, however the search is a direct keyword search on the database. 'both' means both methods will be used and results will be ranked according to IRR. 'both' may reduce latency by 10 pct in exchange for improved accuracy. Location: query. Type: string. Optional. Choices: nl, kw, both. Default: `"kw"`. |
|
|
126
|
+
| `--similarity-score-threshold` | Similarity score threshold to determine which articles to return. Lower means less similar results are allowed. Location: query. Type: number. Optional. Default: `0.5`. |
|
|
127
|
+
| `--offset` | Offset for pagination. The n_articles is your page size, while your offset is the number of articles to skip to get to your page of interest. For example, if you want to get page 3 for n_article page size of 10, you would set offset to 20. Location: query. Type: string. Optional. Default: `0`. |
|
|
128
|
+
| `--categories` | Categories of news to filter on Location: query. Type: array<string>. Optional. |
|
|
129
|
+
| `--doc-start-delimiter` | Document start delimiter for string return. Location: query. Type: string. Optional. Default: `"<doc>"`. |
|
|
130
|
+
| `--doc-end-delimiter` | Document end delimiter for string return. Location: query. Type: string. Optional. Default: `"</doc>"`. |
|
|
131
|
+
| `--provocative` | Filter articles based on how provocative they are deemed based on the use of provocative language and emotional vocabulary. Location: query. Type: string. Optional. Choices: unknown, low, medium, high, all. |
|
|
132
|
+
| `--reporting-voice` | Type of reporting voice to filer by. Location: query. Type: string. Optional. |
|
|
133
|
+
| `--domain-url` | filter by domain url of interest. This can be a single domain or a list of domains. For example, 'npr.org' or ['nature.com', 'npr.org'] Location: query. Type: string. Optional. |
|
|
134
|
+
| `--bad-domain-url` | blacklist of domains that must be excluded from resultsThis can be a single domain url or a list of domain urls. Location: query. Type: string. Optional. |
|
|
135
|
+
| `--page-rank` | Maximum allowed page rank for returned articles. Location: query. Type: string. Optional. |
|
|
136
|
+
| `--diversify-sources` | Ensure that the return set of articles are selected from diverse sources. This adds latency to the search, but attempts to balance the representation of sources by country and source origins. In summary, a net is cast around your search, then the diversity of sources is analyzed, and your final result matches the large net diversity distribution. This means that your search accuracy is reduced, but you gain more diverse perspectives. Location: query. Type: boolean. Optional. Default: `false`. |
|
|
137
|
+
| `--strategy` | Strategy to use for searching. 'latest news' automatically setsmethod='nl', historical=False, and looks within the past 24 hours. 'news knowledge' automatically sets method='kw', historical=True, and looks within the past 60 days. 'news knowledge' will increase latency due to the larger search space in the archive. Use 'default' if you want to control start_timestamp, end_timestamp, historical, and method. Location: query. Type: string. Optional. Choices: latest news, news knowledge, default. Default: `"default"`. |
|
|
138
|
+
| `--hours-back` | Can be set to easily control the look back on the search. This is the same as controlling the 'start_timestamp' parameter. The difference is that this is not a timestamp, it is the number of hours back to look from the current time. Defaults to 24 hours. Location: query. Type: integer. Optional. Default: `24`. |
|
|
139
|
+
| `--string-guarantee` | If defined, the search will only occur on articles that contain strings in this list. Location: query. Type: string. Optional. |
|
|
140
|
+
| `--string-guarantee-op` | Operator to use for string guarantee list. Location: query. Type: string. Optional. Choices: AND, OR. Default: `"AND"`. |
|
|
141
|
+
| `--reverse-string-guarantee` | If defined, the search will only occur on articles that do not contain strings in this list. Location: query. Type: string. Optional. |
|
|
142
|
+
| `--entity-guarantee` | Entity guarantee to filter by. This is a list of strings, where each string includes entity type and entity value separated by a colon. The first element is the entity type and the second element is the entity value. For example ['Location:Paris', 'Person:John'] Location: query. Type: string. Optional. |
|
|
143
|
+
| `--reverse-entity-guarantee` | Reverse entity guarantee to filter by. This is a list of strings, where each string includes entity type and entity value separated by a colon. The first element is the entity type and the second element is the entity value. For example ['Location:Paris', 'Person:John'] Location: query. Type: string. Optional. |
|
|
144
|
+
| `--entity-guarantee-op` | Operator to use for entity guarantee list. Location: query. Type: string. Optional. Choices: AND, OR. Default: `"OR"`. |
|
|
145
|
+
| `--return-graphs` | Return graphs for the articles. Only available to Analyst tier and above. Location: query. Type: boolean. Optional. Default: `false`. |
|
|
146
|
+
| `--return-geo` | Return GeoCoordinates associated with locations discussed inside the articles. Only available to Analyst tier and above. Location: query. Type: boolean. Optional. Default: `false`. |
|
|
147
|
+
| `--languages` | Languages to filter by. This is the two-letter 'set 1' of the ISO 639-1 standard. For example: English is 'en'. Location: query. Type: string. Optional. |
|
|
148
|
+
| `--countries` | Source countries to filter by (this is only for the publisher location, not the locations mentioned in articles. For Locations mentioned in articles, refer to entity_guarantee), countries must be the two-letter ISO country codeFor example: United States is 'US', France is 'FR', Sweden is 'SE'. Location: query. Type: string. Optional. |
|
|
149
|
+
| `--countries-blacklist` | Source countries to blacklist from search (this is only for the publisher location, not the locations mentioned in articles. For Locations mentioned in articles, refer to reverse_entity_guarantee), countries must be the two-letter ISO country codeFor example: United States is 'US', France is 'FR', Sweden is 'SE'. Location: query. Type: string. Optional. |
|
|
150
|
+
| `--continents` | Continents to filter by. Location: query. Type: string. Optional. |
|
|
151
|
+
| `--sentiment` | Sentiment to filter articles by. Location: query. Type: string. Optional. |
|
|
152
|
+
| `--premium` | Include premium sources. Location: query. Type: boolean. Optional. Default: `false`. |
|
|
153
|
+
| `--authors` | Authors to filter articles by. Location: query. Type: string. Optional. |
|
|
154
|
+
| `--try-cache` | Enable response caching with the specified TTL. When a cached response is returned, usage is charged at 0.25x the normal rate. Valid values: '1h' (1 hour), '6h' (6 hours), '12h' (12 hours), '24h' (24 hours), '3d' (3 days), '7d' (7 days). Location: query. Type: string. Optional. |
|
|
155
|
+
| `--geo-lat` | Latitude for geo-radius filter. Must be provided together with geo_lon and geo_radius. Filters articles whose coordinates fall within the specified circle. Location: query. Type: string. Optional. |
|
|
156
|
+
| `--geo-lon` | Longitude for geo-radius filter. Must be provided together with geo_lat and geo_radius. Location: query. Type: string. Optional. |
|
|
157
|
+
| `--geo-radius` | Radius in meters for geo-radius filter. Must be provided together with geo_lat and geo_lon. Location: query. Type: string. Optional. |
|
|
158
|
+
| `--geo-polygon` | JSON string defining a polygon for geo filtering. Must contain an 'exterior' key with a list of {lon, lat} points. The first and last point must be the same. Optionally include 'interiors' as a list of rings (each a list of {lon, lat} points) to exclude areas. Example: {"exterior": [{"lon": -70, "lat": -70}, {"lon": 60, "lat": -70}, {"lon": 60, "lat": 60}, {"lon": -70, "lat": 60}, {"lon": -70, "lat": -70}]} Location: query. Type: string. Optional. |
|
|
159
|
+
|
|
160
|
+
## Global options
|
|
161
|
+
|
|
162
|
+
All commands support `--output human|table|json|jsonl|yaml`, `--json`, API/auth URL
|
|
163
|
+
overrides, request timeout, and color control. Result data is written to stdout; diagnostics
|
|
164
|
+
are written to stderr.
|