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
{{ message }}
Repository navigation
Commit 379f946
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: README.md
+25-1Lines changed: 25 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -55,10 +55,34 @@ client.close
55
55
56
56
-[Asynchronous searches](./demo/demo_async.rb) for submitting non-blocking jobs and retrieving completed results from the Search Archive API.
57
57
-[Persistent connections and connection pooling](./demo/demo_thread_pool.rb) for reusing HTTP connections across searches.
58
-
-JSON responses as Ruby hashes with `search`, or raw search-engine HTML with `html`.
58
+
-Search results as Ruby hashes with `search`, token-efficient Markdown with `markdown`, or raw search-engine HTML with `html`.
59
59
- SDK methods for the [Location API](https://serpapi.com/locations-api), [Search Archive API](https://serpapi.com/search-archive-api), and [Account API](https://serpapi.com/account-api).
60
60
- Configurable HTTP timeouts and symbolized or string JSON keys.
61
61
62
+
## Response formats
63
+
64
+
Use `search` for structured results decoded into a Ruby `Hash`:
65
+
66
+
```ruby
67
+
results = client.search(q:"coffee")
68
+
```
69
+
70
+
Use `markdown` for a token-efficient Markdown `String` optimized for LLMs and AI agents:
71
+
72
+
```ruby
73
+
markdown = client.markdown(q:"coffee")
74
+
```
75
+
76
+
Use `html` when you need the raw search-engine response:
77
+
78
+
```ruby
79
+
raw_html = client.html(q:"coffee")
80
+
```
81
+
82
+
Archived results are also available as Markdown with `client.search_archive(search_id, :markdown)`.
83
+
84
+
Learn more about [SerpApi Markdown output](https://serpapi.com/markdown-output).
85
+
62
86
## Configuration
63
87
64
88
Set defaults when creating a client, then override search parameters in individual calls:
Copy file name to clipboardExpand all lines: README.md.erb
+25-1Lines changed: 25 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -55,10 +55,34 @@ client.close
55
55
56
56
- [Asynchronous searches](./demo/demo_async.rb) for submitting non-blocking jobs and retrieving completed results from the Search Archive API.
57
57
- [Persistent connections and connection pooling](./demo/demo_thread_pool.rb) for reusing HTTP connections across searches.
58
-
- JSON responses as Ruby hashes with `search`, or raw search-engine HTML with `html`.
58
+
- Search results as Ruby hashes with `search`, token-efficient Markdown with `markdown`, or raw search-engine HTML with `html`.
59
59
- SDK methods for the [Location API](https://serpapi.com/locations-api), [Search Archive API](https://serpapi.com/search-archive-api), and [Account API](https://serpapi.com/account-api).
60
60
- Configurable HTTP timeouts and symbolized or string JSON keys.
61
61
62
+
## Response formats
63
+
64
+
Use `search` for structured results decoded into a Ruby `Hash`:
65
+
66
+
```ruby
67
+
results = client.search(q: "coffee")
68
+
```
69
+
70
+
Use `markdown` for a token-efficient Markdown `String` optimized for LLMs and AI agents:
71
+
72
+
```ruby
73
+
markdown = client.markdown(q: "coffee")
74
+
```
75
+
76
+
Use `html` when you need the raw search-engine response:
77
+
78
+
```ruby
79
+
raw_html = client.html(q: "coffee")
80
+
```
81
+
82
+
Archived results are also available as Markdown with `client.search_archive(search_id, :markdown)`.
83
+
84
+
Learn more about [SerpApi Markdown output](https://serpapi.com/markdown-output).
85
+
62
86
## Configuration
63
87
64
88
Set defaults when creating a client, then override search parameters in individual calls:
0 commit comments