Merge origin/master (v0.5.69) into gitea/new_feature
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
---
|
||||
name: 9router-web-fetch
|
||||
description: Fetch URL → markdown / text / HTML via 9Router /v1/web/fetch using Firecrawl / Jina Reader / Tavily Extract / Exa Contents. Use when the user wants to scrape a webpage, extract URL content, read article, or convert a URL to markdown.
|
||||
description: Fetch URL → markdown / text / HTML via 9Router /v1/web/fetch using Ollama Cloud / Firecrawl / Jina Reader / Tavily Extract / Exa Contents. Use when the user wants to scrape a webpage, extract URL content, read article, or convert a URL to markdown.
|
||||
---
|
||||
|
||||
# 9Router — Web Fetch
|
||||
@@ -62,6 +62,17 @@ curl -X POST $NINEROUTER_URL/v1/web/fetch \
|
||||
-d '{"model":"tavily","url":"https://example.com","format":"markdown","max_characters":0}'
|
||||
```
|
||||
|
||||
### Ollama Cloud
|
||||
|
||||
Uses the API key from the existing `ollama` connection.
|
||||
|
||||
```bash
|
||||
curl -X POST $NINEROUTER_URL/v1/web/fetch \
|
||||
-H "Authorization: Bearer $NINEROUTER_KEY" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"model":"ollama","url":"https://example.com","format":"markdown"}'
|
||||
```
|
||||
|
||||
|
||||
JS:
|
||||
|
||||
@@ -83,12 +94,15 @@ console.log(data.title, data.content.length);
|
||||
"url": "...",
|
||||
"title": "...",
|
||||
"content": { "format": "markdown", "text": "...", "length": 1234 },
|
||||
"links": ["https://example.com/related"],
|
||||
"metadata": { "author": null, "published_at": null, "language": null },
|
||||
"usage": { "fetch_cost_usd": 0 },
|
||||
"metrics": { "response_time_ms": 850, "upstream_latency_ms": 700 }
|
||||
}
|
||||
```
|
||||
|
||||
`links` is included when the upstream provider returns discovered page links (currently Ollama Cloud).
|
||||
|
||||
## Provider quirks
|
||||
|
||||
| Provider | Auth | Best for |
|
||||
@@ -97,3 +111,4 @@ console.log(data.title, data.content.length);
|
||||
| `jina-reader` | Bearer (optional) | Free tier (~1M chars/mo); fastest plain markdown |
|
||||
| `tavily` | Bearer | Bulk extract; returns `raw_content` |
|
||||
| `exa` | `x-api-key` | Pre-indexed pages; fast text extraction |
|
||||
| `ollama` | Bearer | Markdown plus page title and discovered links; uses the Ollama Cloud key |
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
name: 9router-web-search
|
||||
description: Web search via 9Router /v1/search using Tavily / Exa / Brave / Serper / SearXNG / Google PSE / Linkup / SearchAPI / You.com / Perplexity. Use when the user wants to search the web, look up information, find articles, or query a search engine.
|
||||
description: Web and X search via 9Router /v1/search using Tavily / Exa / Brave / Serper / SearXNG / Google PSE / Linkup / SearchAPI / You.com / Perplexity / Xquik. Use when the user wants to search the web, find articles, or search public X posts.
|
||||
---
|
||||
|
||||
# 9Router — Web Search
|
||||
@@ -26,7 +26,7 @@ IDs end in `/search` (e.g. `tavily/search`). Combos (`owned_by:"combo"`) chain p
|
||||
| `model` (or `provider`) | yes | from `/v1/models/web` (e.g. `tavily` or `brave`) |
|
||||
| `query` | yes | search query |
|
||||
| `max_results` | no | default 5 |
|
||||
| `search_type` | no | `web` (default) / `news` |
|
||||
| `search_type` | no | `web` (default) / `news` / `x` for Xquik |
|
||||
| `country`, `language`, `time_range`, `domain_filter` | no | provider-dependent |
|
||||
|
||||
## Examples
|
||||
@@ -49,6 +49,26 @@ const r = await fetch(`${process.env.NINEROUTER_URL}/v1/search`, {
|
||||
console.log(await r.json());
|
||||
```
|
||||
|
||||
X search with Xquik:
|
||||
|
||||
```bash
|
||||
curl -X POST $NINEROUTER_URL/v1/search \
|
||||
-H "Authorization: Bearer $NINEROUTER_KEY" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"model":"xquik","query":"from:github release","max_results":10,"provider_options":{"queryType":"Latest"}}'
|
||||
```
|
||||
|
||||
Add the Xquik API key in 9Router's provider settings. Xquik charges 1 credit per returned post. Continue a search by passing `pagination.next_cursor` as `provider_options.cursor`.
|
||||
|
||||
Xquik responses include provider pagination and credit usage:
|
||||
|
||||
```json
|
||||
{
|
||||
"pagination": { "has_more": true, "next_cursor": "cursor-2" },
|
||||
"usage": { "queries_used": 1, "search_cost_usd": null, "provider_credits_used": 10 }
|
||||
}
|
||||
```
|
||||
|
||||
## Response shape
|
||||
|
||||
```json
|
||||
@@ -87,5 +107,6 @@ All accept `query` + `max_results`. Optional fields vary:
|
||||
| `searchapi` | country, language, pagination | — |
|
||||
| `youcom` | country, language, time_range, domain_filter, full_page | — |
|
||||
| `searxng` | language, time_range | Self-hosted, **noAuth** |
|
||||
| `xquik` | X/Twitter search operators, language, cursor pagination | `queryType: Latest/Top`, `cursor` (options) |
|
||||
|
||||
Provider IS the model — `"provider":"tavily" ≡ "model":"tavily"`.
|
||||
|
||||
Reference in New Issue
Block a user