fetchserp 0.1.2 → 0.1.4
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 +67 -1
- data/lib/fetchserp/client.rb +15 -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: 91466f965fcbd70fc4997aae636b8aa4873adcc3729dd8dad0b5fa65572c1276
|
4
|
+
data.tar.gz: da63d872dbbb50aaf8c82b43eef6ec36c2c39eaace88ce2744b20be316ae5051
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7a9dc0945b450e9a090b883a98d608c6c7c3c95d44c6a62eef1fe1bedef0b11f9f112b4afbf6d613e52ceb8d61afb832fdd7ccd1b81d5455d6f6abc63e9c1947
|
7
|
+
data.tar.gz: 668d9e2193e5a32d859b07731d9eccaa52de28e53fefe10065c648c974a0dd0063ddabd448362a9ee3494944922f2291966c39e4e1da423d736127c4b91ff915
|
data/README.md
CHANGED
@@ -59,16 +59,20 @@ The client will raise `FetchSERP::Error` on any HTTP error (network, 4xx, 5xx) s
|
|
59
59
|
* `/api/v1/backlinks`
|
60
60
|
* `/api/v1/domain_emails`
|
61
61
|
* `/api/v1/domain_infos`
|
62
|
+
* `/api/v1/generate_social_content`
|
63
|
+
* `/api/v1/generate_wordpress_content`
|
62
64
|
* `/api/v1/keywords_search_volume`
|
63
65
|
* `/api/v1/keywords_suggestions`
|
64
66
|
* `/api/v1/long_tail_keywords_generator`
|
65
67
|
* `/api/v1/page_indexation`
|
68
|
+
* `/api/v1/playwright_mcp`
|
66
69
|
* `/api/v1/ranking`
|
67
70
|
* `/api/v1/scrape`
|
68
71
|
* `/api/v1/scrape_domain`
|
69
72
|
* `/api/v1/scrape_js`
|
70
73
|
* `/api/v1/scrape_js_with_proxy`
|
71
74
|
* `/api/v1/serp`
|
75
|
+
* `/api/v1/serp_ai_mode`
|
72
76
|
* `/api/v1/serp_html`
|
73
77
|
* `/api/v1/serp_js` & `/api/v1/serp_js/{uuid}`
|
74
78
|
* `/api/v1/serp_text`
|
@@ -86,16 +90,20 @@ Below is the full list of convenience helpers exposed by `FetchSERP::Client`. Al
|
|
86
90
|
| `backlinks(domain:, **opts)` | `GET /api/v1/backlinks` | `domain` |
|
87
91
|
| `domain_emails(domain:, **opts)` | `GET /api/v1/domain_emails` | `domain` |
|
88
92
|
| `domain_infos(domain:)` | `GET /api/v1/domain_infos` | `domain` |
|
93
|
+
| `generate_social_content(user_prompt:, system_prompt:, **opts)` | `GET /api/v1/generate_social_content` | `user_prompt`, `system_prompt` |
|
94
|
+
| `generate_wordpress_content(user_prompt:, system_prompt:, **opts)` | `GET /api/v1/generate_wordpress_content` | `user_prompt`, `system_prompt` |
|
89
95
|
| `keywords_search_volume(keywords:, **opts)` | `GET /api/v1/keywords_search_volume` | `keywords` (Array) |
|
90
96
|
| `keywords_suggestions(url: nil, keywords: nil, **opts)` | `GET /api/v1/keywords_suggestions` | one of `url` or `keywords` |
|
91
97
|
| `long_tail_keywords_generator(keyword:, **opts)` | `GET /api/v1/long_tail_keywords_generator` | `keyword` |
|
92
98
|
| `page_indexation(domain:, keyword:)` | `GET /api/v1/page_indexation` | `domain`, `keyword` |
|
99
|
+
| `playwright_mcp(prompt:, **opts)` | `GET /api/v1/playwright_mcp` | `prompt` |
|
93
100
|
| `ranking(keyword:, domain:, **opts)` | `GET /api/v1/ranking` | `keyword`, `domain` |
|
94
101
|
| `scrape(url:)` | `GET /api/v1/scrape` | `url` |
|
95
102
|
| `scrape_domain(domain:, **opts)` | `GET /api/v1/scrape_domain` | `domain` |
|
96
103
|
| `scrape_js(url:, js_script: nil)` | `POST /api/v1/scrape_js` | `url` |
|
97
104
|
| `scrape_js_with_proxy(url:, country:, js_script: nil)` | `POST /api/v1/scrape_js_with_proxy` | `url`, `country` |
|
98
105
|
| `serp(query:, **opts)` | `GET /api/v1/serp` | `query` |
|
106
|
+
| `serp_ai_mode(query:, **opts)` | `GET /api/v1/serp_ai_mode` | `query` |
|
99
107
|
| `serp_html(query:, **opts)` | `GET /api/v1/serp_html` | `query` |
|
100
108
|
| `serp_js(query:, **opts)` | `GET /api/v1/serp_js` | `query` |
|
101
109
|
| `serp_js_content(uuid:)` | `GET /api/v1/serp_js/{uuid}` | `uuid` |
|
@@ -113,6 +121,58 @@ resp = client.keywords_suggestions(keywords: ["ruby sdk", "seo api"], country: "
|
|
113
121
|
puts resp.data["keywords_suggestions"]
|
114
122
|
```
|
115
123
|
|
124
|
+
### Example — Get SERP AI Overview and AI Mode
|
125
|
+
|
126
|
+
```ruby
|
127
|
+
client = FetchSERP.new(api_key: ENV["FETCHSERP_API_KEY"])
|
128
|
+
|
129
|
+
# Get AI overview and AI mode response for a search query
|
130
|
+
resp = client.serp_ai_mode(query: "ruby programming best practices")
|
131
|
+
```
|
132
|
+
|
133
|
+
### Example — Remote control browser with Playwright MCP
|
134
|
+
|
135
|
+
```ruby
|
136
|
+
client = FetchSERP.new(api_key: ENV["FETCHSERP_API_KEY"])
|
137
|
+
|
138
|
+
# Use GPT-4.1 to remote control a browser via Playwright MCP
|
139
|
+
resp = client.playwright_mcp(prompt: "Navigate to google.com and search for 'ruby gems'")
|
140
|
+
puts resp.data["response"]
|
141
|
+
```
|
142
|
+
|
143
|
+
### Example — Generate WordPress Content with AI
|
144
|
+
|
145
|
+
```ruby
|
146
|
+
client = FetchSERP.new(api_key: ENV["FETCHSERP_API_KEY"])
|
147
|
+
|
148
|
+
# Generate SEO-optimized WordPress content
|
149
|
+
response = client.generate_wordpress_content(
|
150
|
+
user_prompt: "Write about the benefits of Ruby on Rails for web development",
|
151
|
+
system_prompt: "You are an expert web developer writing SEO content",
|
152
|
+
ai_model: "gpt-4.1-nano" # optional, defaults to gpt-4.1-nano
|
153
|
+
)
|
154
|
+
|
155
|
+
puts response.data["response"]["title"] # Access the generated title
|
156
|
+
puts response.data["response"]["content"] # Access the generated content
|
157
|
+
puts response.data["usd_cost"] # Cost of the AI request in USD
|
158
|
+
```
|
159
|
+
|
160
|
+
### Example — Generate Social Media Content with AI
|
161
|
+
|
162
|
+
```ruby
|
163
|
+
client = FetchSERP.new(api_key: ENV["FETCHSERP_API_KEY"])
|
164
|
+
|
165
|
+
# Generate engaging social media content
|
166
|
+
response = client.generate_social_content(
|
167
|
+
user_prompt: "Write a Twitter thread about Ruby's best features",
|
168
|
+
system_prompt: "You are a Ruby developer sharing insights on social media",
|
169
|
+
ai_model: "gpt-4.1-nano" # optional, defaults to gpt-4.1-nano
|
170
|
+
)
|
171
|
+
|
172
|
+
puts response.data["response"]["content"] # Access the generated social content
|
173
|
+
puts response.data["usd_cost"] # Cost of the AI request in USD
|
174
|
+
```
|
175
|
+
|
116
176
|
### Handling errors
|
117
177
|
|
118
178
|
Any 4xx/5xx response raises `FetchSERP::Error` which includes `status` and raw `body` so you can debug:
|
@@ -131,4 +191,10 @@ Bug reports and pull requests are welcome!
|
|
131
191
|
|
132
192
|
## License
|
133
193
|
|
134
|
-
GPL-3.0
|
194
|
+
GPL-3.0
|
195
|
+
|
196
|
+
Publish :
|
197
|
+
|
198
|
+
- update version
|
199
|
+
- gem build fetchserp.gemspec
|
200
|
+
- gem push fetchserp-0.1.3.gem
|
data/lib/fetchserp/client.rb
CHANGED
@@ -35,6 +35,16 @@ module FetchSERP
|
|
35
35
|
get("/api/v1/domain_infos", params)
|
36
36
|
end
|
37
37
|
|
38
|
+
# Generate WordPress content using AI - returns SEO optimized content with title and body
|
39
|
+
def generate_wordpress_content(**params)
|
40
|
+
get("/api/v1/generate_wordpress_content", params)
|
41
|
+
end
|
42
|
+
|
43
|
+
# Generate social media content using AI
|
44
|
+
def generate_social_content(**params)
|
45
|
+
get("/api/v1/generate_social_content", params)
|
46
|
+
end
|
47
|
+
|
38
48
|
def keywords_search_volume(**params)
|
39
49
|
get("/api/v1/keywords_search_volume", params)
|
40
50
|
end
|
@@ -51,6 +61,11 @@ module FetchSERP
|
|
51
61
|
get("/api/v1/page_indexation", params)
|
52
62
|
end
|
53
63
|
|
64
|
+
# Playwright MCP - uses GPT-4.1 to remote control a browser via a Playwright MCP server
|
65
|
+
def playwright_mcp(**params)
|
66
|
+
get("/api/v1/playwright_mcp", params)
|
67
|
+
end
|
68
|
+
|
54
69
|
def ranking(**params)
|
55
70
|
get("/api/v1/ranking", params)
|
56
71
|
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.4
|
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-21 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.
|