2026-05-04 11:29:02 +07:00
---
name : 9router-web-fetch
2026-09-03 10:12:41 +07:00
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.
2026-05-04 11:29:02 +07:00
---
# 9Router — Web Fetch
2026-05-04 11:35:32 +07:00
Requires `NINEROUTER_URL` (and `NINEROUTER_KEY` if auth enabled). See https://raw.githubusercontent.com/decolua/9router/refs/heads/master/skills/9router/SKILL.md for setup.
2026-05-04 11:29:02 +07:00
2026-05-07 15:45:09 +07:00
## Discover
2026-05-04 11:29:02 +07:00
```bash
curl $NINEROUTER_URL /v1/models/web | jq '.data[] | select(.kind=="webFetch") | .id'
2026-05-07 15:45:09 +07:00
# Per-provider params
curl " $NINEROUTER_URL /v1/models/info?id=firecrawl/fetch"
2026-05-04 11:29:02 +07:00
```
IDs end in `/fetch` (e.g. `firecrawl/fetch` , `jina/fetch` ). `fetch-combo` chains providers with auto-fallback.
## Endpoint
`POST $NINEROUTER_URL/v1/web/fetch`
| Field | Required | Notes |
|---|---|---|
2026-05-18 11:59:43 +07:00
| `model` (or `provider` ) | yes | from `/v1/models/web` (e.g. `firecrawl` or `jina-reader` ) |
2026-05-04 11:29:02 +07:00
| `url` | yes | URL to extract |
| `format` | no | `markdown` (default) / `text` / `html` |
| `max_characters` | no | truncate output |
## Examples
2026-05-18 11:59:43 +07:00
### Jina Reader
2026-05-04 11:29:02 +07:00
```bash
curl -X POST $NINEROUTER_URL /v1/web/fetch \
-H "Authorization: Bearer $NINEROUTER_KEY " \
-H "Content-Type: application/json" \
2026-05-18 11:59:43 +07:00
-d '{"model":"jina-reader","url":"https://9router.com","format":"markdown"}'
2026-05-04 11:29:02 +07:00
```
2026-05-18 11:59:43 +07:00
### Exa
```bash
curl -X POST $NINEROUTER_URL /v1/web/fetch \
-H "Authorization: Bearer $NINEROUTER_KEY " \
-H "Content-Type: application/json" \
-d '{"model":"exa","url":"https://example.com","format":"markdown","max_characters":0}'
```
### Firecrawl
```bash
curl -X POST $NINEROUTER_URL /v1/web/fetch \
-H "Authorization: Bearer $NINEROUTER_KEY " \
-H "Content-Type: application/json" \
-d '{"model":"firecrawl","url":"https://example.com","format":"markdown","max_characters":0}'
```
### Tavily
```bash
curl -X POST $NINEROUTER_URL /v1/web/fetch \
-H "Authorization: Bearer $NINEROUTER_KEY " \
-H "Content-Type: application/json" \
-d '{"model":"tavily","url":"https://example.com","format":"markdown","max_characters":0}'
```
2026-09-03 10:12:41 +07:00
### 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"}'
```
2026-05-18 11:59:43 +07:00
2026-05-04 11:29:02 +07:00
JS:
```js
const r = await fetch ( ` ${ process . env . NINEROUTER_URL } /v1/web/fetch` , {
method : "POST" ,
headers : { "Authorization" : `Bearer ${ process . env . NINEROUTER_KEY } ` , "Content-Type" : "application/json" },
body : JSON . stringify ({ model : "fetch-combo" , url : "https://example.com" , format : "markdown" , max_characters : 5000 }),
});
const { data } = await r . json ();
console . log ( data . title , data . content . length );
```
## Response shape
```json
{
"provider" : "jina-reader" ,
"url" : "..." ,
"title" : "..." ,
"content" : { "format" : "markdown" , "text" : "..." , "length" : 1234 },
2026-09-03 10:12:41 +07:00
"links" : [ "https://example.com/related" ],
2026-05-04 11:29:02 +07:00
"metadata" : { "author" : null , "published_at" : null , "language" : null },
"usage" : { "fetch_cost_usd" : 0 },
"metrics" : { "response_time_ms" : 850 , "upstream_latency_ms" : 700 }
}
```
2026-09-03 10:12:41 +07:00
`links` is included when the upstream provider returns discovered page links (currently Ollama Cloud).
2026-05-04 11:29:02 +07:00
## Provider quirks
| Provider | Auth | Best for |
|---|---|---|
| `firecrawl` | Bearer | JS-rendered pages, `format=markdown/html` |
| `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 |
2026-09-03 10:12:41 +07:00
| `ollama` | Bearer | Markdown plus page title and discovered links; uses the Ollama Cloud key |