You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+4-6Lines changed: 4 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ Query a vast range of data at scale, including web search results, flight schedu
16
16
17
17
## Installation
18
18
19
-
Ruby 2.7 and later are supported. To achieve an optimal performance, the latest version is recommended. Check 2.7.8 vs 3.4.4 [performance comparison](#Performance-Comparison).
19
+
Ruby 2.7 and higher are supported. To achieve an optimal performance, the latest version is recommended. Check 2.7.8 vs 3.4.4 [performance comparison](#Performance-Comparison).
20
20
21
21
Other versions, such as Ruby 1.9, Ruby 2.x, and JRuby, are compatible with [legacy SerpApi library](https://github.com/serpapi/google-search-results-ruby), which is still supported. To upgrade to the latest library, check our [migration guide](#Migration-quick-guide).
22
22
@@ -1093,11 +1093,9 @@ Most notable improvements:
1093
1093
- Reduce logic complexity in our implementation. (faster performance)
Integrate search data into your AI workflow, RAG / fine-tuning, or Ruby application using this official wrapper for [SerpApi](https://serpapi.com).
25
+
Integrate search data into your AI workflow, RAG / fine-tuning, or Ruby application using this official wrapper for [SerpApi](https://serpapi.com).
26
26
27
-
SerpApi supports Google, Google Maps, Google Shopping, Baidu, Yandex, Yahoo, eBay, App Stores, and [more](https://serpapi.com).
27
+
SerpApi supports Google, Google Maps, Google Shopping, Baidu, Yandex, Yahoo, eBay, App Stores, and [more](https://serpapi.com).
28
28
29
-
Query a vast range of data at scale, including web search results, flight schedules, stock market data, news headlines, and [more](https://serpapi.com).
29
+
Query a vast range of data at scale, including web search results, flight schedules, stock market data, news headlines, and [more](https://serpapi.com).
30
30
31
31
## Features
32
32
* `persistent` → Keep socket connection open to save on SSL handshake / reconnection (2x faster). [Search at scale](#Search-At-Scale)
@@ -36,7 +36,7 @@ Query a vast range of data at scale, including web search results, flight schedu
36
36
37
37
## Installation
38
38
39
-
Ruby 2.7 and later are supported. To achieve an optimal performance, the latest version is recommended. Check 2.7.8 vs 3.4.4 [performance comparison](#Performance-Comparison).
39
+
Ruby 2.7 and higher are supported. To achieve an optimal performance, the latest version is recommended. Check 2.7.8 vs 3.4.4 [performance comparison](#Performance-Comparison).
40
40
41
41
Other versions, such as Ruby 1.9, Ruby 2.x, and JRuby, are compatible with [legacy SerpApi library](https://github.com/serpapi/google-search-results-ruby), which is still supported. To upgrade to the latest library, check our [migration guide](#Migration-quick-guide).
42
42
@@ -45,7 +45,7 @@ Other versions, such as Ruby 1.9, Ruby 2.x, and JRuby, are compatible with [lega
45
45
gem 'serpapi', '~> 1.0', '>= 1.0.3'
46
46
```
47
47
48
-
### Gem
48
+
### Gem
49
49
```bash
50
50
$ gem install serpapi
51
51
```
@@ -139,7 +139,7 @@ Search API enables `async` search.
139
139
- Non-blocking (`async=true`) : the development is more complex, but this allows handling many simultaneous connections.
140
140
- Blocking (`async=false`) : it is easy to write the code but more compute-intensive when the parent process needs to hold many connections.
141
141
142
-
Here is an example of asynchronous searches using Ruby
142
+
Here is an example of asynchronous searches using Ruby
143
143
```ruby
144
144
require 'serpapi'
145
145
@@ -204,9 +204,9 @@ end
204
204
responses = threads.map(&:value)
205
205
```
206
206
207
-
The code aims to demonstrate how thread pools can be used to
208
-
improve performance by executing multiple tasks concurrently. In
209
-
this case, it makes multiple HTTP requests to an API endpoint using
207
+
The code aims to demonstrate how thread pools can be used to
208
+
improve performance by executing multiple tasks concurrently. In
209
+
this case, it makes multiple HTTP requests to an API endpoint using
210
210
a thread pool of persistent connections.
211
211
212
212
Note: `gem install connection_pool` to run this example.
4. **SerpApi Optimization**: Shows consistent ~2.2x improvement with persistent connections regardless of Ruby version
509
509
5. **Ruby 4.0.0 Performance**: Shows mixed results with some regressions compared to 3.4.4, particularly for HTTP.rb persistent connections. Ruby 4.0.0 was just released for Christmas 2025, and HTTP.rb has not been optimized for it yet.
510
510
511
-
The older library (google-search-results-ruby) was performing at 55 req/s on Ruby 2.7.8, which is 2x slower than the current version (serpapi-ruby) on Ruby 3.4.4 or 4.0.0.
511
+
The older library (google-search-results-ruby) was performing at 55 req/s on Ruby 2.7.8, which is 2x slower than the current version (serpapi-ruby) on Ruby 3.4.4 or 4.0.0.
512
512
513
-
**Context** This benchmark was performed on warmup search results using a MacBook Pro 2025 connected via Wi-Fi 6.0 home network on AT&T fiber from Austin, TX (no network optimization).
513
+
**Context** This benchmark was performed on warmup search results using a MacBook Pro 2025 connected via Wi-Fi 6.0 home network on AT&T fiber from Austin, TX (no network optimization).
514
514
515
515
## Migration quick guide
516
516
517
517
If you were already using [google-search-results-ruby gem](https://github.com/serpapi/google-search-results-ruby), here are the changes.
@@ -616,7 +614,7 @@ This project source code and coding style was inspired by the most awesome Ruby
616
614
### Class diagram
617
615
```mermaid
618
616
classDiagram
619
-
Application *-- serpapi
617
+
Application *-- serpapi
620
618
serpapi *-- Client
621
619
class Client {
622
620
engine String
@@ -636,7 +634,7 @@ classDiagram
636
634
### search() : Sequence diagram
637
635
```mermaid
638
636
sequenceDiagram
639
-
Client->>SerpApi.com: search() : http request
637
+
Client->>SerpApi.com: search() : http request
640
638
SerpApi.com-->>SerpApi.com: query search engine
641
639
SerpApi.com-->>SerpApi.com: parse HTML into JSON
642
640
SerpApi.com-->>Client: JSON string payload
@@ -659,12 +657,12 @@ The class SerpApi::Client (client side / ruby):
659
657
Et voila!
660
658
661
659
## Continuous integration
662
-
We love [continuous integration](https://en.wikipedia.org/wiki/Continuous_integration) (CI) and [Test-Driven Development](https://en.wikipedia.org/wiki/Test-driven_development) (TDD) at SerpApi.
660
+
We love [continuous integration](https://en.wikipedia.org/wiki/Continuous_integration) (CI) and [Test-Driven Development](https://en.wikipedia.org/wiki/Test-driven_development) (TDD) at SerpApi.
663
661
We use RSpec and Github Actions to test our infrastructure around the clock, and that includes all changes to our clients.
664
662
665
663
The directory spec/ includes specification which serves the dual purposes of examples and functional tests.
666
664
667
-
Set your secret API key in your shell before running a test.
665
+
Set your secret API key in your shell before running a test.
668
666
The SerpApi key can be obtained from [serpapi.com/signup](https://serpapi.com/users/sign_up?plan=free).
0 commit comments