Skip to content

Commit 0f2e028

Browse files
committed
updates
1 parent 6b2ce33 commit 0f2e028

114 files changed

Lines changed: 11112 additions & 3890 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
validate:
11+
name: Validate docs
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- uses: actions/setup-node@v4
17+
with:
18+
node-version: "20"
19+
20+
- name: Install Mintlify CLI
21+
run: npm install -g mintlify
22+
23+
- name: Validate mint.json and MDX
24+
run: mintlify broken-links || true
25+
# Mintlify's link checker exits non-zero on external 4xx too; we
26+
# report but don't fail the build on transient external failures.
27+
28+
- name: OpenAPI sanity check
29+
run: |
30+
node -e "JSON.parse(require('fs').readFileSync('openapi.json','utf8'))"

.gitignore

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,21 @@
44
# Dependencies
55
node_modules/
66

7+
# Environment
8+
.env
9+
.env.*
10+
!.env.example
11+
12+
# Logs
13+
*.log
14+
npm-debug.log*
15+
716
# OS
817
.DS_Store
18+
Thumbs.db
919

1020
# IDE
1121
.idea/
1222
.vscode/
1323
*.swp
1424
*.swo
15-
16-
# Claude
17-
.claude/

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v22.12.0

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 vakra-dev
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 50 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,57 @@
11
# reader-docs
22

