Repository navigation
Fix outdated live API examples - #38
Merged
Merged
Conversation
Refresh example inputs, use future hotel dates and correct response fields. Use the current Google Light engine and a working Reverse Image URL, and check that Reverse Image and Lens return nonempty results. Co-authored-by: Codex <codex@openai.com>
adarshdigievo
requested review from
strzibny
and
a balanced review from Copilot
October 29, 2026 11:59
There was a problem hiding this comment.
🟡 Changes recommended
The modified spec duplicates the existing google_light example, causing regression runs to make the same live API call twice without adding coverage; the obsolete spec should be removed.
1 open issue
What changed in this PR
Refreshes live API examples used by rake regression to correct outdated request parameters and response assertions.
Changes:
- Uses rolling future dates for Hotels, a location-specific Events query, and an updated Extract map target.
- Corrects Finance and Videos response fields and switches the legacy Light example to
google_light. - Updates the Reverse Image input and checks for nonempty results in both Reverse Image and Lens examples.
| File | Description |
|---|---|
spec/serpapi/client/example/example_search_google_videos_spec.rb |
Checks video_results instead of organic_results. |
spec/serpapi/client/example/example_search_google_reverse_image_spec.rb |
Updates the image URL and checks nonempty image_results. |
spec/serpapi/client/example/example_search_google_light_search_spec.rb |
Updates the engine name and documentation link. |
spec/serpapi/client/example/example_search_google_lens_spec.rb |
Requires nonempty visual_matches. |
spec/serpapi/client/example/example_search_google_hotels_spec.rb |
Computes future check-in and check-out dates. |
spec/serpapi/client/example/example_search_google_finance_spec.rb |
Checks the stock summary response field. |
spec/serpapi/client/example/example_search_google_events_spec.rb |
Uses an Austin-specific events query. |
spec/serpapi/client/example/example_extract_spec.rb |
Uses Books to Scrape for the map example. |
Review effort: Balanced
| it 'prints organic_results' do | ||
| # initialize the serp api client | ||
| client = SerpApi::Client.new(engine: 'google_light_search', api_key: api_key) | ||
| client = SerpApi::Client.new(engine: 'google_light', api_key: api_key) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

AI-assisted implementation and testing: Used Codex (GPT-6 Astra xhigh).
Fixes outdated API examples:
google_light.visual_matches.These examples run through
rake regression, which CI does not invoke, so earlier PR checks missed these errors.All live tests targeting the examples passed.