{"id":50774485,"url":"https://github.com/rahuletto/reader","last_synced_at":"2026-06-11T22:01:07.598Z","repository":{"id":362310470,"uuid":"1258334348","full_name":"Rahuletto/reader","owner":"Rahuletto","description":"Extract content for AI agents and scripts from a website","archived":false,"fork":false,"pushed_at":"2026-06-03T14:04:37.000Z","size":102,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-03T16:05:36.460Z","etag":null,"topics":["agents","ai","extractor","json","markdown","reader","toon"],"latest_commit_sha":null,"homepage":"https://r.marban.lol/docs","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Rahuletto.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-03T13:35:50.000Z","updated_at":"2026-06-03T14:10:14.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/Rahuletto/reader","commit_stats":null,"previous_names":["rahuletto/reader"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/Rahuletto/reader","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rahuletto%2Freader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rahuletto%2Freader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rahuletto%2Freader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rahuletto%2Freader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Rahuletto","download_url":"https://codeload.github.com/Rahuletto/reader/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rahuletto%2Freader/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34219510,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-11T02:00:06.485Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agents","ai","extractor","json","markdown","reader","toon"],"created_at":"2026-06-11T22:01:06.331Z","updated_at":"2026-06-11T22:01:07.564Z","avatar_url":"https://github.com/Rahuletto.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Reader\n\n[![skills.sh](https://skills.sh/b/Rahuletto/reader)](https://skills.sh/Rahuletto/reader)\n\nCloudflare Worker API that fetches URLs and returns extracted content for AI agents and scripts. Default output is markdown; also JSON, HTML, text, TOON, and raw upstream HTML.\n\n**Production:** https://reader.marban.lol (short: https://r.marban.lol)  \n**Docs:** https://reader.marban.lol/docs · **OpenAPI:** https://reader.marban.lol/openapi.json\n\n## For agents\n\nInstall the skill so the agent uses Reader instead of raw HTML fetches:\n\n```bash\nnpx skills add Rahuletto/reader@reader-fetch -g -y\n```\n\nFetch a page (URL must be encoded):\n\n```bash\ncurl -sG \"https://reader.marban.lol/read\" \\\n  --data-urlencode \"url=https://example.com/article\" \\\n  --data-urlencode \"cache=bypass\"\n```\n\nUse the response body as context. For citations after redirects, read `X-Final-URL`.\n\n| Goal | Request |\n|------|---------|\n| Read, summarize, quote | `GET /read?url=...` (markdown default) |\n| Structured blocks | `format=json` |\n| Fewer tokens | `format=text` |\n| Entities + Wikidata | `GET /graph?url=...` |\n| Page changed since last time | `track=true` on `/read`, then `GET /diff?url=...` |\n\nWorkflow:\n\n1. User provides a URL (or the task implies one).\n2. Call `/read` with `cache=bypass` unless a cached copy is acceptable.\n3. Use markdown or JSON from the body; avoid parsing HTML unless `format=raw`.\n4. Cite `X-Final-URL` when quoting.\n5. On large pages, try `selector=article` or `format=text` before filling context.\n\nSkill source: [`skills/reader-fetch/SKILL.md`](skills/reader-fetch/SKILL.md). Listing page: [skills.sh/Rahuletto/reader](https://skills.sh/Rahuletto/reader) (layout in [`skills.sh.json`](skills.sh.json)).\n\n## API\n\n| Method | Path | Purpose |\n|--------|------|---------|\n| `GET` | `/` | Service info, formats, example URLs |\n| `GET` / `POST` | `/read` | Extract page content |\n| `GET` | `/{encoded-url}` | Same as `/read`; target URL in path, options in query |\n| `GET` / `POST` | `/graph` | JSON-LD (schema.org) with optional Wikidata links |\n| `GET` / `POST` | `/diff` | Compare to a stored snapshot |\n| `GET` / `POST` | `/robots` | Fetch and parse `robots.txt` |\n| `GET` / `POST` | `/sitemap` | Resolve sitemap URLs (`expand=true` for indexes) |\n| `GET` | `/docs` | Scalar API reference |\n| `GET` | `/openapi.json` | OpenAPI 3.1 spec |\n\n### `/read` (main)\n\n```bash\ncurl -sG \"https://reader.marban.lol/read\" --data-urlencode \"url=https://example.com\"\ncurl -sG \"https://reader.marban.lol/read\" --data-urlencode \"url=https://example.com\" --data-urlencode \"format=json\"\n\ncurl -X POST https://reader.marban.lol/read \\\n  -H \"content-type: application/json\" \\\n  -d '{\"url\":\"https://example.com\",\"selector\":\"article\",\"ua\":\"chrome\"}'\n```\n\n| Param | Values / notes |\n|-------|----------------|\n| `format` | `markdown` (default), `json`, `html`, `text`, `toon`, `raw` |\n| `selector` | CSS selector to scope extraction |\n| `cache` | `default`, `bypass`, `force` (upstream fetch) |\n| `classify` | Tag blocks (pricing, date, link, …) |\n| `marker` | Wrap classified blocks in `\u003c!-- READER:type:id --\u003e` |\n| `track` | Store snapshot in KV for `/diff` |\n| `links` | `inline`, `referenced`, `discard` (markdown) |\n| `images` | `keep`, `discard`, `alt-only` |\n| `frontmatter` | YAML frontmatter on markdown (default on) |\n| `ua` | `chrome`, `googlebot`, `bingbot`, `firefox`, or custom string |\n| `timeout` | Ms, 1000–30000 (default 15000) |\n\nResponse headers: `X-Final-URL`, `X-Upstream-Status`, `X-Redirect-History`, `X-Cache` (`HIT` / `MISS` when KV is bound).\n\n### `/graph`\n\n```bash\ncurl -sG \"https://reader.marban.lol/graph\" --data-urlencode \"url=https://example.com\"\ncurl -sG \"https://reader.marban.lol/graph\" --data-urlencode \"url=https://example.com\" --data-urlencode \"wikidata=false\"\n```\n\nWikidata linking is on by default (`wikidataLimit`, `wikidataClaims` optional). Accepts the same fetch options as `/read` (selector, cache, ua, etc.) except `format`.\n\n### `/diff`\n\nRequires an earlier `/read` with `track=true` on the same URL (uses KV).\n\n```bash\ncurl -sG \"https://reader.marban.lol/diff\" --data-urlencode \"url=https://example.com\" --data-urlencode \"update=true\"\ncurl -sG \"https://reader.marban.lol/diff\" --data-urlencode \"url=https://example.com\" --data-urlencode \"update=false\"\ncurl -sG \"https://reader.marban.lol/diff\" --data-urlencode \"url=https://example.com\" --data-urlencode \"format=unified\"\n```\n\n`update` defaults to true (refresh snapshot). `format`: `unified` (default), `json`, `markdown`, `text`.\n\n### `/robots` and `/sitemap`\n\n```bash\ncurl -sG \"https://reader.marban.lol/robots\" --data-urlencode \"url=https://www.iana.org\" --data-urlencode \"format=json\"\ncurl -sG \"https://reader.marban.lol/sitemap\" --data-urlencode \"url=https://developers.cloudflare.com\" --data-urlencode \"format=json\" --data-urlencode \"expand=true\"\n```\n\n`format` for these routes is `raw` or `json`, not the `/read` formats.\n\n## Development\n\nRequires Node 18+ and [Wrangler](https://developers.cloudflare.com/workers/wrangler/).\n\n```bash\nnpm install\nnpm run dev          # http://localhost:8787\nnpm run check        # tsc (src + tests) + oxlint\nnpm test             # integration tests; skips if dev server is down\n```\n\nRun the worker and tests in separate terminals, or point tests at production:\n\n```bash\nREADER_BASE_URL=https://reader.marban.lol npm test\n```\n\n| Script | |\n|--------|---|\n| `npm run lint` | oxlint |\n| `npm run format` | oxfmt write |\n| `npm run deploy` | `wrangler deploy --minify` |\n| `npm run cf-typegen` | Regenerate `CloudflareBindings` after `wrangler.jsonc` changes |\n\n## Deploy\n\nBind a KV namespace as `CACHE` in `wrangler.jsonc` (response cache + diff snapshots). Then:\n\n```bash\nnpm run deploy\n```\n\n## Repository layout\n\n```\nskills.sh.json          skills.sh repo page (groupings)\nskills/reader-fetch/    agent skill published to skills.sh\nsrc/index.ts            Hono app, OpenAPI, /docs\nsrc/reader.ts           fetch → extract → format\nsrc/routes/             read, graph, diff, robots, sitemap\ntests/integration.test.ts\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frahuletto%2Freader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frahuletto%2Freader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frahuletto%2Freader/lists"}