fetchserp 0.1.0 → 0.1.1
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 +49 -0
- data/lib/fetchserp/version.rb +1 -1
- metadata +6 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3cd4f221a3c82a7cbbe3f8f30f2ad30d34033d98090ddaabe716dd6710b7e93c
|
4
|
+
data.tar.gz: 334c72468085154f231e4cc5de15002fc208e4aeeabcc04a67d4c79a40e7a21f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d7e76b461290d590368bf47e5892cf161d8255011259a6bbffa488c8c4959700146ac99597d9f1bd15a9529741f2270543996c117440319ed94b8162b32460f7
|
7
|
+
data.tar.gz: 69c53b9825c3d84eccdb6770eab3552e335882ad9ea59b40e5b69cec10a5372d6b9699227bb52f0aa51eb0170d33249a3dc30028e315f99b5cb26dc2777bdcd6
|
data/README.md
CHANGED
@@ -56,6 +56,55 @@ The client will raise `FetchSERP::Error` on any HTTP error (network, 4xx, 5xx) s
|
|
56
56
|
* `/api/v1/web_page_ai_analysis`
|
57
57
|
* `/api/v1/web_page_seo_analysis`
|
58
58
|
|
59
|
+
## API Reference
|
60
|
+
|
61
|
+
Below is the full list of convenience helpers exposed by `FetchSERP::Client`. All methods return a `FetchSERP::Response` object which exposes
|
62
|
+
`data`, `body` and the raw Net::HTTP response via `http_response`.
|
63
|
+
|
64
|
+
| Ruby method | Underlying REST endpoint | Required params |
|
65
|
+
|-------------|-------------------------|-----------------|
|
66
|
+
| `backlinks(domain:, **opts)` | `GET /api/v1/backlinks` | `domain` |
|
67
|
+
| `domain_emails(domain:, **opts)` | `GET /api/v1/domain_emails` | `domain` |
|
68
|
+
| `domain_infos(domain:)` | `GET /api/v1/domain_infos` | `domain` |
|
69
|
+
| `keywords_search_volume(keywords:, **opts)` | `GET /api/v1/keywords_search_volume` | `keywords` (Array) |
|
70
|
+
| `keywords_suggestions(url: nil, keywords: nil, **opts)` | `GET /api/v1/keywords_suggestions` | one of `url` or `keywords` |
|
71
|
+
| `long_tail_keywords_generator(keyword:, **opts)` | `GET /api/v1/long_tail_keywords_generator` | `keyword` |
|
72
|
+
| `page_indexation(domain:, keyword:)` | `GET /api/v1/page_indexation` | `domain`, `keyword` |
|
73
|
+
| `ranking(keyword:, domain:, **opts)` | `GET /api/v1/ranking` | `keyword`, `domain` |
|
74
|
+
| `scrape(url:)` | `GET /api/v1/scrape` | `url` |
|
75
|
+
| `scrape_domain(domain:, **opts)` | `GET /api/v1/scrape_domain` | `domain` |
|
76
|
+
| `scrape_js(url:, js_script: nil)` | `POST /api/v1/scrape_js` | `url` |
|
77
|
+
| `scrape_js_with_proxy(url:, country:, js_script: nil)` | `POST /api/v1/scrape_js_with_proxy` | `url`, `country` |
|
78
|
+
| `serp(query:, **opts)` | `GET /api/v1/serp` | `query` |
|
79
|
+
| `serp_html(query:, **opts)` | `GET /api/v1/serp_html` | `query` |
|
80
|
+
| `serp_js(query:, **opts)` | `GET /api/v1/serp_js` | `query` |
|
81
|
+
| `serp_js_content(uuid:)` | `GET /api/v1/serp_js/{uuid}` | `uuid` |
|
82
|
+
| `serp_text(query:, **opts)` | `GET /api/v1/serp_text` | `query` |
|
83
|
+
| `user` | `GET /api/v1/user` | – |
|
84
|
+
| `web_page_ai_analysis(url:, prompt:)` | `GET /api/v1/web_page_ai_analysis` | `url`, `prompt` |
|
85
|
+
| `web_page_seo_analysis(url:)` | `GET /api/v1/web_page_seo_analysis` | `url` |
|
86
|
+
|
87
|
+
### Example — Get keyword suggestions
|
88
|
+
|
89
|
+
```ruby
|
90
|
+
client = FetchSERP.new(api_key: ENV["FETCHSERP_API_KEY"])
|
91
|
+
|
92
|
+
resp = client.keywords_suggestions(keywords: ["ruby sdk", "seo api"], country: "us")
|
93
|
+
puts resp.data["keywords_suggestions"]
|
94
|
+
```
|
95
|
+
|
96
|
+
### Handling errors
|
97
|
+
|
98
|
+
Any 4xx/5xx response raises `FetchSERP::Error` which includes `status` and raw `body` so you can debug:
|
99
|
+
|
100
|
+
```ruby
|
101
|
+
begin
|
102
|
+
client.serp(query: "ruby openai")
|
103
|
+
rescue FetchSERP::Error => e
|
104
|
+
warn "Error #{e.status}: #{e.body}"
|
105
|
+
end
|
106
|
+
```
|
107
|
+
|
59
108
|
## Contributing
|
60
109
|
|
61
110
|
Bug reports and pull requests are welcome!
|
data/lib/fetchserp/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
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.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- FetchSERP
|
@@ -25,10 +25,13 @@ files:
|
|
25
25
|
- lib/fetchserp/error.rb
|
26
26
|
- lib/fetchserp/response.rb
|
27
27
|
- lib/fetchserp/version.rb
|
28
|
-
homepage: https://
|
28
|
+
homepage: https://github.com/fetchserp/fetchserp-ruby
|
29
29
|
licenses:
|
30
30
|
- GPL-3.0-or-later
|
31
|
-
metadata:
|
31
|
+
metadata:
|
32
|
+
homepage_uri: https://github.com/fetchserp/fetchserp-ruby
|
33
|
+
source_code_uri: https://github.com/fetchserp/fetchserp-ruby
|
34
|
+
changelog_uri: https://github.com/fetchserp/fetchserp-ruby/releases
|
32
35
|
post_install_message:
|
33
36
|
rdoc_options: []
|
34
37
|
require_paths:
|