fetchserp 0.1.2 → 0.1.3
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.
- checksums.yaml +4 -4
- data/README.md +23 -0
- data/lib/fetchserp/client.rb +5 -0
- data/lib/fetchserp/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aee8e95fe03152c7170f302c9dc12708b6dd34be523518d19d68d06806faf1f0
|
4
|
+
data.tar.gz: 9e5bf93d85115a71444f7d012d91e202565e050ba22126e008ddbca3cf17f8ea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7b5f79d83dab6a5ac4a608aa47c90b8571a1cc9d898faa41f02f062ead8efd6cd93aef3d91a48d529d131fab0beafe987be01004d204fb1c08f57b42219db75c
|
7
|
+
data.tar.gz: e36ebed82d26a5e684a7010ed5b1ddab57c9081c030466e9e60fadbfc5da040e6d8e4862d1e8b3b62ddbb92d52d34d6f5e5bbf99c33bc65bef7a115f28b729f2
|
data/README.md
CHANGED
@@ -63,12 +63,14 @@ The client will raise `FetchSERP::Error` on any HTTP error (network, 4xx, 5xx) s
|
|
63
63
|
* `/api/v1/keywords_suggestions`
|
64
64
|
* `/api/v1/long_tail_keywords_generator`
|
65
65
|
* `/api/v1/page_indexation`
|
66
|
+
* `/api/v1/playwright_mcp`
|
66
67
|
* `/api/v1/ranking`
|
67
68
|
* `/api/v1/scrape`
|
68
69
|
* `/api/v1/scrape_domain`
|
69
70
|
* `/api/v1/scrape_js`
|
70
71
|
* `/api/v1/scrape_js_with_proxy`
|
71
72
|
* `/api/v1/serp`
|
73
|
+
* `/api/v1/serp_ai_mode`
|
72
74
|
* `/api/v1/serp_html`
|
73
75
|
* `/api/v1/serp_js` & `/api/v1/serp_js/{uuid}`
|
74
76
|
* `/api/v1/serp_text`
|
@@ -90,12 +92,14 @@ Below is the full list of convenience helpers exposed by `FetchSERP::Client`. Al
|
|
90
92
|
| `keywords_suggestions(url: nil, keywords: nil, **opts)` | `GET /api/v1/keywords_suggestions` | one of `url` or `keywords` |
|
91
93
|
| `long_tail_keywords_generator(keyword:, **opts)` | `GET /api/v1/long_tail_keywords_generator` | `keyword` |
|
92
94
|
| `page_indexation(domain:, keyword:)` | `GET /api/v1/page_indexation` | `domain`, `keyword` |
|
95
|
+
| `playwright_mcp(prompt:, **opts)` | `GET /api/v1/playwright_mcp` | `prompt` |
|
93
96
|
| `ranking(keyword:, domain:, **opts)` | `GET /api/v1/ranking` | `keyword`, `domain` |
|
94
97
|
| `scrape(url:)` | `GET /api/v1/scrape` | `url` |
|
95
98
|
| `scrape_domain(domain:, **opts)` | `GET /api/v1/scrape_domain` | `domain` |
|
96
99
|
| `scrape_js(url:, js_script: nil)` | `POST /api/v1/scrape_js` | `url` |
|
97
100
|
| `scrape_js_with_proxy(url:, country:, js_script: nil)` | `POST /api/v1/scrape_js_with_proxy` | `url`, `country` |
|
98
101
|
| `serp(query:, **opts)` | `GET /api/v1/serp` | `query` |
|
102
|
+
| `serp_ai_mode(query:, **opts)` | `GET /api/v1/serp_ai_mode` | `query` |
|
99
103
|
| `serp_html(query:, **opts)` | `GET /api/v1/serp_html` | `query` |
|
100
104
|
| `serp_js(query:, **opts)` | `GET /api/v1/serp_js` | `query` |
|
101
105
|
| `serp_js_content(uuid:)` | `GET /api/v1/serp_js/{uuid}` | `uuid` |
|
@@ -113,6 +117,25 @@ resp = client.keywords_suggestions(keywords: ["ruby sdk", "seo api"], country: "
|
|
113
117
|
puts resp.data["keywords_suggestions"]
|
114
118
|
```
|
115
119
|
|
120
|
+
### Example — Get SERP AI Overview and AI Mode
|
121
|
+
|
122
|
+
```ruby
|
123
|
+
client = FetchSERP.new(api_key: ENV["FETCHSERP_API_KEY"])
|
124
|
+
|
125
|
+
# Get AI overview and AI mode response for a search query
|
126
|
+
resp = client.serp_ai_mode(query: "ruby programming best practices")
|
127
|
+
```
|
128
|
+
|
129
|
+
### Example — Remote control browser with Playwright MCP
|
130
|
+
|
131
|
+
```ruby
|
132
|
+
client = FetchSERP.new(api_key: ENV["FETCHSERP_API_KEY"])
|
133
|
+
|
134
|
+
# Use GPT-4.1 to remote control a browser via Playwright MCP
|
135
|
+
resp = client.playwright_mcp(prompt: "Navigate to google.com and search for 'ruby gems'")
|
136
|
+
puts resp.data["response"]
|
137
|
+
```
|
138
|
+
|
116
139
|
### Handling errors
|
117
140
|
|
118
141
|
Any 4xx/5xx response raises `FetchSERP::Error` which includes `status` and raw `body` so you can debug:
|
data/lib/fetchserp/client.rb
CHANGED
@@ -51,6 +51,11 @@ module FetchSERP
|
|
51
51
|
get("/api/v1/page_indexation", params)
|
52
52
|
end
|
53
53
|
|
54
|
+
# Playwright MCP - uses GPT-4.1 to remote control a browser via a Playwright MCP server
|
55
|
+
def playwright_mcp(**params)
|
56
|
+
get("/api/v1/playwright_mcp", params)
|
57
|
+
end
|
58
|
+
|
54
59
|
def ranking(**params)
|
55
60
|
get("/api/v1/ranking", params)
|
56
61
|
end
|
data/lib/fetchserp/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fetchserp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- FetchSERP
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-07-14 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A lightweight Ruby client for interacting with the FetchSERP API. Provides
|
14
14
|
helpers for authentication and convenient Ruby methods for each endpoint.
|