hermes-brightdata 0.2.0__tar.gz → 0.2.2__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 (36) hide show
  1. hermes_brightdata-0.2.2/PKG-INFO +175 -0
  2. hermes_brightdata-0.2.2/README.md +155 -0
  3. {hermes_brightdata-0.2.0 → hermes_brightdata-0.2.2}/brightdata_plugin/api.py +11 -1
  4. hermes_brightdata-0.2.2/hermes_brightdata.egg-info/PKG-INFO +175 -0
  5. {hermes_brightdata-0.2.0 → hermes_brightdata-0.2.2}/pyproject.toml +1 -1
  6. {hermes_brightdata-0.2.0 → hermes_brightdata-0.2.2}/tests/test_api_proxy.py +16 -0
  7. hermes_brightdata-0.2.0/PKG-INFO +0 -148
  8. hermes_brightdata-0.2.0/README.md +0 -128
  9. hermes_brightdata-0.2.0/hermes_brightdata.egg-info/PKG-INFO +0 -148
  10. {hermes_brightdata-0.2.0 → hermes_brightdata-0.2.2}/LICENSE +0 -0
  11. {hermes_brightdata-0.2.0 → hermes_brightdata-0.2.2}/brightdata_plugin/__init__.py +0 -0
  12. {hermes_brightdata-0.2.0 → hermes_brightdata-0.2.2}/brightdata_plugin/browser.py +0 -0
  13. {hermes_brightdata-0.2.0 → hermes_brightdata-0.2.2}/brightdata_plugin/config.py +0 -0
  14. {hermes_brightdata-0.2.0 → hermes_brightdata-0.2.2}/brightdata_plugin/counter.py +0 -0
  15. {hermes_brightdata-0.2.0 → hermes_brightdata-0.2.2}/brightdata_plugin/datasets.py +0 -0
  16. {hermes_brightdata-0.2.0 → hermes_brightdata-0.2.2}/brightdata_plugin/schemas.py +0 -0
  17. {hermes_brightdata-0.2.0 → hermes_brightdata-0.2.2}/brightdata_plugin/tools.py +0 -0
  18. {hermes_brightdata-0.2.0 → hermes_brightdata-0.2.2}/hermes_brightdata.egg-info/SOURCES.txt +0 -0
  19. {hermes_brightdata-0.2.0 → hermes_brightdata-0.2.2}/hermes_brightdata.egg-info/dependency_links.txt +0 -0
  20. {hermes_brightdata-0.2.0 → hermes_brightdata-0.2.2}/hermes_brightdata.egg-info/entry_points.txt +0 -0
  21. {hermes_brightdata-0.2.0 → hermes_brightdata-0.2.2}/hermes_brightdata.egg-info/requires.txt +0 -0
  22. {hermes_brightdata-0.2.0 → hermes_brightdata-0.2.2}/hermes_brightdata.egg-info/top_level.txt +0 -0
  23. {hermes_brightdata-0.2.0 → hermes_brightdata-0.2.2}/setup.cfg +0 -0
  24. {hermes_brightdata-0.2.0 → hermes_brightdata-0.2.2}/tests/test_api_dataset.py +0 -0
  25. {hermes_brightdata-0.2.0 → hermes_brightdata-0.2.2}/tests/test_api_request.py +0 -0
  26. {hermes_brightdata-0.2.0 → hermes_brightdata-0.2.2}/tests/test_browser.py +0 -0
  27. {hermes_brightdata-0.2.0 → hermes_brightdata-0.2.2}/tests/test_config.py +0 -0
  28. {hermes_brightdata-0.2.0 → hermes_brightdata-0.2.2}/tests/test_counter.py +0 -0
  29. {hermes_brightdata-0.2.0 → hermes_brightdata-0.2.2}/tests/test_datasets.py +0 -0
  30. {hermes_brightdata-0.2.0 → hermes_brightdata-0.2.2}/tests/test_handler_contract.py +0 -0
  31. {hermes_brightdata-0.2.0 → hermes_brightdata-0.2.2}/tests/test_live_smoke.py +0 -0
  32. {hermes_brightdata-0.2.0 → hermes_brightdata-0.2.2}/tests/test_manifest.py +0 -0
  33. {hermes_brightdata-0.2.0 → hermes_brightdata-0.2.2}/tests/test_register.py +0 -0
  34. {hermes_brightdata-0.2.0 → hermes_brightdata-0.2.2}/tests/test_schemas.py +0 -0
  35. {hermes_brightdata-0.2.0 → hermes_brightdata-0.2.2}/tests/test_tools_browser.py +0 -0
  36. {hermes_brightdata-0.2.0 → hermes_brightdata-0.2.2}/tests/test_tools_core.py +0 -0
