jirosearch 0.1.1__tar.gz

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.
Files changed (94) hide show
  1. jirosearch-0.1.1/LICENSE +21 -0
  2. jirosearch-0.1.1/PKG-INFO +399 -0
  3. jirosearch-0.1.1/README.md +340 -0
  4. jirosearch-0.1.1/jiro/__init__.py +10 -0
  5. jirosearch-0.1.1/jiro/ai/__init__.py +1 -0
  6. jirosearch-0.1.1/jiro/ai/agent.py +512 -0
  7. jirosearch-0.1.1/jiro/ai/llm.py +238 -0
  8. jirosearch-0.1.1/jiro/ai/tools.py +188 -0
  9. jirosearch-0.1.1/jiro/alerts.py +247 -0
  10. jirosearch-0.1.1/jiro/analytics.py +211 -0
  11. jirosearch-0.1.1/jiro/audit.py +439 -0
  12. jirosearch-0.1.1/jiro/auth.py +309 -0
  13. jirosearch-0.1.1/jiro/browser.py +263 -0
  14. jirosearch-0.1.1/jiro/cache.py +125 -0
  15. jirosearch-0.1.1/jiro/captcha.py +140 -0
  16. jirosearch-0.1.1/jiro/cli.py +345 -0
  17. jirosearch-0.1.1/jiro/cli_plugins.py +344 -0
  18. jirosearch-0.1.1/jiro/compliance.py +442 -0
  19. jirosearch-0.1.1/jiro/config.py +386 -0
  20. jirosearch-0.1.1/jiro/db.py +476 -0
  21. jirosearch-0.1.1/jiro/errors.py +125 -0
  22. jirosearch-0.1.1/jiro/export.py +253 -0
  23. jirosearch-0.1.1/jiro/extract.py +374 -0
  24. jirosearch-0.1.1/jiro/jobs.py +200 -0
  25. jirosearch-0.1.1/jiro/log.py +53 -0
  26. jirosearch-0.1.1/jiro/mcp.py +540 -0
  27. jirosearch-0.1.1/jiro/mcp_http.py +530 -0
  28. jirosearch-0.1.1/jiro/models.py +230 -0
  29. jirosearch-0.1.1/jiro/proxy.py +151 -0
  30. jirosearch-0.1.1/jiro/recipes.py +341 -0
  31. jirosearch-0.1.1/jiro/redis_cache.py +73 -0
  32. jirosearch-0.1.1/jiro/robots.py +310 -0
  33. jirosearch-0.1.1/jiro/scraping/__init__.py +1 -0
  34. jirosearch-0.1.1/jiro/scraping/client.py +794 -0
  35. jirosearch-0.1.1/jiro/scraping/engines.py +400 -0
  36. jirosearch-0.1.1/jiro/scraping/parsers/__init__.py +5 -0
  37. jirosearch-0.1.1/jiro/scraping/parsers/amazon.py +135 -0
  38. jirosearch-0.1.1/jiro/scraping/parsers/baidu.py +163 -0
  39. jirosearch-0.1.1/jiro/scraping/parsers/bing.py +342 -0
  40. jirosearch-0.1.1/jiro/scraping/parsers/brave.py +166 -0
  41. jirosearch-0.1.1/jiro/scraping/parsers/duckduckgo.py +229 -0
  42. jirosearch-0.1.1/jiro/scraping/parsers/ebay.py +122 -0
  43. jirosearch-0.1.1/jiro/scraping/parsers/google.py +365 -0
  44. jirosearch-0.1.1/jiro/scraping/parsers/yandex.py +160 -0
  45. jirosearch-0.1.1/jiro/scraping/parsers/youtube.py +175 -0
  46. jirosearch-0.1.1/jiro/scraping/searlo_client.py +345 -0
  47. jirosearch-0.1.1/jiro/security.py +179 -0
  48. jirosearch-0.1.1/jiro/semantic.py +139 -0
  49. jirosearch-0.1.1/jiro/server/__init__.py +248 -0
  50. jirosearch-0.1.1/jiro/server/deps.py +109 -0
  51. jirosearch-0.1.1/jiro/server/routers/__init__.py +1 -0
  52. jirosearch-0.1.1/jiro/server/routers/admin.py +91 -0
  53. jirosearch-0.1.1/jiro/server/routers/ai.py +98 -0
  54. jirosearch-0.1.1/jiro/server/routers/analytics.py +209 -0
  55. jirosearch-0.1.1/jiro/server/routers/compliance.py +131 -0
  56. jirosearch-0.1.1/jiro/server/routers/jobs.py +93 -0
  57. jirosearch-0.1.1/jiro/server/routers/ops.py +178 -0
  58. jirosearch-0.1.1/jiro/server/routers/plugins.py +152 -0
  59. jirosearch-0.1.1/jiro/server/routers/scrape.py +172 -0
  60. jirosearch-0.1.1/jiro/server/routers/search.py +307 -0
  61. jirosearch-0.1.1/jiro/server/routers/stream.py +92 -0
  62. jirosearch-0.1.1/jiro/server/routers/system.py +84 -0
  63. jirosearch-0.1.1/jiro/structured.py +776 -0
  64. jirosearch-0.1.1/jirosearch.egg-info/PKG-INFO +399 -0
  65. jirosearch-0.1.1/jirosearch.egg-info/SOURCES.txt +92 -0
  66. jirosearch-0.1.1/jirosearch.egg-info/dependency_links.txt +1 -0
  67. jirosearch-0.1.1/jirosearch.egg-info/entry_points.txt +2 -0
  68. jirosearch-0.1.1/jirosearch.egg-info/requires.txt +33 -0
  69. jirosearch-0.1.1/jirosearch.egg-info/top_level.txt +1 -0
  70. jirosearch-0.1.1/pyproject.toml +99 -0
  71. jirosearch-0.1.1/setup.cfg +4 -0
  72. jirosearch-0.1.1/tests/test_api.py +127 -0
  73. jirosearch-0.1.1/tests/test_auth.py +70 -0
  74. jirosearch-0.1.1/tests/test_cache.py +56 -0
  75. jirosearch-0.1.1/tests/test_chaos.py +543 -0
  76. jirosearch-0.1.1/tests/test_cli_plugins.py +72 -0
  77. jirosearch-0.1.1/tests/test_compliance.py +88 -0
  78. jirosearch-0.1.1/tests/test_config.py +50 -0
  79. jirosearch-0.1.1/tests/test_contracts.py +215 -0
  80. jirosearch-0.1.1/tests/test_extract.py +54 -0
  81. jirosearch-0.1.1/tests/test_integration.py +264 -0
  82. jirosearch-0.1.1/tests/test_mcp.py +320 -0
  83. jirosearch-0.1.1/tests/test_mcp_http.py +406 -0
  84. jirosearch-0.1.1/tests/test_parsers.py +125 -0
  85. jirosearch-0.1.1/tests/test_phase1.py +258 -0
  86. jirosearch-0.1.1/tests/test_phase2.py +365 -0
  87. jirosearch-0.1.1/tests/test_phase2_engines.py +309 -0
  88. jirosearch-0.1.1/tests/test_phase3.py +268 -0
  89. jirosearch-0.1.1/tests/test_phase4.py +436 -0
  90. jirosearch-0.1.1/tests/test_phase5.py +279 -0
  91. jirosearch-0.1.1/tests/test_phase6.py +345 -0
  92. jirosearch-0.1.1/tests/test_property.py +405 -0
  93. jirosearch-0.1.1/tests/test_robots.py +100 -0
  94. jirosearch-0.1.1/tests/test_security.py +93 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Jiro Contributors
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.
@@ -0,0 +1,399 @@
1
+ Metadata-Version: 2.4
2
+ Name: jirosearch
3
+ Version: 0.1.1
4
+ Summary: Local-first, AI-native web search & scraping API. A drop-in, self-hosted SerpAPI alternative with MCP server, agentic research, and built-in legal compliance.
5
+ Author-email: Adarsh Kushwah <webcrafterreal@gmail.com>
6
+ Maintainer-email: Blackvault Technology <webcrafterreal@gmail.com>
7
+ License: MIT
8
+ Project-URL: Homepage, https://github.com/DevAnimecx/jiro
9
+ Project-URL: Documentation, https://github.com/DevAnimecx/jiro#readme
10
+ Project-URL: Repository, https://github.com/DevAnimecx/jiro
11
+ Project-URL: Issues, https://github.com/DevAnimecx/jiro/issues
12
+ Project-URL: Changelog, https://github.com/DevAnimecx/jiro/blob/main/CHANGELOG.md
13
+ Project-URL: Buy Me a Coffee, https://github.com/sponsors/DevAnimecx
14
+ Keywords: search,search-api,web-search,web-scraping,scraper,serpapi-alternative,serpapi,self-hosted,self-hosted-api,scraping-api,llm,agent,ai-agents,mcp,model-context-protocol,fastapi,langchain,llamaindex,function-calling,openai,anthropic,gemini,claude,cursor,markdown-scraper,seo,data-extraction,agentic-research,rag
15
+ Classifier: Development Status :: 4 - Beta
16
+ Classifier: Intended Audience :: Developers
17
+ Classifier: License :: OSI Approved :: MIT License
18
+ Classifier: Operating System :: OS Independent
19
+ Classifier: Programming Language :: Python :: 3
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Programming Language :: Python :: 3.13
23
+ Classifier: Topic :: Internet :: WWW/HTTP
24
+ Classifier: Topic :: Internet :: WWW/HTTP :: Indexing/Search
25
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
26
+ Classifier: Topic :: Text Processing :: Markup :: HTML
27
+ Requires-Python: >=3.11
28
+ Description-Content-Type: text/markdown
29
+ License-File: LICENSE
30
+ Requires-Dist: fastapi>=0.110
31
+ Requires-Dist: uvicorn[standard]>=0.29
32
+ Requires-Dist: httpx[http2]>=0.27
33
+ Requires-Dist: curl_cffi>=0.15
34
+ Requires-Dist: brotli>=1.1
35
+ Requires-Dist: selectolax>=0.3.21
36
+ Requires-Dist: pydantic>=2.6
37
+ Requires-Dist: PyYAML>=6.0
38
+ Requires-Dist: typer>=0.12
39
+ Requires-Dist: rich>=13.0
40
+ Requires-Dist: PyJWT>=2.8
41
+ Requires-Dist: aiosqlite>=0.20
42
+ Provides-Extra: dev
43
+ Requires-Dist: pytest>=8; extra == "dev"
44
+ Requires-Dist: pytest-asyncio>=0.23; extra == "dev"
45
+ Requires-Dist: ruff>=0.4; extra == "dev"
46
+ Requires-Dist: fakeredis>=2.23; extra == "dev"
47
+ Requires-Dist: hypothesis>=6.100; extra == "dev"
48
+ Provides-Extra: browser
49
+ Requires-Dist: playwright>=1.44; extra == "browser"
50
+ Provides-Extra: redis
51
+ Requires-Dist: redis>=5.0; extra == "redis"
52
+ Provides-Extra: recipes
53
+ Requires-Dist: lxml>=5.0; extra == "recipes"
54
+ Provides-Extra: all
55
+ Requires-Dist: playwright>=1.44; extra == "all"
56
+ Requires-Dist: redis>=5.0; extra == "all"
57
+ Requires-Dist: lxml>=5.0; extra == "all"
58
+ Dynamic: license-file
59
+
60
+ # Jiro Search API πŸ”
61
+
62
+ > **Local-first, AI-native web search & scraping API** β€” a drop-in, **self-hosted SerpAPI alternative** with **MCP server**, **agentic research**, and **built-in legal compliance**.
63
+
64
+ [![GitHub stars](https://img.shields.io/github/stars/DevAnimecx/jiro?style=social)](https://github.com/DevAnimecx/jiro/stargazers)
65
+ [![GitHub forks](https://img.shields.io/github/forks/DevAnimecx/jiro?style=social)](https://github.com/DevAnimecx/jiro/network/members)
66
+ [![PyPI version](https://img.shields.io/pypi/v/jiro-search?color=blue)](https://pypi.org/project/jiro-search/)
67
+ [![Docker](https://img.shields.io/badge/docker-ghcr.io%2FDevAnimecx%2Fjiro-blue)](https://github.com/DevAnimecx/jiro/pkgs/container/jiro)
68
+ [![License: MIT](https://img.shields.io/badge/License-MIT-green)](LICENSE)
69
+ [![Tests](https://img.shields.io/badge/tests-380%20passing-brightgreen)](https://github.com/DevAnimecx/jiro/actions)
70
+ [![Python](https://img.shields.io/badge/python-3.11%2B-blue)](https://www.python.org/)
71
+
72
+ **Jiro** scrapes Google, Bing, DuckDuckGo, Brave, YouTube, Amazon, eBay, Yandex and Baidu directly β€” no third-party search API, no per-query billing, no cloud lock-in. Results are cached locally in SQLite (sub-50 ms cached responses), exposed through a **SerpAPI-compatible REST API**, and built to be called by **AI agents**: function-calling schemas for OpenAI/Anthropic/Gemini, a **Model Context Protocol (MCP) server**, LangChain/LlamaIndex wrappers, and an agentic `/ai/search` loop that plans β†’ searches β†’ reads pages β†’ synthesizes a cited answer. Bring your own keys (BYOK) for proxies, CAPTCHA solvers and LLM providers.
73
+
74
+ > **Status:** Production-ready MVP (open-source, MIT). Self-host it for $0 or subscribe to **Jiro Cloud** for a managed proxy fleet, SLA and compliance dashboard.
75
+ > **Responsible use:** search engines actively fight bots. From residential IPs (and with BYOK proxies) Google/DuckDuckGo work; on datacenter IPs Jiro automatically falls back across engines (`google β†’ bing β†’ brave β†’ duckduckgo`). Respect each engine's ToS and `robots.txt`.
76
+
77
+ ---
78
+
79
+ ## Why Jiro? (SerpAPI Alternative, Self-Hosted)
80
+
81
+ | Problem with closed search APIs | Jiro's open-source solution |
82
+ |---|---|
83
+ | πŸ’Έ SerpAPI costs **$200+/mo** for 100k requests | **Free forever** β€” run on your own infrastructure (MIT) |
84
+ | ☁️ Cloud lock-in, your queries leave your network | **100% local-first** β€” your queries, your data, your compliance |
85
+ | πŸ€– No native AI-agent integration | **MCP + Function Calling + LangChain/LlamaIndex** native |
86
+ | βš–οΈ Legal gray area (robots.txt, ToS) | **Built-in compliance**: robots.txt parser, ToS tracking, immutable audit logs |
87
+ | πŸ”§ Fragile parsers break on UI changes | **Self-healing selectors** + 9-engine automatic fallback chain |
88
+
89
+ ---
90
+
91
+ ## One-Command Start
92
+
93
+ ```bash
94
+ pip install jiro-search # or: uv tool install jiro-search
95
+
96
+ jiro serve # API on http://localhost:8000 (docs: /docs)
97
+ ```
98
+
99
+ That's it β€” a working **self-hosted search API** in one command.
100
+
101
+ ```bash
102
+ # Search (SerpAPI-compatible endpoint)
103
+ curl "http://localhost:8000/search.json?engine=google&q=python+web+scraping&num=5"
104
+
105
+ # Scrape a page into clean markdown
106
+ curl -X POST http://localhost:8000/scrape \
107
+ -H "Content-Type: application/json" \
108
+ -d '{"url":"https://example.com","format":"markdown"}'
109
+
110
+ # Agentic research with citations
111
+ curl -X POST http://localhost:8000/ai/search \
112
+ -H "Content-Type: application/json" \
113
+ -d '{"query":"What is the best Python web scraping library in 2026?","max_sources":5}'
114
+ ```
115
+
116
+ ---
117
+
118
+ ## Feature Matrix
119
+
120
+ | Capability | Jiro (OSS) | SerpAPI | ScraperAPI | Bright Data |
121
+ |-----------|:----------:|:-------:|:----------:|:-----------:|
122
+ | **Web Search β€” 9 engines** | βœ… | βœ… | ❌ | ❌ |
123
+ | **Universal Web Scraper** (markdown/text/html/JSON) | βœ… | ❌ | βœ… | βœ… |
124
+ | **Agentic Research** (`/ai/search`) | βœ… | ❌ | ❌ | ❌ |
125
+ | **MCP Server** (stdio + Streamable HTTP + SSE) | βœ… | ❌ | ❌ | ❌ |
126
+ | **Function-Calling Schemas** (OpenAI/Anthropic/Gemini) | βœ… | ❌ | ❌ | ❌ |
127
+ | **Legal Compliance Layer** (robots.txt, ToS, audit) | βœ… | ❌ | ❌ | ❌ |
128
+ | **Self-Hosted / Air-Gapped** | βœ… | ❌ | ❌ | ❌ |
129
+ | **BYOK Proxies + CAPTCHA** | βœ… | ❌ | Partial | βœ… |
130
+ | **Open Source (MIT)** | βœ… | ❌ | ❌ | ❌ |
131
+ | **Pricing** | **Free** | $200+/mo | $299+/mo | $500+/mo |
132
+
133
+ ---
134
+
135
+ ## What You Get
136
+
137
+ | Area | Features |
138
+ |------|----------|
139
+ | **Engines** | Google (web/images/news/videos/shopping/places), Bing (web/images/news/videos), Brave (web/videos), DuckDuckGo (web/images), YouTube, Amazon, eBay, Yandex, Baidu |
140
+ | **Resilience** | Automatic engine fallback chain, UA rotation, retries + exponential backoff, per-engine circuit breaker, bot-wall detection, optional Playwright browser fallback for JS-heavy pages |
141
+ | **Cache** | SQLite (WAL) or Redis with TTL, `fresh=true` to bypass; memory mode; **semantic cache** (embedding-based fuzzy reuse); sub-50 ms cached p95 |
142
+ | **Scraper** | URL β†’ markdown/text/html/JSON, readability extraction, OpenGraph/Twitter/JSON-LD metadata, links & images, LLM schema extraction, **custom CSS/XPath/JSONPath recipes** |
143
+ | **AI-native** | OpenAI/Anthropic/Gemini tool schemas, **MCP server** (`jiro mcp`), LangChain & LlamaIndex wrappers, `/ai/search` agent loop, `/ai/agent` multi-step research, **SSE streaming**, extractive fallback when no LLM key |
144
+ | **BYOK** | Proxies (HTTP/SOCKS5, single list or presets: BrightData/Oxylabs/ScraperAPI/ZenRows/Smartproxy), CAPTCHA solvers (2Captcha/CapSolver), LLM keys (OpenAI, Anthropic, Gemini, OpenRouter, Ollama) β€” all via config/env |
145
+ | **Async jobs** | `POST /jobs` for long-running research/scrape batches, `GET /jobs/{id}` status, webhook delivery with HMAC signature |
146
+ | **Team** | Hashed API keys, admin/user roles + scopes, per-key rate limits, JWT, usage tracking (`/usage`, `/metrics`) |
147
+ | **Ops** | Prometheus `/metrics`, `/proxy/status`, `/captcha/status`, structured JSON logs, Helm chart |
148
+ | **Privacy** | No telemetry, queries not logged by default, all data stays local |
149
+ | **Lightweight** | Async httpx + selectolax (C parser), ~15 core deps, starts in < 1 s |
150
+
151
+ ---
152
+
153
+ ## Jiro vs SerpAPI, ScraperAPI & Bright Data
154
+
155
+ Jiro is the only **open-source, self-hostable** project that combines **search + scrape + agentic AI research + MCP** in one binary, with **legal compliance built in**. Closed competitors charge $200–$3,000/month for subsets of this and never let you self-host.
156
+
157
+ β†’ Full comparisons: [vs SerpAPI](docs/comparisons/serpapi.md) Β· [vs ScraperAPI](docs/comparisons/scraperapi.md) Β· [vs Bright Data](docs/comparisons/bright-data.md)
158
+
159
+ ---
160
+
161
+ ## AI Agent Integration
162
+
163
+ ### Model Context Protocol (MCP)
164
+
165
+ Jiro ships a full **MCP server** (stdio, Streamable HTTP, legacy SSE) β€” giving AI agents live web search, page scraping and research.
166
+
167
+ ```bash
168
+ jiro mcp # MCP server over stdio
169
+ jiro mcp --transport http # Streamable HTTP + SSE on :8000/mcp
170
+ ```
171
+
172
+ **Tools:** `search` (9 engines, 6 search types) Β· `scrape` (markdown/text/html/json) Β· `ai_search` (agentic research with citations).
173
+ **Prompts:** `search_and_summarize`, `compare_engines`. **Autocompletion:** engine names, search types, time ranges, formats.
174
+
175
+ #### Claude Desktop
176
+
177
+ ```json
178
+ {
179
+ "mcpServers": {
180
+ "jiro": {
181
+ "command": "jiro",
182
+ "args": ["mcp"],
183
+ "env": { "JIRO_CONFIG": "~/.jiro/config.yaml" }
184
+ }
185
+ }
186
+ }
187
+ ```
188
+
189
+ #### Cursor / Continue.dev / Zed / Cline
190
+
191
+ Point the MCP client at `jiro mcp` as the server command (see [docs/mcp](docs/mcp.md)).
192
+
193
+ ### Function Calling (OpenAI / Anthropic / Gemini)
194
+
195
+ ```python
196
+ from jiro.ai.tools import openai_tools, anthropic_tools, gemini_tools
197
+ tools = openai_tools() # OpenAI / OpenRouter / Ollama
198
+ ```
199
+
200
+ ### LangChain / LlamaIndex
201
+
202
+ ```python
203
+ from jiro.ai.tools import langchain_tools, ToolSpec
204
+ tools = langchain_tools(search_fn=my_search, scrape_fn=my_scrape, ai_fn=my_ai_search)
205
+ ```
206
+
207
+ β†’ Tutorial: [Build a Deep Research Agent with Jiro + Claude (MCP)](docs/tutorials/deep-research-agent.md)
208
+
209
+ ---
210
+
211
+ ## API Reference
212
+
213
+ Interactive docs at **`http://localhost:8000/docs`** (Swagger) and `http://localhost:8000/openapi.json`.
214
+
215
+ | Method | Path | Notes |
216
+ |---|---|---|
217
+ | `GET` | `/search.json` | SerpAPI-compatible β€” `engine`, `q`, `num`, `start`, `hl`, `gl`, `api_key`, … |
218
+ | `GET`/`POST` | `/search` | Alias / JSON body |
219
+ | `POST` | `/search/batch` | Up to 10 queries in parallel |
220
+ | `GET` | `/search/stream` | SSE stream (single or multi-engine) |
221
+ | `POST` | `/scrape` | `{url, format, include_metadata, extract_schema, recipe}` |
222
+ | `POST` | `/scrape/batch` | Up to 50 URLs |
223
+ | `POST` | `/ai/search` | Plan β†’ search β†’ scrape top N β†’ synthesize cited answer |
224
+ | `GET` | `/ai/search/stream` | SSE stream (`plan\|search\|source\|synthesize\|answer`) |
225
+ | `POST` | `/ai/agent` | Multi-step autonomous research |
226
+ | `POST` | `/ai/extract` | LLM extraction from URL/text with a custom schema |
227
+ | `POST` | `/jobs` | `ai_search` / `ai_agent` / `batch_scrape` with webhook |
228
+ | `GET` | `/health`, `/engines`, `/metrics` | Status, engines, Prometheus counters |
229
+ | `POST`/`GET`/`DELETE` | `/api-keys` | Hashed key mgmt (admin) |
230
+ | `POST` | `/auth/token` | Exchange API key for JWT |
231
+
232
+ Auth: `X-API-Key: jsk_...` header, `?api_key=...` param, or `Authorization: Bearer <jwt>`. When `auth.enabled: false` (default) the API is open for local use.
233
+
234
+ ---
235
+
236
+ ## CLI
237
+
238
+ ```bash
239
+ jiro serve # start the API server
240
+ jiro search web "python scraping" --engine bing --num 5 --json
241
+ jiro scrape "https://example.com" --format markdown
242
+ jiro ask "best python scraping library?" --max-sources 5
243
+ jiro mcp # MCP server over stdio
244
+ jiro config init # write ~/.jiro/config.yaml
245
+ jiro config show
246
+ jiro keys create --name "ci" --role user # prompts for admin key
247
+ jiro keys list
248
+ jiro keys revoke key_abc123
249
+ jiro usage --days 7
250
+ jiro plugins create myengine --author "Your Name" # scaffold a new engine
251
+ ```
252
+
253
+ ---
254
+
255
+ ## Configuration & BYOK
256
+
257
+ Config at `~/.jiro/config.yaml` (or `$JIRO_CONFIG`). Override anything with env: `JIRO_SERVER__PORT=9000`, `JIRO_AUTH__ENABLED=true`. Secrets interpolate from env: `api_key: ${OPENAI_API_KEY}`.
258
+
259
+ | Service | Config | Env example |
260
+ |---|---|---|
261
+ | Proxy (custom) | `scraping.proxy.url` (comma-separated rotates) | `http://user:pass@proxy.example:22225` |
262
+ | Proxy (BrightData) | `scraping.proxy.provider: brightdata` + `api_key` | `${BRIGHTDATA_API_KEY}` |
263
+ | Proxy (Oxylabs/ScraperAPI/ZenRows/Smartproxy) | `scraping.proxy.provider` + `api_key` | `${OXYLABS_API_KEY}` |
264
+ | CAPTCHA (2Captcha / CapSolver) | `scraping.captcha.provider` + `api_key` | `${CAPSOLVER_API_KEY}` |
265
+ | LLM (OpenAI/Anthropic/Gemini/OpenRouter) | `llm.provider/api_key/model` | `${OPENAI_API_KEY}` |
266
+ | LLM (Ollama, local) | `llm.provider: ollama`, `base_url: http://localhost:11434/v1` | β€” |
267
+ | Redis cache | `cache.type: redis`, `cache.url` | `JIRO_CACHE__TYPE=redis` |
268
+
269
+ ---
270
+
271
+ ## Deployment
272
+
273
+ ### Docker
274
+
275
+ ```bash
276
+ docker compose up -d # http://localhost:8000
277
+ ```
278
+
279
+ ### Helm (Kubernetes)
280
+
281
+ ```bash
282
+ helm install jiro ./helm \
283
+ --set config.env.JIRO_AUTH__ENABLED=true \
284
+ --set config.envFromSecret=jiro-secrets
285
+ ```
286
+
287
+ Ships Deployment, Service, PVC (SQLite data), optional Ingress and optional Redis cache (`--set redis.enabled=true`).
288
+
289
+ ### Team setup (auth on)
290
+
291
+ ```bash
292
+ export JIRO_AUTH__ENABLED=true JIRO_JWT_SECRET=$(openssl rand -hex 32)
293
+ jiro keys create --name admin --role admin --admin-key "$ADMIN"
294
+ jiro keys create --name "alice" --role user --rate-limit 30
295
+ ```
296
+
297
+ ---
298
+
299
+ ## πŸ’‘ Open Core & Monetization
300
+
301
+ Jiro is **open-source (MIT)** and will always be free to self-host. The sustainable model:
302
+
303
+ | Edition | What | License | For |
304
+ |---------|------|---------|-----|
305
+ | **Jiro OSS** | Full search/scrape/AI/MCP, all engines, plugins, compliance | MIT | Everyone β€” $0 |
306
+ | **Jiro Cloud** *(roadmap)* | Managed hosting, auto-scaling, global residential proxy pool, SLA, SSO, compliance dashboard | SaaS | Teams & agents |
307
+ | **Jiro Enterprise** *(roadmap)* | Air-gapped license (BSL-1.0), SOC 2 path, dedicated support, private engine plugins | Source-available | Fintech/Legal/Gov/AI labs |
308
+
309
+ We monetize **convenience, compliance and support** β€” never the code. Community contributions stay MIT.
310
+
311
+ β†’ Roadmap: [docs/ROADMAP.md](docs/ROADMAP.md)
312
+
313
+ ---
314
+
315
+ ## Documentation
316
+
317
+ - πŸ“– [Docs hub](docs/README.md)
318
+ - πŸ”Œ [MCP integration](docs/mcp.md)
319
+ - βš–οΈ [Compliance & responsible use](docs/compliance.md)
320
+ - πŸ†š [vs SerpAPI](docs/comparisons/serpapi.md) Β· [vs ScraperAPI](docs/comparisons/scraperapi.md) Β· [vs Bright Data](docs/comparisons/bright-data.md)
321
+ - πŸŽ“ [Deep Research Agent tutorial](docs/tutorials/deep-research-agent.md)
322
+
323
+ ---
324
+
325
+ ## Performance
326
+
327
+ | Metric | Value |
328
+ |---|---|
329
+ | Startup | < 1 s |
330
+ | Cached search (SQLite) | ~1–3 ms round-trip in-process |
331
+ | Live Bing search | ~0.3–0.8 s from a datacenter IP |
332
+ | `/scrape` of a small page | ~0.3–0.9 s first hit, then cached |
333
+ | Test suite | 380 tests passing |
334
+
335
+ ---
336
+
337
+ ## Project Layout
338
+
339
+ ```
340
+ jiro/
341
+ β”œβ”€β”€ ai/ LLM providers, tool schemas, agentic loop (research + multi-step agent + SSE)
342
+ β”œβ”€β”€ scraping/ HTTP client (UA rotation, retries, circuit breaker, proxy manager, browser fallback),
343
+ β”‚ engines: google/bing/brave/duckduckgo/youtube/amazon/ebay/yandex/baidu
344
+ β”œβ”€β”€ server/ FastAPI app: routers (search, scrape, ai, stream, jobs, admin, ops, system)
345
+ β”œβ”€β”€ auth.py API keys (SHA-256 hashed), JWT, rate limiting
346
+ β”œβ”€β”€ browser.py Playwright browser fallback (lazy, graceful degradation)
347
+ β”œβ”€β”€ cache.py SQLite / memory cache manager
348
+ β”œβ”€β”€ captcha.py BYOK CAPTCHA solvers (2Captcha, CapSolver)
349
+ β”œβ”€β”€ config.py YAML + env config with ${VAR} interpolation
350
+ β”œβ”€β”€ db.py SQLite (WAL): cache, api_keys, usage, jobs, semantic_cache, tos_acknowledgments
351
+ β”œβ”€β”€ extract.py readability + metadata + HTMLβ†’Markdown
352
+ β”œβ”€β”€ jobs.py async job queue + webhooks (HMAC-signed)
353
+ β”œβ”€β”€ mcp.py MCP server (stdio): tools, prompts, resources, autocompletion
354
+ β”œβ”€β”€ models.py Pydantic contracts
355
+ β”œβ”€β”€ proxy.py BYOK proxy manager (provider presets, rotation, cooldown)
356
+ β”œβ”€β”€ recipes.py CSS / XPath / JSONPath extraction recipes
357
+ β”œβ”€β”€ redis_cache.py Redis cache backend
358
+ β”œβ”€β”€ semantic.py embedding-based semantic cache
359
+ └── cli.py Typer CLI
360
+ tests/ parser fixtures + unit/API/integration/chaos/property tests
361
+ ```
362
+
363
+ ---
364
+
365
+ ## Development
366
+
367
+ ```bash
368
+ git clone https://github.com/DevAnimecx/jiro.git && cd jiro
369
+ pip install -e ".[dev,browser,redis,recipes]"
370
+ pytest -m "not network" # skip network-dependent tests
371
+ jiro serve --reload
372
+ ```
373
+
374
+ ### Roadmap status
375
+
376
+ - **Phase 1 (MVP)** β€” βœ… CLI, config, FastAPI server, google/bing/ddg web engines, SerpAPI-compatible JSON, SQLite cache, API-key auth, OpenAI tool schema, `/ai/search`, Dockerfile.
377
+ - **Phase 2** β€” βœ… Brave + Bing videos, images/news types, team keys, MCP server, LangChain/LlamaIndex wrappers, batch scrape, `/metrics`, Playwright fallback, BYOK proxy + CAPTCHA, SSE, Redis.
378
+ - **Phase 3** β€” βœ… `/ai/agent` multi-step research, CSS/XPath/JSONPath recipes, LLM extraction, plugin registry, async jobs + webhooks.
379
+ - **Phase 4** β€” partial: semantic cache in; RAG pipelines, horizontal scaling and the community parser marketplace remain future work. Helm chart provided.
380
+
381
+ ---
382
+
383
+ ## License & Responsible Use
384
+
385
+ **MIT**. Jiro is a scraping tool: respect each search engine's Terms of Service and `robots.txt`, keep request rates respectful, and use proxies/CAPTCHA services at your own discretion. All traffic originates from *your* network; queries are only visible to the engines you query.
386
+
387
+ ---
388
+
389
+ ## Community & Support
390
+
391
+ - πŸ’¬ [GitHub Discussions](https://github.com/DevAnimecx/jiro/discussions) β€” questions & ideas
392
+ - πŸ› [Issues](https://github.com/DevAnimecx/jiro/issues) β€” bugs & feature requests
393
+ - πŸ“œ [Contributing](CONTRIBUTING.md) Β· [Security](SECURITY.md) Β· [Code of Conduct](CODE_OF_CONDUCT.md)
394
+ - 🐦 Follow the launch: [@DevAnimecx](https://github.com/DevAnimecx)
395
+
396
+ ---
397
+
398
+ **Developed by [Adarsh Kushwah](https://github.com/DevAnimecx) Β· Blackvault Technology**
399
+ *Local-first, AI-native search & scraping β€” free, open, and yours to self-host.*