outscraper 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/examples/Google SERP.md +32 -0
- data/lib/outscraper/version.rb +1 -1
- data/lib/outscraper.rb +11 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9be579ed83bac11c398d476e01e5b0240a4bc523a04215032738397b1175dca3
|
4
|
+
data.tar.gz: 589195e816938c3d12d5d7f94c7caaa5f88e08fba6c660cf41f45d60b92e23d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9bcf36fc9d63876ba7f091e4e093040f531d35d7d7ac77fdb69ed2192376417d26b261907ba5e745bd09092f28cbe270e51d08fb745104565d3a9545bb1a5a8e
|
7
|
+
data.tar.gz: c4aea89c73fa5e63d177ebca8daf829230f55f6590e756d7bca0c67c2f516e3c30ce2f3710e0a729ae7c8dc44c6d2930d35e01b26ffd7cf2c42d89deb994a50d
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# Google Search Results Scraper With Ruby
|
2
|
+
|
3
|
+
The library returns search results from Google based on a given search query via [Outscraper API](https://app.outscraper.com/api-docs#tag/Google-Search).
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Install the gem and add to the application's Gemfile by executing:
|
8
|
+
```bash
|
9
|
+
bundle add outscraper
|
10
|
+
```
|
11
|
+
|
12
|
+
If bundler is not being used to manage dependencies, install the gem by executing:
|
13
|
+
```bash
|
14
|
+
gem install outscraper
|
15
|
+
```
|
16
|
+
|
17
|
+
[Link to the Ruby package page](https://rubygems.org/gems/outscraper)
|
18
|
+
|
19
|
+
## Initialization
|
20
|
+
```ruby
|
21
|
+
require 'Outscraper'
|
22
|
+
|
23
|
+
client = Outscraper::Client.new('SECRET_API_KEY')
|
24
|
+
```
|
25
|
+
[Link to the profile page to create the API key](https://app.outscraper.com/profile)
|
26
|
+
|
27
|
+
## Usage
|
28
|
+
|
29
|
+
```ruby
|
30
|
+
# Search for SERP results:
|
31
|
+
result = client.google_search('buy iphone 13 TX', language: 'en', region: 'us')
|
32
|
+
```
|
data/lib/outscraper/version.rb
CHANGED
data/lib/outscraper.rb
CHANGED
@@ -13,6 +13,17 @@ module Outscraper
|
|
13
13
|
self.class.headers 'X-API-KEY' => api_key
|
14
14
|
end
|
15
15
|
|
16
|
+
def google_search(query, pages_per_query: 1, uule: '', language: 'en', region: nil)
|
17
|
+
response = self.class.get("google-search-v2", 'query': {
|
18
|
+
query: query,
|
19
|
+
pagesPerQuery: pages_per_query,
|
20
|
+
uule: uule,
|
21
|
+
language: language,
|
22
|
+
region: region,
|
23
|
+
async: false,
|
24
|
+
}).parsed_response['data']
|
25
|
+
end
|
26
|
+
|
16
27
|
def google_maps_search_v2(query, limit: 20, drop_duplicates: false, language: 'en', region: nil, skip: 0)
|
17
28
|
response = self.class.get("/maps/search-v2", 'query': {
|
18
29
|
query: query,
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: outscraper
|
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
|
- Outscraper
|
@@ -42,6 +42,7 @@ files:
|
|
42
42
|
- examples/Emails And Contacts.md
|
43
43
|
- examples/Google Maps Reviews.md
|
44
44
|
- examples/Google Maps.md
|
45
|
+
- examples/Google SERP.md
|
45
46
|
- examples/Phones Validator.md
|
46
47
|
- lib/outscraper.rb
|
47
48
|
- lib/outscraper/version.rb
|