@@ -0,0 +1,175 @@
1
+ Metadata-Version: 2.4
2
+ Name: hermes-brightdata
3
+ Version: 0.2.2
4
+ Summary: Bright Data web data tools for Hermes Agent — search, scrape, structured datasets, residential proxy, and browser automation
5
+ License: MIT
6
+ Project-URL: Homepage, https://github.com/dandacompany/hermes-brightdata-plugin
7
+ Project-URL: Repository, https://github.com/dandacompany/hermes-brightdata-plugin
8
+ Keywords: hermes,bright-data,brightdata,web-scraping,plugin,agent
9
+ Requires-Python: >=3.10
10
+ Description-Content-Type: text/markdown
11
+ License-File: LICENSE
12
+ Requires-Dist: requests>=2.31
13
+ Provides-Extra: browser
14
+ Requires-Dist: playwright>=1.40; extra == "browser"
15
+ Provides-Extra: dev
16
+ Requires-Dist: pytest>=8; extra == "dev"
17
+ Requires-Dist: responses>=0.25; extra == "dev"
18
+ Requires-Dist: pyyaml>=6; extra == "dev"
19
+ Dynamic: license-file
20
+
21
+ # hermes-brightdata
22
+
23
+ **Bright Data web data tools for [NousResearch Hermes Agent](https://hermes-agent.nousresearch.com) — search, scrape, structured datasets, residential proxy, and browser automation.**
24
+
25
+ [![CI](https://github.com/dandacompany/hermes-brightdata-plugin/actions/workflows/ci.yml/badge.svg)](https://github.com/dandacompany/hermes-brightdata-plugin/actions/workflows/ci.yml)
26
+ [![PyPI version](https://img.shields.io/pypi/v/hermes-brightdata.svg)](https://pypi.org/project/hermes-brightdata/)
27
+ [![Python](https://img.shields.io/pypi/pyversions/hermes-brightdata.svg)](https://pypi.org/project/hermes-brightdata/)
28
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
29
+
30
+ 한국어 문서: [README.ko.md](./README.ko.md)
31
+
32
+ This plugin exposes Bright Data's web data platform as **ten native Hermes tools**. Unlike an MCP server, these tools are also available inside `delegate_task` subagents, which do not inherit the parent's MCP toolsets. It is pure Python (`requests` + optional `playwright`) with no Node runtime.
33
+
34
+ Bright Data handles the hard parts of web data collection — proxy rotation, header management, bot/CAPTCHA bypass, JavaScript rendering, and structured parsing. The plugin keeps handlers thin over focused domain modules, so each tool is a small, testable surface.
35
+
36
+ ## Why this plugin
37
+
38
+ - **Search & scrape** — real-time SERP search, and single/batch URL scraping to clean markdown via Web Unlocker.
39
+ - **Structured datasets** — one `web_data` tool covers 23 platforms (Amazon, LinkedIn, Instagram, TikTok, Facebook, YouTube, X, Crunchbase) through a single `platform` argument.
40
+ - **Residential proxy** — geo-targeted fetching through real residential IPs.
41
+ - **Browser automation** — a persistent CDP Scraping Browser session for interactive flows.
42
+
43
+ ## Requirements
44
+
45
+ - Python 3.10+
46
+ - A Bright Data account and API token (`BRIGHTDATA_API_TOKEN`)
47
+ - For `browser_*` tools: the `[browser]` extra (Playwright) and `BRIGHTDATA_BROWSER_AUTH`. The core five tools run on `requests` alone.
48
+
49
+ ## Install
50
+
51
+ ### Option A — pip (recommended)
52
+
53
+ The plugin ships on PyPI and registers with Hermes via an entry point:
54
+
55
+ ```bash
56
+ pip install hermes-brightdata # core tools
57
+ pip install "hermes-brightdata[browser]" # + browser automation (Playwright)
58
+ ```
59
+
60
+ ### Option B — from source
61
+
62
+ ```bash
63
+ git clone https://github.com/dandacompany/hermes-brightdata-plugin ~/src/hermes-brightdata-plugin
64
+ cd ~/src/hermes-brightdata-plugin
65
+ pip install -e ".[browser]"
66
+ ```
67
+
68
+ ### Verify
69
+
70
+ ```bash
71
+ hermes plugins list # brightdata appears, not enabled (opt-in by default)
72
+ hermes plugins enable brightdata
73
+ ```
74
+
75
+ Answer `no` to any tool-override prompt. Restart the gateway (`hermes gateway restart`) or `/reset` a session if the tools do not appear immediately.
76
+
77
+ ## Quick start
78
+
79
+ ```bash
80
+ export BRIGHTDATA_API_TOKEN="your-api-token-here"
81
+ hermes plugins enable brightdata
82
+ ```
83
+
84
+ The agent can now call the tools. Example arguments:
85
+
86
+ - `scrape` → `{"url": "https://example.com"}`
87
+ - `search_engine` → `{"query": "bright data", "engine": "google"}`
88
+ - `web_data` → `{"platform": "amazon_product", "url": "https://www.amazon.com/dp/..."}`
89
+ - `proxy_scrape` → `{"url": "https://...", "country": "us"}`
90
+
91
+ Every tool returns a JSON string; failures come back as `{"error": ..., "hint": ...}` rather than raising.
92
+
93
+ ## Tools
94
+
95
+ | Tool | What it does | Notes |
96
+ | ------------------ | -------------------------------------------------------------- | --------------------------------------------------------------------------- |
97
+ | `search_engine` | Web search via Bright Data SERP API, returning parsed results | Bypasses bot detection; more reliable than a built-in web search |
98
+ | `scrape` | Fetch a single URL as clean markdown or html | Web Unlocker — handles JS, CAPTCHAs, bot detection |
99
+ | `scrape_batch` | Scrape multiple URLs in one call (max 20) | Per-URL content or error; individual failures are isolated |
100
+ | `web_data` | Structured JSON from a supported platform | Web Scraper API — clean fields, not raw HTML; may take up to a minute |
101
+ | `proxy_scrape` | Fetch a URL through a residential proxy, optionally by country | Requires `BRIGHTDATA_PROXY_AUTH` |
102
+ | `session_stats` | Report Bright Data tool call counts for this session | — |
103
+ | `browser_navigate` | Open a URL in a Scraping Browser (persistent CDP session) | Requires the `[browser]` extra and `BRIGHTDATA_BROWSER_AUTH` |
104
+ | `browser_snapshot` | ARIA snapshot (accessibility tree) of the current page | For reading page structure and content |
105
+ | `browser_act` | `click`, `type`, `scroll`, or `wait` on the current page | Target `click`/`type` with a CSS or text selector (`#submit`, `text=Login`) |
106
+ | `browser_get` | Read the current page: `html`, `text`, or base64 `screenshot` | — |
107
+
108
+ The Scraping Browser session is created lazily on the first `browser_navigate` and closed automatically on session end.
109
+
110
+ ### Supported `web_data` platforms
111
+
112
+ Pass one as the `platform` argument (all take a URL); an unknown value returns an error listing the available ones.
113
+
114
+ | Group | Platforms |
115
+ | ----------- | ----------------------------------------------------------------------------------------- |
116
+ | Amazon | `amazon_product`, `amazon_product_reviews`, `amazon_product_search`, `amazon_seller_info` |
117
+ | LinkedIn | `linkedin_person`, `linkedin_company`, `linkedin_job_listings`, `linkedin_posts` |
118
+ | Instagram | `instagram_profile`, `instagram_posts`, `instagram_reels`, `instagram_comments` |
119
+ | TikTok | `tiktok_profiles`, `tiktok_posts`, `tiktok_comments` |
120
+ | Facebook | `facebook_posts`, `facebook_profiles` |
121
+ | YouTube | `youtube_videos`, `youtube_profiles`, `youtube_comments` |
122
+ | X (Twitter) | `x_posts`, `x_profile_posts` |
123
+ | Business | `crunchbase_company` |
124
+
125
+ ## Configuration
126
+
127
+ Credentials are read from environment variables.
128
+
129
+ **Required**
130
+
131
+ | Variable | Notes |
132
+ | ---------------------- | -------------------------------------------------------------------------------------------------- |
133
+ | `BRIGHTDATA_API_TOKEN` | Bright Data API token (Account Settings → API keys). `BRIGHTDATA_API_KEY` is accepted as an alias. |
134
+
135
+ **Optional**
136
+
137
+ | Variable | Purpose | Default |
138
+ | ------------------------------ | ----------------------------------------------------------------------------- | ------------------------- |
139
+ | `BRIGHTDATA_WEB_UNLOCKER_ZONE` | Web Unlocker zone (alias: `WEB_UNLOCKER_ZONE`) | `web_unlocker1` |
140
+ | `BRIGHTDATA_SERP_ZONE` | SERP API zone | `serp_api1` |
141
+ | `BRIGHTDATA_BROWSER_AUTH` | Scraping Browser auth `brd-customer-<id>-zone-<zone>:<password>` | — |
142
+ | `BRIGHTDATA_PROXY_AUTH` | Residential proxy auth `brd-customer-<id>-zone-<residential-zone>:<password>` | — |
143
+ | `BRIGHTDATA_PROXY_CA` | Path to the Bright Data proxy CA cert (HTTPS via proxy, port 33335) | — |
144
+ | `BRIGHTDATA_PROXY_HOST` | Proxy `host:port` | `brd.superproxy.io:33335` |
145
+
146
+ ## Development
147
+
148
+ ```bash
149
+ git clone https://github.com/dandacompany/hermes-brightdata-plugin
150
+ cd hermes-brightdata-plugin
151
+ pip install -e ".[dev]"
152
+ pytest
153
+ ```
154
+
155
+ CI runs the suite across Python 3.10–3.13 on every push. The plugin is organized as thin handlers (`tools.py`) over focused domain modules (`api.py`, `browser.py`, `datasets.py`, `config.py`, `counter.py`). Every handler follows the same contract: it always returns a JSON string, accepts `**kwargs`, and never propagates exceptions.
156
+
157
+ ## Security
158
+
159
+ The plugin talks to Bright Data over HTTPS and, in browser/proxy modes, drives a remote browser and a residential proxy. Handling of that surface:
160
+
161
+ - **Credentials never leak into output.** API errors carry only status codes and hints; response bodies and the token are never serialized. On a browser connection failure the raw exception (which can embed the CDP URL, including the proxy password) is replaced with a scrubbed message.
162
+ - **Proxy `country` is validated.** The `country` argument is LLM-supplied and is inserted into the proxy URL's userinfo section, so it is strictly validated as a 2-letter ISO code and the userinfo is URL-encoded — a value like `us:pw@evil` cannot break out and redirect credentials.
163
+ - **HTTPS through the proxy is verified against the Bright Data CA.** OpenSSL 3's strict Authority-Key-Identifier check (which the Bright Data proxy CA cert lacks) is relaxed, but the certificate chain is still validated against the provided CA — not disabled.
164
+
165
+ ## License
166
+
167
+ [MIT](./LICENSE) © Dante Labs
168
+
169
+ ---
170
+
171
+ <div align="center">
172
+
173
+ **Dante Labs** · **YouTube** [@dante-labs](https://youtube.com/@dante-labs) · **Email** [dante@dante-labs.com](mailto:dante@dante-labs.com) · **Discord** [Dante Labs Community](https://discord.com/invite/rXyy5e9ujs) · **Support** [Buy Me a Coffee](https://buymeacoffee.com/dante.labs)
174
+
175
+ </div>
@@ -0,0 +1,155 @@
1
+ # hermes-brightdata
2
+
3
+ **Bright Data web data tools for [NousResearch Hermes Agent](https://hermes-agent.nousresearch.com) — search, scrape, structured datasets, residential proxy, and browser automation.**
4
+
5
+ [![CI](https://github.com/dandacompany/hermes-brightdata-plugin/actions/workflows/ci.yml/badge.svg)](https://github.com/dandacompany/hermes-brightdata-plugin/actions/workflows/ci.yml)
6
+ [![PyPI version](https://img.shields.io/pypi/v/hermes-brightdata.svg)](https://pypi.org/project/hermes-brightdata/)
7
+ [![Python](https://img.shields.io/pypi/pyversions/hermes-brightdata.svg)](https://pypi.org/project/hermes-brightdata/)
8
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
9
+
10
+ 한국어 문서: [README.ko.md](./README.ko.md)
11
+
12
+ This plugin exposes Bright Data's web data platform as **ten native Hermes tools**. Unlike an MCP server, these tools are also available inside `delegate_task` subagents, which do not inherit the parent's MCP toolsets. It is pure Python (`requests` + optional `playwright`) with no Node runtime.
13
+
14
+ Bright Data handles the hard parts of web data collection — proxy rotation, header management, bot/CAPTCHA bypass, JavaScript rendering, and structured parsing. The plugin keeps handlers thin over focused domain modules, so each tool is a small, testable surface.
15
+
16
+ ## Why this plugin
17
+
18
+ - **Search & scrape** — real-time SERP search, and single/batch URL scraping to clean markdown via Web Unlocker.
19
+ - **Structured datasets** — one `web_data` tool covers 23 platforms (Amazon, LinkedIn, Instagram, TikTok, Facebook, YouTube, X, Crunchbase) through a single `platform` argument.
20
+ - **Residential proxy** — geo-targeted fetching through real residential IPs.
21
+ - **Browser automation** — a persistent CDP Scraping Browser session for interactive flows.
22
+
23
+ ## Requirements
24
+
25
+ - Python 3.10+
26
+ - A Bright Data account and API token (`BRIGHTDATA_API_TOKEN`)
27
+ - For `browser_*` tools: the `[browser]` extra (Playwright) and `BRIGHTDATA_BROWSER_AUTH`. The core five tools run on `requests` alone.
28
+
29
+ ## Install
30
+
31
+ ### Option A — pip (recommended)
32
+
33
+ The plugin ships on PyPI and registers with Hermes via an entry point:
34
+
35
+ ```bash
36
+ pip install hermes-brightdata # core tools
37
+ pip install "hermes-brightdata[browser]" # + browser automation (Playwright)
38
+ ```
39
+
40
+ ### Option B — from source
41
+
42
+ ```bash
43
+ git clone https://github.com/dandacompany/hermes-brightdata-plugin ~/src/hermes-brightdata-plugin
44
+ cd ~/src/hermes-brightdata-plugin
45
+ pip install -e ".[browser]"
46
+ ```
47
+
48
+ ### Verify
49
+
50
+ ```bash
51
+ hermes plugins list # brightdata appears, not enabled (opt-in by default)
52
+ hermes plugins enable brightdata
53
+ ```
54
+
55
+ Answer `no` to any tool-override prompt. Restart the gateway (`hermes gateway restart`) or `/reset` a session if the tools do not appear immediately.
56
+
57
+ ## Quick start
58
+
59
+ ```bash
60
+ export BRIGHTDATA_API_TOKEN="your-api-token-here"
61
+ hermes plugins enable brightdata
62
+ ```
63
+
64
+ The agent can now call the tools. Example arguments:
65
+
66
+ - `scrape` → `{"url": "https://example.com"}`
67
+ - `search_engine` → `{"query": "bright data", "engine": "google"}`
68
+ - `web_data` → `{"platform": "amazon_product", "url": "https://www.amazon.com/dp/..."}`
69
+ - `proxy_scrape` → `{"url": "https://...", "country": "us"}`
70
+
71
+ Every tool returns a JSON string; failures come back as `{"error": ..., "hint": ...}` rather than raising.
72
+
73
+ ## Tools
74
+
75
+ | Tool | What it does | Notes |
76
+ | ------------------ | -------------------------------------------------------------- | --------------------------------------------------------------------------- |
77
+ | `search_engine` | Web search via Bright Data SERP API, returning parsed results | Bypasses bot detection; more reliable than a built-in web search |
78
+ | `scrape` | Fetch a single URL as clean markdown or html | Web Unlocker — handles JS, CAPTCHAs, bot detection |
79
+ | `scrape_batch` | Scrape multiple URLs in one call (max 20) | Per-URL content or error; individual failures are isolated |
80
+ | `web_data` | Structured JSON from a supported platform | Web Scraper API — clean fields, not raw HTML; may take up to a minute |
81
+ | `proxy_scrape` | Fetch a URL through a residential proxy, optionally by country | Requires `BRIGHTDATA_PROXY_AUTH` |
82
+ | `session_stats` | Report Bright Data tool call counts for this session | — |
83
+ | `browser_navigate` | Open a URL in a Scraping Browser (persistent CDP session) | Requires the `[browser]` extra and `BRIGHTDATA_BROWSER_AUTH` |
84
+ | `browser_snapshot` | ARIA snapshot (accessibility tree) of the current page | For reading page structure and content |
85
+ | `browser_act` | `click`, `type`, `scroll`, or `wait` on the current page | Target `click`/`type` with a CSS or text selector (`#submit`, `text=Login`) |
86
+ | `browser_get` | Read the current page: `html`, `text`, or base64 `screenshot` | — |
87
+
88
+ The Scraping Browser session is created lazily on the first `browser_navigate` and closed automatically on session end.
89
+
90
+ ### Supported `web_data` platforms
91
+
92
+ Pass one as the `platform` argument (all take a URL); an unknown value returns an error listing the available ones.
93
+
94
+ | Group | Platforms |
95
+ | ----------- | ----------------------------------------------------------------------------------------- |
96
+ | Amazon | `amazon_product`, `amazon_product_reviews`, `amazon_product_search`, `amazon_seller_info` |
97
+ | LinkedIn | `linkedin_person`, `linkedin_company`, `linkedin_job_listings`, `linkedin_posts` |
98
+ | Instagram | `instagram_profile`, `instagram_posts`, `instagram_reels`, `instagram_comments` |
99
+ | TikTok | `tiktok_profiles`, `tiktok_posts`, `tiktok_comments` |
100
+ | Facebook | `facebook_posts`, `facebook_profiles` |
101
+ | YouTube | `youtube_videos`, `youtube_profiles`, `youtube_comments` |
102
+ | X (Twitter) | `x_posts`, `x_profile_posts` |
103
+ | Business | `crunchbase_company` |
104
+
105
+ ## Configuration
106
+
107
+ Credentials are read from environment variables.
108
+
109
+ **Required**
110
+
111
+ | Variable | Notes |
112
+ | ---------------------- | -------------------------------------------------------------------------------------------------- |
113
+ | `BRIGHTDATA_API_TOKEN` | Bright Data API token (Account Settings → API keys). `BRIGHTDATA_API_KEY` is accepted as an alias. |
114
+
115
+ **Optional**
116
+
117
+ | Variable | Purpose | Default |
118
+ | ------------------------------ | ----------------------------------------------------------------------------- | ------------------------- |
119
+ | `BRIGHTDATA_WEB_UNLOCKER_ZONE` | Web Unlocker zone (alias: `WEB_UNLOCKER_ZONE`) | `web_unlocker1` |
120
+ | `BRIGHTDATA_SERP_ZONE` | SERP API zone | `serp_api1` |
121
+ | `BRIGHTDATA_BROWSER_AUTH` | Scraping Browser auth `brd-customer-<id>-zone-<zone>:<password>` | — |
122
+ | `BRIGHTDATA_PROXY_AUTH` | Residential proxy auth `brd-customer-<id>-zone-<residential-zone>:<password>` | — |
123
+ | `BRIGHTDATA_PROXY_CA` | Path to the Bright Data proxy CA cert (HTTPS via proxy, port 33335) | — |
124
+ | `BRIGHTDATA_PROXY_HOST` | Proxy `host:port` | `brd.superproxy.io:33335` |
125
+
126
+ ## Development
127
+
128
+ ```bash
129
+ git clone https://github.com/dandacompany/hermes-brightdata-plugin
130
+ cd hermes-brightdata-plugin
131
+ pip install -e ".[dev]"
132
+ pytest
133
+ ```
134
+
135
+ CI runs the suite across Python 3.10–3.13 on every push. The plugin is organized as thin handlers (`tools.py`) over focused domain modules (`api.py`, `browser.py`, `datasets.py`, `config.py`, `counter.py`). Every handler follows the same contract: it always returns a JSON string, accepts `**kwargs`, and never propagates exceptions.
136
+
137
+ ## Security
138
+
139
+ The plugin talks to Bright Data over HTTPS and, in browser/proxy modes, drives a remote browser and a residential proxy. Handling of that surface:
140
+
141
+ - **Credentials never leak into output.** API errors carry only status codes and hints; response bodies and the token are never serialized. On a browser connection failure the raw exception (which can embed the CDP URL, including the proxy password) is replaced with a scrubbed message.
142
+ - **Proxy `country` is validated.** The `country` argument is LLM-supplied and is inserted into the proxy URL's userinfo section, so it is strictly validated as a 2-letter ISO code and the userinfo is URL-encoded — a value like `us:pw@evil` cannot break out and redirect credentials.
143
+ - **HTTPS through the proxy is verified against the Bright Data CA.** OpenSSL 3's strict Authority-Key-Identifier check (which the Bright Data proxy CA cert lacks) is relaxed, but the certificate chain is still validated against the provided CA — not disabled.
144
+
145
+ ## License
146
+
147
+ [MIT](./LICENSE) © Dante Labs
148
+
149
+ ---
150
+
151
+ <div align="center">
152
+
153
+ **Dante Labs** · **YouTube** [@dante-labs](https://youtube.com/@dante-labs) · **Email** [dante@dante-labs.com](mailto:dante@dante-labs.com) · **Discord** [Dante Labs Community](https://discord.com/invite/rXyy5e9ujs) · **Support** [Buy Me a Coffee](https://buymeacoffee.com/dante.labs)
154
+
155
+ </div>
@@ -1,7 +1,9 @@
1
1
  from __future__ import annotations
2
2
 
3
+ import re
3
4
  import ssl
4
5
  import time
6
+ from urllib.parse import quote
5
7
 
6
8
  import requests
7
9
  from requests.adapters import HTTPAdapter
@@ -96,8 +98,16 @@ class BrightDataClient:
96
98
  # inserts '-country-<cc>' into the username before the password.
97
99
  user, _, password = self._cfg.proxy_auth.partition(":")
98
100
  if country:
101
+ # country is LLM-supplied — reject anything but a 2-letter ISO code so it
102
+ # cannot inject '@'/':'/'/' and break out of the userinfo section.
103
+ if not re.fullmatch(r"[A-Za-z]{2}", country):
104
+ raise BrightDataError(
105
+ "invalid country code", status=0,
106
+ hint="country must be a 2-letter ISO code (e.g. 'us')")
99
107
  user = f"{user}-country-{country.lower()}"
100
- return f"http://{user}:{password}@{self._cfg.proxy_host}"
108
+ # URL-encode userinfo as defense-in-depth against stray reserved characters.
109
+ return (f"http://{quote(user, safe='')}:{quote(password, safe='')}"
110
+ f"@{self._cfg.proxy_host}")
101
111
 
102
112
  def proxy_scrape(self, url: str, country: str | None = None) -> str:
103
113
  if not self._cfg.proxy_auth:
@@ -0,0 +1,175 @@
1
+ Metadata-Version: 2.4
2
+ Name: hermes-brightdata
3
+ Version: 0.2.2
4
+ Summary: Bright Data web data tools for Hermes Agent — search, scrape, structured datasets, residential proxy, and browser automation
5
+ License: MIT
6
+ Project-URL: Homepage, https://github.com/dandacompany/hermes-brightdata-plugin
7
+ Project-URL: Repository, https://github.com/dandacompany/hermes-brightdata-plugin
8
+ Keywords: hermes,bright-data,brightdata,web-scraping,plugin,agent
9
+ Requires-Python: >=3.10
10
+ Description-Content-Type: text/markdown
11
+ License-File: LICENSE
12
+ Requires-Dist: requests>=2.31
13
+ Provides-Extra: browser
14
+ Requires-Dist: playwright>=1.40; extra == "browser"
15
+ Provides-Extra: dev
16
+ Requires-Dist: pytest>=8; extra == "dev"
17
+ Requires-Dist: responses>=0.25; extra == "dev"
18
+ Requires-Dist: pyyaml>=6; extra == "dev"
19
+ Dynamic: license-file
20
+
21
+ # hermes-brightdata
22
+
23
+ **Bright Data web data tools for [NousResearch Hermes Agent](https://hermes-agent.nousresearch.com) — search, scrape, structured datasets, residential proxy, and browser automation.**
24
+
25
+ [![CI](https://github.com/dandacompany/hermes-brightdata-plugin/actions/workflows/ci.yml/badge.svg)](https://github.com/dandacompany/hermes-brightdata-plugin/actions/workflows/ci.yml)
26
+ [![PyPI version](https://img.shields.io/pypi/v/hermes-brightdata.svg)](https://pypi.org/project/hermes-brightdata/)
27
+ [![Python](https://img.shields.io/pypi/pyversions/hermes-brightdata.svg)](https://pypi.org/project/hermes-brightdata/)
28
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
29
+
30
+ 한국어 문서: [README.ko.md](./README.ko.md)
31
+
32
+ This plugin exposes Bright Data's web data platform as **ten native Hermes tools**. Unlike an MCP server, these tools are also available inside `delegate_task` subagents, which do not inherit the parent's MCP toolsets. It is pure Python (`requests` + optional `playwright`) with no Node runtime.
33
+
34
+ Bright Data handles the hard parts of web data collection — proxy rotation, header management, bot/CAPTCHA bypass, JavaScript rendering, and structured parsing. The plugin keeps handlers thin over focused domain modules, so each tool is a small, testable surface.
35
+
36
+ ## Why this plugin
37
+
38
+ - **Search & scrape** — real-time SERP search, and single/batch URL scraping to clean markdown via Web Unlocker.
39
+ - **Structured datasets** — one `web_data` tool covers 23 platforms (Amazon, LinkedIn, Instagram, TikTok, Facebook, YouTube, X, Crunchbase) through a single `platform` argument.
40
+ - **Residential proxy** — geo-targeted fetching through real residential IPs.
41
+ - **Browser automation** — a persistent CDP Scraping Browser session for interactive flows.
42
+
43
+ ## Requirements
44
+
45
+ - Python 3.10+
46
+ - A Bright Data account and API token (`BRIGHTDATA_API_TOKEN`)
47
+ - For `browser_*` tools: the `[browser]` extra (Playwright) and `BRIGHTDATA_BROWSER_AUTH`. The core five tools run on `requests` alone.
48
+
49
+ ## Install
50
+
51
+ ### Option A — pip (recommended)
52
+
53
+ The plugin ships on PyPI and registers with Hermes via an entry point:
54
+
55
+ ```bash
56
+ pip install hermes-brightdata # core tools
57
+ pip install "hermes-brightdata[browser]" # + browser automation (Playwright)
58
+ ```
59
+
60
+ ### Option B — from source
61
+
62
+ ```bash
63
+ git clone https://github.com/dandacompany/hermes-brightdata-plugin ~/src/hermes-brightdata-plugin
64
+ cd ~/src/hermes-brightdata-plugin
65
+ pip install -e ".[browser]"
66
+ ```
67
+
68
+ ### Verify
69
+
70
+ ```bash
71
+ hermes plugins list # brightdata appears, not enabled (opt-in by default)
72
+ hermes plugins enable brightdata
73
+ ```
74
+
75
+ Answer `no` to any tool-override prompt. Restart the gateway (`hermes gateway restart`) or `/reset` a session if the tools do not appear immediately.
76
+
77
+ ## Quick start
78
+
79
+ ```bash
80
+ export BRIGHTDATA_API_TOKEN="your-api-token-here"
81
+ hermes plugins enable brightdata
82
+ ```
83
+
84
+ The agent can now call the tools. Example arguments:
85
+
86
+ - `scrape` → `{"url": "https://example.com"}`
87
+ - `search_engine` → `{"query": "bright data", "engine": "google"}`
88
+ - `web_data` → `{"platform": "amazon_product", "url": "https://www.amazon.com/dp/..."}`
89
+ - `proxy_scrape` → `{"url": "https://...", "country": "us"}`
90
+
91
+ Every tool returns a JSON string; failures come back as `{"error": ..., "hint": ...}` rather than raising.
92
+
93
+ ## Tools
94
+
95
+ | Tool | What it does | Notes |
96
+ | ------------------ | -------------------------------------------------------------- | --------------------------------------------------------------------------- |
97
+ | `search_engine` | Web search via Bright Data SERP API, returning parsed results | Bypasses bot detection; more reliable than a built-in web search |
98
+ | `scrape` | Fetch a single URL as clean markdown or html | Web Unlocker — handles JS, CAPTCHAs, bot detection |
99
+ | `scrape_batch` | Scrape multiple URLs in one call (max 20) | Per-URL content or error; individual failures are isolated |
100
+ | `web_data` | Structured JSON from a supported platform | Web Scraper API — clean fields, not raw HTML; may take up to a minute |
101
+ | `proxy_scrape` | Fetch a URL through a residential proxy, optionally by country | Requires `BRIGHTDATA_PROXY_AUTH` |
102
+ | `session_stats` | Report Bright Data tool call counts for this session | — |
103
+ | `browser_navigate` | Open a URL in a Scraping Browser (persistent CDP session) | Requires the `[browser]` extra and `BRIGHTDATA_BROWSER_AUTH` |
104
+ | `browser_snapshot` | ARIA snapshot (accessibility tree) of the current page | For reading page structure and content |
105
+ | `browser_act` | `click`, `type`, `scroll`, or `wait` on the current page | Target `click`/`type` with a CSS or text selector (`#submit`, `text=Login`) |
106
+ | `browser_get` | Read the current page: `html`, `text`, or base64 `screenshot` | — |
107
+
108
+ The Scraping Browser session is created lazily on the first `browser_navigate` and closed automatically on session end.
109
+
110
+ ### Supported `web_data` platforms
111
+
112
+ Pass one as the `platform` argument (all take a URL); an unknown value returns an error listing the available ones.
113
+
114
+ | Group | Platforms |
115
+ | ----------- | ----------------------------------------------------------------------------------------- |
116
+ | Amazon | `amazon_product`, `amazon_product_reviews`, `amazon_product_search`, `amazon_seller_info` |
117
+ | LinkedIn | `linkedin_person`, `linkedin_company`, `linkedin_job_listings`, `linkedin_posts` |
118
+ | Instagram | `instagram_profile`, `instagram_posts`, `instagram_reels`, `instagram_comments` |
119
+ | TikTok | `tiktok_profiles`, `tiktok_posts`, `tiktok_comments` |
120
+ | Facebook | `facebook_posts`, `facebook_profiles` |
121
+ | YouTube | `youtube_videos`, `youtube_profiles`, `youtube_comments` |
122
+ | X (Twitter) | `x_posts`, `x_profile_posts` |
123
+ | Business | `crunchbase_company` |
124
+
125
+ ## Configuration
126
+
127
+ Credentials are read from environment variables.
128
+
129
+ **Required**
130
+
131
+ | Variable | Notes |
132
+ | ---------------------- | -------------------------------------------------------------------------------------------------- |
133
+ | `BRIGHTDATA_API_TOKEN` | Bright Data API token (Account Settings → API keys). `BRIGHTDATA_API_KEY` is accepted as an alias. |
134
+
135
+ **Optional**
136
+
137
+ | Variable | Purpose | Default |
138
+ | ------------------------------ | ----------------------------------------------------------------------------- | ------------------------- |
139
+ | `BRIGHTDATA_WEB_UNLOCKER_ZONE` | Web Unlocker zone (alias: `WEB_UNLOCKER_ZONE`) | `web_unlocker1` |
140
+ | `BRIGHTDATA_SERP_ZONE` | SERP API zone | `serp_api1` |
141
+ | `BRIGHTDATA_BROWSER_AUTH` | Scraping Browser auth `brd-customer-<id>-zone-<zone>:<password>` | — |
142
+ | `BRIGHTDATA_PROXY_AUTH` | Residential proxy auth `brd-customer-<id>-zone-<residential-zone>:<password>` | — |
143
+ | `BRIGHTDATA_PROXY_CA` | Path to the Bright Data proxy CA cert (HTTPS via proxy, port 33335) | — |
144
+ | `BRIGHTDATA_PROXY_HOST` | Proxy `host:port` | `brd.superproxy.io:33335` |
145
+
146
+ ## Development
147
+
148
+ ```bash
149
+ git clone https://github.com/dandacompany/hermes-brightdata-plugin
150
+ cd hermes-brightdata-plugin
151
+ pip install -e ".[dev]"
152
+ pytest
153
+ ```
154
+
155
+ CI runs the suite across Python 3.10–3.13 on every push. The plugin is organized as thin handlers (`tools.py`) over focused domain modules (`api.py`, `browser.py`, `datasets.py`, `config.py`, `counter.py`). Every handler follows the same contract: it always returns a JSON string, accepts `**kwargs`, and never propagates exceptions.
156
+
157
+ ## Security
158
+
159
+ The plugin talks to Bright Data over HTTPS and, in browser/proxy modes, drives a remote browser and a residential proxy. Handling of that surface:
160
+
161
+ - **Credentials never leak into output.** API errors carry only status codes and hints; response bodies and the token are never serialized. On a browser connection failure the raw exception (which can embed the CDP URL, including the proxy password) is replaced with a scrubbed message.
162
+ - **Proxy `country` is validated.** The `country` argument is LLM-supplied and is inserted into the proxy URL's userinfo section, so it is strictly validated as a 2-letter ISO code and the userinfo is URL-encoded — a value like `us:pw@evil` cannot break out and redirect credentials.
163
+ - **HTTPS through the proxy is verified against the Bright Data CA.** OpenSSL 3's strict Authority-Key-Identifier check (which the Bright Data proxy CA cert lacks) is relaxed, but the certificate chain is still validated against the provided CA — not disabled.
164
+
165
+ ## License
166
+
167
+ [MIT](./LICENSE) © Dante Labs
168
+
169
+ ---
170
+
171
+ <div align="center">
172
+
173
+ **Dante Labs** · **YouTube** [@dante-labs](https://youtube.com/@dante-labs) · **Email** [dante@dante-labs.com](mailto:dante@dante-labs.com) · **Discord** [Dante Labs Community](https://discord.com/invite/rXyy5e9ujs) · **Support** [Buy Me a Coffee](https://buymeacoffee.com/dante.labs)
174
+
175
+ </div>
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "hermes-brightdata"
7
- version = "0.2.0"
7
+ version = "0.2.2"
8
8
  description = "Bright Data web data tools for Hermes Agent — search, scrape, structured datasets, residential proxy, and browser automation"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
@@ -45,3 +45,19 @@ def test_proxy_scrape_http_error_raises():
45
45
  with pytest.raises(BrightDataError) as exc:
46
46
  client.proxy_scrape("https://example.com")
47
47
  assert exc.value.status == 403
48
+
49
+
50
+ @pytest.mark.parametrize("bad", ["us@evil.com", "u", "usa", "us:pw@host", "u/x", ""])
51
+ def test_proxy_url_rejects_non_iso_country(bad):
52
+ client = BrightDataClient(PROXY_CFG)
53
+ if bad == "":
54
+ # empty string is falsy -> treated as no country, builds base URL
55
+ assert client._proxy_url(bad).endswith("@brd.superproxy.io:33335")
56
+ else:
57
+ with pytest.raises(BrightDataError):
58
+ client._proxy_url(bad)
59
+
60
+
61
+ def test_proxy_url_country_case_insensitive():
62
+ client = BrightDataClient(PROXY_CFG)
63
+ assert client._proxy_url("US") == client._proxy_url("us")
@@ -1,148 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: hermes-brightdata
3
- Version: 0.2.0
4
- Summary: Bright Data web data tools for Hermes Agent — search, scrape, structured datasets, residential proxy, and browser automation
5
- License: MIT
6
- Project-URL: Homepage, https://github.com/dandacompany/hermes-brightdata-plugin
7
- Project-URL: Repository, https://github.com/dandacompany/hermes-brightdata-plugin
8
- Keywords: hermes,bright-data,brightdata,web-scraping,plugin,agent
9
- Requires-Python: >=3.10
10
- Description-Content-Type: text/markdown
11
- License-File: LICENSE
12
- Requires-Dist: requests>=2.31
13
- Provides-Extra: browser
14
- Requires-Dist: playwright>=1.40; extra == "browser"
15
- Provides-Extra: dev
16
- Requires-Dist: pytest>=8; extra == "dev"
17
- Requires-Dist: responses>=0.25; extra == "dev"
18
- Requires-Dist: pyyaml>=6; extra == "dev"
19
- Dynamic: license-file
20
-
21
- # hermes-brightdata
22
-
23
- [![CI](https://github.com/dandacompany/hermes-brightdata-plugin/actions/workflows/ci.yml/badge.svg)](https://github.com/dandacompany/hermes-brightdata-plugin/actions/workflows/ci.yml)
24
- [![PyPI version](https://img.shields.io/pypi/v/hermes-brightdata.svg)](https://pypi.org/project/hermes-brightdata/)
25
- [![Python](https://img.shields.io/pypi/pyversions/hermes-brightdata.svg)](https://pypi.org/project/hermes-brightdata/)
26
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
27
-
28
- Bright Data web data tools for Hermes Agent — search, scrape, structured datasets, and browser automation.
29
-
30
- ## Overview
31
-
32
- This plugin integrates Bright Data's web data APIs with Hermes, providing ten powerful tools for web data collection:
33
-
34
- - **Search & Scraping**: Real-time search, single/batch URL scraping, and structured data extraction
35
- - **Browser Automation**: Interactive browser sessions with persistent cookies and JavaScript rendering
36
- - **Bypass Detection**: Automatic handling of bot detection, CAPTCHAs, and JavaScript-heavy sites
37
-
38
- Bright Data handles all the complexity — proxy rotation, header management, retry logic, and content parsing.
39
-
40
- ## Installation
41
-
42
- Install the plugin with base tools:
43
-
44
- ```bash
45
- pip install hermes-brightdata
46
- ```
47
-
48
- To enable browser automation tools, install with the `[browser]` extra:
49
-
50
- ```bash
51
- pip install hermes-brightdata[browser]
52
- ```
53
-
54
- The browser extra adds Playwright for interactive session handling (required for `browser_navigate`, `browser_snapshot`, `browser_act`, `browser_get`).
55
-
56
- ## Configuration
57
-
58
- Before using any Bright Data tool, set your API credentials in environment variables:
59
-
60
- ### Required
61
-
62
- `BRIGHTDATA_API_TOKEN` (required, secret)
63
-
64
- - Your Bright Data API token
65
- - Obtain from Account Settings → API keys in the Bright Data dashboard
66
- - `BRIGHTDATA_API_KEY` is accepted as an alias if `BRIGHTDATA_API_TOKEN` is unset
67
-
68
- ### Optional
69
-
70
- `BRIGHTDATA_WEB_UNLOCKER_ZONE` (optional)
71
-
72
- - Zone name for Web Unlocker API
73
- - Default: `web_unlocker1`
74
- - `WEB_UNLOCKER_ZONE` is accepted as an alias if the prefixed name is unset
75
-
76
- `BRIGHTDATA_SERP_ZONE` (optional)
77
-
78
- - Zone name for SERP (Search Engine Results Page) API
79
- - Default: `serp_api1`
80
-
81
- `BRIGHTDATA_BROWSER_AUTH` (optional, secret)
82
-
83
- - Authentication credentials for Scraping Browser
84
- - Format: `brd-customer-<customer-id>-zone-<zone-name>:<password>`
85
- - Required only if using browser tools with authentication
86
-
87
- `BRIGHTDATA_PROXY_AUTH` (optional, secret)
88
-
89
- - Residential proxy credentials for `proxy_scrape`
90
- - Format: `brd-customer-<customer-id>-zone-<residential-zone>:<password>`
91
-
92
- `BRIGHTDATA_PROXY_CA` (optional)
93
-
94
- - Path to the Bright Data proxy CA certificate (needed for HTTPS through the proxy on port 33335)
95
-
96
- `BRIGHTDATA_PROXY_HOST` (optional)
97
-
98
- - Proxy `host:port` (default `brd.superproxy.io:33335`)
99
-
100
- ### Example
101
-
102
- ```bash
103
- export BRIGHTDATA_API_TOKEN="your-api-token-here"
104
- export BRIGHTDATA_BROWSER_AUTH="brd-customer-12345-zone-myzone:password123"
105
- export BRIGHTDATA_PROXY_AUTH="brd-customer-12345-zone-residential:password123"
106
- export BRIGHTDATA_PROXY_CA="/path/to/BrightData_proxy_ca.crt"
107
- ```
108
-
109
- ## Tools
110
-
111
- The plugin provides ten tools:
112
-
113
- | Tool | Description |
114
- | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
115
- | `search_engine` | Search the web via Bright Data SERP API and return parsed results. Use for current events, fact-checking, finding pages, or any web search. Bypasses bot detection; more reliable than built-in web search. |
116
- | `scrape` | Fetch a single URL as clean markdown (or html) using Bright Data Web Unlocker. Handles JavaScript, CAPTCHAs, and bot detection. Use to read any webpage, article, doc, or site. |
117
- | `scrape_batch` | Scrape multiple URLs in one call (max 20). Returns per-URL content or error. Use when you have several pages to read at once. |
118
- | `web_data` | Get structured JSON data from a supported platform via Bright Data Web Scraper API (e.g. an Amazon product page, a LinkedIn profile). Returns clean structured fields, not raw HTML. May take up to a minute. |
119
- | `proxy_scrape` | Fetch a URL through a Bright Data residential proxy, optionally from a specific country. Use for geo-targeted content (region-specific pricing, localized pages). Requires `BRIGHTDATA_PROXY_AUTH`. |
120
- | `session_stats` | Report Bright Data tool call counts for this session. |
121
- | `browser_navigate` | Open a URL in a Bright Data Scraping Browser (real browser with a persistent session). Use for interactive flows requiring clicks/typing. Requires the [browser] extra and BRIGHTDATA_BROWSER_AUTH. |
122
- | `browser_snapshot` | Return an accessibility-tree snapshot of the current browser page, including element refs to use with browser_act. |
123
- | `browser_act` | Perform an action on the current browser page: click, type, scroll, or wait. Get element refs from browser_snapshot first. |
124
- | `browser_get` | Read the current browser page: html, text, or a base64 screenshot. |
125
-
126
- ## Activation
127
-
128
- Enable the plugin in Hermes:
129
-
130
- ```bash
131
- hermes plugins enable brightdata
132
- ```
133
-
134
- Verify it's loaded:
135
-
136
- ```bash
137
- hermes plugins list
138
- ```
139
-
140
- You should see `brightdata` listed with version `0.2.0`.
141
-
142
- ## Pricing
143
-
144
- Bright Data offers a free tier with up to 5,000 requests per month. For higher volume, refer to Bright Data's pricing page for details on Web Unlocker, SERP API, Web Scraper API, and Scraping Browser plans.
145
-
146
- ---
147
-
148
- For more information on Bright Data services, visit [https://brightdata.com](https://brightdata.com).
@@ -1,128 +0,0 @@
1
- # hermes-brightdata
2
-
3
- [![CI](https://github.com/dandacompany/hermes-brightdata-plugin/actions/workflows/ci.yml/badge.svg)](https://github.com/dandacompany/hermes-brightdata-plugin/actions/workflows/ci.yml)
4
- [![PyPI version](https://img.shields.io/pypi/v/hermes-brightdata.svg)](https://pypi.org/project/hermes-brightdata/)
5
- [![Python](https://img.shields.io/pypi/pyversions/hermes-brightdata.svg)](https://pypi.org/project/hermes-brightdata/)
6
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
7
-
8
- Bright Data web data tools for Hermes Agent — search, scrape, structured datasets, and browser automation.
9
-
10
- ## Overview
11
-
12
- This plugin integrates Bright Data's web data APIs with Hermes, providing ten powerful tools for web data collection:
13
-
14
- - **Search & Scraping**: Real-time search, single/batch URL scraping, and structured data extraction
15
- - **Browser Automation**: Interactive browser sessions with persistent cookies and JavaScript rendering
16
- - **Bypass Detection**: Automatic handling of bot detection, CAPTCHAs, and JavaScript-heavy sites
17
-
18
- Bright Data handles all the complexity — proxy rotation, header management, retry logic, and content parsing.
19
-
20
- ## Installation
21
-
22
- Install the plugin with base tools:
23
-
24
- ```bash
25
- pip install hermes-brightdata
26
- ```
27
-
28
- To enable browser automation tools, install with the `[browser]` extra:
29
-
30
- ```bash
31
- pip install hermes-brightdata[browser]
32
- ```
33
-
34
- The browser extra adds Playwright for interactive session handling (required for `browser_navigate`, `browser_snapshot`, `browser_act`, `browser_get`).
35
-
36
- ## Configuration
37
-
38
- Before using any Bright Data tool, set your API credentials in environment variables:
39
-
40
- ### Required
41
-
42
- `BRIGHTDATA_API_TOKEN` (required, secret)
43
-
44
- - Your Bright Data API token
45
- - Obtain from Account Settings → API keys in the Bright Data dashboard
46
- - `BRIGHTDATA_API_KEY` is accepted as an alias if `BRIGHTDATA_API_TOKEN` is unset
47
-
48
- ### Optional
49
-
50
- `BRIGHTDATA_WEB_UNLOCKER_ZONE` (optional)
51
-
52
- - Zone name for Web Unlocker API
53
- - Default: `web_unlocker1`
54
- - `WEB_UNLOCKER_ZONE` is accepted as an alias if the prefixed name is unset
55
-
56
- `BRIGHTDATA_SERP_ZONE` (optional)
57
-
58
- - Zone name for SERP (Search Engine Results Page) API
59
- - Default: `serp_api1`
60
-
61
- `BRIGHTDATA_BROWSER_AUTH` (optional, secret)
62
-
63
- - Authentication credentials for Scraping Browser
64
- - Format: `brd-customer-<customer-id>-zone-<zone-name>:<password>`
65
- - Required only if using browser tools with authentication
66
-
67
- `BRIGHTDATA_PROXY_AUTH` (optional, secret)
68
-
69
- - Residential proxy credentials for `proxy_scrape`
70
- - Format: `brd-customer-<customer-id>-zone-<residential-zone>:<password>`
71
-
72
- `BRIGHTDATA_PROXY_CA` (optional)
73
-
74
- - Path to the Bright Data proxy CA certificate (needed for HTTPS through the proxy on port 33335)
75
-
76
- `BRIGHTDATA_PROXY_HOST` (optional)
77
-
78
- - Proxy `host:port` (default `brd.superproxy.io:33335`)
79
-
80
- ### Example
81
-
82
- ```bash
83
- export BRIGHTDATA_API_TOKEN="your-api-token-here"
84
- export BRIGHTDATA_BROWSER_AUTH="brd-customer-12345-zone-myzone:password123"
85
- export BRIGHTDATA_PROXY_AUTH="brd-customer-12345-zone-residential:password123"
86
- export BRIGHTDATA_PROXY_CA="/path/to/BrightData_proxy_ca.crt"
87
- ```
88
-
89
- ## Tools
90
-
91
- The plugin provides ten tools:
92
-
93
- | Tool | Description |
94
- | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
95
- | `search_engine` | Search the web via Bright Data SERP API and return parsed results. Use for current events, fact-checking, finding pages, or any web search. Bypasses bot detection; more reliable than built-in web search. |
96
- | `scrape` | Fetch a single URL as clean markdown (or html) using Bright Data Web Unlocker. Handles JavaScript, CAPTCHAs, and bot detection. Use to read any webpage, article, doc, or site. |
97
- | `scrape_batch` | Scrape multiple URLs in one call (max 20). Returns per-URL content or error. Use when you have several pages to read at once. |
98
- | `web_data` | Get structured JSON data from a supported platform via Bright Data Web Scraper API (e.g. an Amazon product page, a LinkedIn profile). Returns clean structured fields, not raw HTML. May take up to a minute. |
99
- | `proxy_scrape` | Fetch a URL through a Bright Data residential proxy, optionally from a specific country. Use for geo-targeted content (region-specific pricing, localized pages). Requires `BRIGHTDATA_PROXY_AUTH`. |
100
- | `session_stats` | Report Bright Data tool call counts for this session. |
101
- | `browser_navigate` | Open a URL in a Bright Data Scraping Browser (real browser with a persistent session). Use for interactive flows requiring clicks/typing. Requires the [browser] extra and BRIGHTDATA_BROWSER_AUTH. |
102
- | `browser_snapshot` | Return an accessibility-tree snapshot of the current browser page, including element refs to use with browser_act. |
103
- | `browser_act` | Perform an action on the current browser page: click, type, scroll, or wait. Get element refs from browser_snapshot first. |
104
- | `browser_get` | Read the current browser page: html, text, or a base64 screenshot. |
105
-
106
- ## Activation
107
-
108
- Enable the plugin in Hermes:
109
-
110
- ```bash
111
- hermes plugins enable brightdata
112
- ```
113
-
114
- Verify it's loaded:
115
-
116
- ```bash
117
- hermes plugins list
118
- ```
119
-
120
- You should see `brightdata` listed with version `0.2.0`.
121
-
122
- ## Pricing
123
-
124
- Bright Data offers a free tier with up to 5,000 requests per month. For higher volume, refer to Bright Data's pricing page for details on Web Unlocker, SERP API, Web Scraper API, and Scraping Browser plans.
125
-
126
- ---
127
-
128
- For more information on Bright Data services, visit [https://brightdata.com](https://brightdata.com).
@@ -1,148 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: hermes-brightdata
3
- Version: 0.2.0
4
- Summary: Bright Data web data tools for Hermes Agent — search, scrape, structured datasets, residential proxy, and browser automation
5
- License: MIT
6
- Project-URL: Homepage, https://github.com/dandacompany/hermes-brightdata-plugin
7
- Project-URL: Repository, https://github.com/dandacompany/hermes-brightdata-plugin
8
- Keywords: hermes,bright-data,brightdata,web-scraping,plugin,agent
9
- Requires-Python: >=3.10
10
- Description-Content-Type: text/markdown
11
- License-File: LICENSE
12
- Requires-Dist: requests>=2.31
13
- Provides-Extra: browser
14
- Requires-Dist: playwright>=1.40; extra == "browser"
15
- Provides-Extra: dev
16
- Requires-Dist: pytest>=8; extra == "dev"
17
- Requires-Dist: responses>=0.25; extra == "dev"
18
- Requires-Dist: pyyaml>=6; extra == "dev"
19
- Dynamic: license-file
20
-
21
- # hermes-brightdata
22
-
23
- [![CI](https://github.com/dandacompany/hermes-brightdata-plugin/actions/workflows/ci.yml/badge.svg)](https://github.com/dandacompany/hermes-brightdata-plugin/actions/workflows/ci.yml)
24
- [![PyPI version](https://img.shields.io/pypi/v/hermes-brightdata.svg)](https://pypi.org/project/hermes-brightdata/)
25
- [![Python](https://img.shields.io/pypi/pyversions/hermes-brightdata.svg)](https://pypi.org/project/hermes-brightdata/)
26
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
27
-
28
- Bright Data web data tools for Hermes Agent — search, scrape, structured datasets, and browser automation.
29
-
30
- ## Overview
31
-
32
- This plugin integrates Bright Data's web data APIs with Hermes, providing ten powerful tools for web data collection:
33
-
34
- - **Search & Scraping**: Real-time search, single/batch URL scraping, and structured data extraction
35
- - **Browser Automation**: Interactive browser sessions with persistent cookies and JavaScript rendering
36
- - **Bypass Detection**: Automatic handling of bot detection, CAPTCHAs, and JavaScript-heavy sites
37
-
38
- Bright Data handles all the complexity — proxy rotation, header management, retry logic, and content parsing.
39
-
40
- ## Installation
41
-
42
- Install the plugin with base tools:
43
-
44
- ```bash
45
- pip install hermes-brightdata
46
- ```
47
-
48
- To enable browser automation tools, install with the `[browser]` extra:
49
-
50
- ```bash
51
- pip install hermes-brightdata[browser]
52
- ```
53
-
54
- The browser extra adds Playwright for interactive session handling (required for `browser_navigate`, `browser_snapshot`, `browser_act`, `browser_get`).
55
-
56
- ## Configuration
57
-
58
- Before using any Bright Data tool, set your API credentials in environment variables:
59
-
60
- ### Required
61
-
62
- `BRIGHTDATA_API_TOKEN` (required, secret)
63
-
64
- - Your Bright Data API token
65
- - Obtain from Account Settings → API keys in the Bright Data dashboard
66
- - `BRIGHTDATA_API_KEY` is accepted as an alias if `BRIGHTDATA_API_TOKEN` is unset
67
-
68
- ### Optional
69
-
70
- `BRIGHTDATA_WEB_UNLOCKER_ZONE` (optional)
71
-
72
- - Zone name for Web Unlocker API
73
- - Default: `web_unlocker1`
74
- - `WEB_UNLOCKER_ZONE` is accepted as an alias if the prefixed name is unset
75
-
76
- `BRIGHTDATA_SERP_ZONE` (optional)
77
-
78
- - Zone name for SERP (Search Engine Results Page) API
79
- - Default: `serp_api1`
80
-
81
- `BRIGHTDATA_BROWSER_AUTH` (optional, secret)
82
-
83
- - Authentication credentials for Scraping Browser
84
- - Format: `brd-customer-<customer-id>-zone-<zone-name>:<password>`
85
- - Required only if using browser tools with authentication
86
-
87
- `BRIGHTDATA_PROXY_AUTH` (optional, secret)
88
-
89
- - Residential proxy credentials for `proxy_scrape`
90
- - Format: `brd-customer-<customer-id>-zone-<residential-zone>:<password>`
91
-
92
- `BRIGHTDATA_PROXY_CA` (optional)
93
-
94
- - Path to the Bright Data proxy CA certificate (needed for HTTPS through the proxy on port 33335)
95
-
96
- `BRIGHTDATA_PROXY_HOST` (optional)
97
-
98
- - Proxy `host:port` (default `brd.superproxy.io:33335`)
99
-
100
- ### Example
101
-
102
- ```bash
103
- export BRIGHTDATA_API_TOKEN="your-api-token-here"
104
- export BRIGHTDATA_BROWSER_AUTH="brd-customer-12345-zone-myzone:password123"
105
- export BRIGHTDATA_PROXY_AUTH="brd-customer-12345-zone-residential:password123"
106
- export BRIGHTDATA_PROXY_CA="/path/to/BrightData_proxy_ca.crt"
107
- ```
108
-
109
- ## Tools
110
-
111
- The plugin provides ten tools:
112
-
113
- | Tool | Description |
114
- | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
115
- | `search_engine` | Search the web via Bright Data SERP API and return parsed results. Use for current events, fact-checking, finding pages, or any web search. Bypasses bot detection; more reliable than built-in web search. |
116
- | `scrape` | Fetch a single URL as clean markdown (or html) using Bright Data Web Unlocker. Handles JavaScript, CAPTCHAs, and bot detection. Use to read any webpage, article, doc, or site. |
117
- | `scrape_batch` | Scrape multiple URLs in one call (max 20). Returns per-URL content or error. Use when you have several pages to read at once. |
118
- | `web_data` | Get structured JSON data from a supported platform via Bright Data Web Scraper API (e.g. an Amazon product page, a LinkedIn profile). Returns clean structured fields, not raw HTML. May take up to a minute. |
119
- | `proxy_scrape` | Fetch a URL through a Bright Data residential proxy, optionally from a specific country. Use for geo-targeted content (region-specific pricing, localized pages). Requires `BRIGHTDATA_PROXY_AUTH`. |
120
- | `session_stats` | Report Bright Data tool call counts for this session. |
121
- | `browser_navigate` | Open a URL in a Bright Data Scraping Browser (real browser with a persistent session). Use for interactive flows requiring clicks/typing. Requires the [browser] extra and BRIGHTDATA_BROWSER_AUTH. |
122
- | `browser_snapshot` | Return an accessibility-tree snapshot of the current browser page, including element refs to use with browser_act. |
123
- | `browser_act` | Perform an action on the current browser page: click, type, scroll, or wait. Get element refs from browser_snapshot first. |
124
- | `browser_get` | Read the current browser page: html, text, or a base64 screenshot. |
125
-
126
- ## Activation
127
-
128
- Enable the plugin in Hermes:
129
-
130
- ```bash
131
- hermes plugins enable brightdata
132
- ```
133
-
134
- Verify it's loaded:
135
-
136
- ```bash
137
- hermes plugins list
138
- ```
139
-
140
- You should see `brightdata` listed with version `0.2.0`.
141
-
142
- ## Pricing
143
-
144
- Bright Data offers a free tier with up to 5,000 requests per month. For higher volume, refer to Bright Data's pricing page for details on Web Unlocker, SERP API, Web Scraper API, and Scraping Browser plans.
145
-
146
- ---
147
-
148
- For more information on Bright Data services, visit [https://brightdata.com](https://brightdata.com).