3-
Documentation for [Reader](https://github.com/vakra-dev/reader) - open-source web scraping for LLMs.
3+
Documentation for [Reader](https://reader.dev), the content extraction API for LLMs. Built with [Mintlify](https://mintlify.com).
44

5-
Built with [Mintlify](https://mintlify.com).
5+
## Structure
66

7-
## Development
7+
```
8+
reader-docs/
9+
├── mint.json # Navigation, theme, tabs, and API playground config
10+
├── openapi.json # Generated from reader-api. DO NOT edit by hand
11+
├── home/
12+
│ ├── introduction.mdx
13+
│ ├── quickstart.mdx
14+
│ ├── concepts/ # 11 concept pages (read primitive, proxy modes, errors, …)
15+
│ └── guides/ # 31 guide pages (getting-started, async, production, …)
16+
├── api-reference/ # 10 MDX shells bound to openapi.json operations
17+
├── sdk/ # JavaScript / Python SDK reference
18+
└── self-hosted/ # Separate section for the self-hosted flavor. The
19+
# ONLY place internal details like the scraping engine
20+
# and proxy tiers may appear. Cloud docs stay opaque.
21+
```
22+
23+
## Local development
24+
25+
```bash
26+
# One-time: install Mintlify CLI
27+
npm i -g mintlify
28+
29+
# Start the dev server with live reload
30+
mintlify dev --port 6005
31+
```
32+
33+
Open http://localhost:6005. Edits to MDX files hot-reload automatically.
34+
35+
**Note on OpenAPI changes:** Mintlify's dev server caches `openapi.json` aggressively. After regenerating the spec (see below) you usually need to stop `mintlify dev` and restart it for the new operation bodies / examples to show up in the API playground.
36+
37+
## Regenerating the OpenAPI spec
38+
39+
`openapi.json` is generated from `reader-api/src/openapi/index.ts`, the source of truth for request/response shapes, error examples, and playground metadata. To regenerate after an API change:
840

941
```bash
10-
npx mintlify dev
42+
cd ../reader-api
43+
npm run docs:gen
1144
```
45+
46+
That writes a fresh `reader-docs/openapi.json`. Commit it alongside the reader-api changes so the docs preview matches.
47+
48+
## Content rules
49+
50+
- **Cloud docs are opaque.** Pages under `home/` and `api-reference/` must not mention internal implementation: no `datacenter`/`residential`, no engine internals, no proxy provider names, no "browser pool". The abstract vocabulary is `standard`/`stealth`/`auto` for proxy modes and plain English for everything else.
51+
- **Self-hosted docs are transparent.** Pages under `self-hosted/` exist specifically so operators can understand the infrastructure they're running. Use the real names there.
52+
- **API code samples must match the v0.2 SDK shape.** Results are discriminated unions: `if (result.kind === "scrape") result.data.markdown`. Jobs return `result.data.results`, not `result.job.data`. See existing pages under `sdk/` and `home/guides/` for reference patterns.
53+
- **Error codes are lowercase snake_case** (`rate_limited`, `insufficient_credits`), not `UPPER_SNAKE_CASE`.
54+
55+
## Deploying
56+
57+
Mintlify auto-deploys on push to the default branch. Check the Mintlify dashboard for deploy status and preview URLs.

api-reference/account/credits.mdx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
title: "Get credit balance"
3+
openapi: "openapi.json GET /v1/usage/credits"
4+
---
5+
6+
Returns your current workspace's balance, monthly limit, used, tier, and next reset time.
7+
8+
See [Credits and billing](/home/concepts/credits-and-billing) for what each operation costs.

api-reference/account/history.mdx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
title: "Usage history"
3+
openapi: "openapi.json GET /v1/usage/history"
4+
---
5+
6+
Paginated log of recent requests for the workspace. Each entry records the URL, duration, status, cache hit, proxy mode (`standard` / `stealth`), credits charged, and timestamp.
7+
8+
Use this endpoint to audit spend, find spike culprits, or build a stats dashboard. The dashboard's Activity view is a thin wrapper on top of this feed.

api-reference/authentication.mdx

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
---
2+
title: "Authentication"
3+
description: "Every Reader API request is authenticated with an API key passed in the x-api-key header."
4+
---
5+
6+
Reader uses API key authentication. Every request to `https://api.reader.dev/v1/*` must include a valid key in the `x-api-key` header.
7+
8+
## Get an API key
9+
10+
<Card title="Open Dashboard →" href="https://app.reader.dev" horizontal>
11+
Sign up free at app.reader.dev. You get **1,000 credits every month** on the free tier - no credit card required.
12+
</Card>
13+
14+
Inside the dashboard:
15+
16+
1. Click **API Keys** in the sidebar
17+
2. Click **Create API Key** and give it a name
18+
3. Copy the key - it starts with `rdr_` and is shown **only once**
19+
20+
<Warning>
21+
API keys are shown once at creation time. Store them securely (environment variables, a secrets manager) - never commit them to version control or expose them in client-side code.
22+
</Warning>
23+
24+
## Using your key
25+
26+
Pass the key in the `x-api-key` header on every request:
27+
28+
<CodeGroup>
29+
30+
```bash curl
31+
curl -X POST https://api.reader.dev/v1/read \
32+
-H "Content-Type: application/json" \
33+
-H "x-api-key: rdr_your_api_key" \
34+
-d '{"url": "https://example.com"}'
35+
```
36+
37+
```javascript JavaScript
38+
import { ReaderClient } from "@vakra-dev/reader-js";
39+
40+
// The SDK handles the header for you
41+
const reader = new ReaderClient({
42+
apiKey: process.env.READER_API_KEY,
43+
});
44+
```
45+
46+
```python Python
47+
from reader_py import ReaderClient
48+
49+
# The SDK handles the header for you
50+
reader = ReaderClient(api_key=os.environ["READER_API_KEY"])
51+
```
52+
53+
</CodeGroup>
54+
55+
## Managing keys
56+
57+
All key management happens in the dashboard - not through the API. This is intentional: rotating, revoking, and creating keys is a privileged operation that shouldn't be scriptable from a compromised key.
58+
59+
- **List keys** - API Keys page in the dashboard
60+
- **Create a new key** - Click "Create API Key"
61+
- **Revoke a key** - Click the trash icon next to any key
62+
- **Rotate a key** - Create a new one, update your app, then revoke the old one
63+
64+
You can have up to **10 active keys per workspace**. Use separate keys for development, staging, and production so you can rotate them independently.
65+
66+
## Error responses
67+
68+
| Status | Meaning |
69+
|---|---|
70+
| `401 Unauthorized` | Missing, invalid, or revoked `x-api-key` header |
71+
| `402 Payment Required` | Key is valid but the workspace has run out of credits |
72+
| `403 Forbidden` | Key doesn't have permission for the requested resource |
73+
74+
See the full [Errors](/home/concepts/errors) reference for status code details and retry guidance.
75+
76+
## Where to go next
77+
78+
<CardGroup cols={2}>
79+
<Card title="Make your first request" icon="bolt" href="/home/quickstart">
80+
60-second walkthrough from key creation to first scrape.
81+
</Card>
82+
<Card title="POST /v1/read" icon="code" href="/api-reference/read">
83+
Full reference for the unified scrape/crawl/batch endpoint.
84+
</Card>
85+
</CardGroup>

0 commit comments

Comments
 (0)