fetchserp 0.1.1 → 0.1.2
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 +21 -1
- data/lib/fetchserp/client.rb +6 -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: 0074340ccc01f75f24314a4793bf0949e440e18673393957dc51a52c740eb17d
|
4
|
+
data.tar.gz: 9c32a55e21868b613bfb952ee4ae8dbe8c769b15ba80f50cad9947e1a3465840
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0159792db3d0f8ece50c0c50d42e09a550a7b1e6bcb672b8874bb10187b38e481572626d6938275e8f7becb0060a70f95974836a26f86c3efbfb65e816e9f0bd'
|
7
|
+
data.tar.gz: 3b30f3fcc8b587214626a603b335d1b84ddba0efe2884ad22aa157bc03a9c3ab0a2c50d4c026bb4c1ff4ed84cd01ed39ee5885a6d461468897d3d0c6d0f7850d
|
data/README.md
CHANGED
@@ -7,7 +7,7 @@ A lightweight, hand-crafted Ruby SDK for the FetchSERP REST API.
|
|
7
7
|
Add this line to your application's Gemfile:
|
8
8
|
|
9
9
|
```ruby
|
10
|
-
gem "fetchserp",
|
10
|
+
gem "fetchserp", "~> 0.1"
|
11
11
|
```
|
12
12
|
|
13
13
|
Then bundle install:
|
@@ -16,6 +16,22 @@ Then bundle install:
|
|
16
16
|
bundle install
|
17
17
|
```
|
18
18
|
|
19
|
+
## Authentication
|
20
|
+
|
21
|
+
An API key is required for **all** requests. You can create a free account and grab your key at <https://fetchserp.com/> — every new account starts with **250 free credits** so you can test the endpoints immediately.
|
22
|
+
|
23
|
+
Set it in your environment (recommended):
|
24
|
+
|
25
|
+
```bash
|
26
|
+
export FETCHSERP_API_KEY="your-secret-token"
|
27
|
+
```
|
28
|
+
|
29
|
+
or pass it directly when instantiating the client:
|
30
|
+
|
31
|
+
```ruby
|
32
|
+
client = FetchSERP.new(api_key: "your-secret-token")
|
33
|
+
```
|
34
|
+
|
19
35
|
## Quick Start
|
20
36
|
|
21
37
|
```ruby
|
@@ -30,6 +46,10 @@ puts response.data
|
|
30
46
|
# Fetch Google SERP results
|
31
47
|
serp = client.serp(query: "best ruby gems", country: "us")
|
32
48
|
puts serp.data["results"]
|
49
|
+
|
50
|
+
# Get ranking positions for a domain/keyword
|
51
|
+
ranking = client.ranking(keyword: "serp api", domain: "fetchserp.com", pages_number: 5)
|
52
|
+
puts ranking.data["results"]
|
33
53
|
```
|
34
54
|
|
35
55
|
The client will raise `FetchSERP::Error` on any HTTP error (network, 4xx, 5xx) so you can handle failures gracefully.
|
data/lib/fetchserp/client.rb
CHANGED
@@ -79,6 +79,12 @@ module FetchSERP
|
|
79
79
|
get("/api/v1/serp_html", params)
|
80
80
|
end
|
81
81
|
|
82
|
+
# SERP AI Overview and AI Mode - returns AI overview and AI mode response for the query
|
83
|
+
# Less reliable than the 2-step process but returns results in under 30 seconds
|
84
|
+
def serp_ai_mode(**params)
|
85
|
+
get("/api/v1/serp_ai_mode", params)
|
86
|
+
end
|
87
|
+
|
82
88
|
# Step 1: returns uuid
|
83
89
|
def serp_js(**params)
|
84
90
|
get("/api/v1/serp_js", params)
|
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.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- FetchSERP
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-06-
|
11
|
+
date: 2025-06-25 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.
|