Skip to content

Fix outdated live API examples - #38

Merged
strzibny merged 1 commit into
masterfrom
fix/live-api-examples
Oct 29, 2026
Merged

strzibny merged 1 commit into
masterfrom
fix/live-api-examples

Conversation

@adarshdigievo

Copy link
Copy Markdown
Member

AI-assisted implementation and testing: Used Codex (GPT-6 Astra xhigh).

Fixes outdated API examples:

  • Use future dates for Google Hotels.
  • Correct the Events query and Finance/Videos response fields.
  • Switch the old Google Light example to google_light.
  • Use a working website for the Extract map example.
  • Update the Reverse Image example, checking for nonempty 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.

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>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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)

@strzibny strzibny left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@strzibny
strzibny merged commit 73322c6 into master Oct 29, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants