Add Google Flights price tracking with SerpApi and GitHub Actions - #2
Conversation
🌍 Web previewPreview is pinned to commit |
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
|
✅ Fixed the PR merge conflict by syncing the latest
No flight-price feature code was dropped during the sync. |
hoangsvit
left a comment
There was a problem hiding this comment.
Switched the flight-price provider from Duffel to SerpApi Google Flights.
Validation completed:
- PR remains mergeable.
- PR Preview passed on
c35b518. - Secret is now
SERPAPI_API_KEY. - Search configuration remains 6 adults + 1 infant on lap, Economy, max 1 stop, return 25/26 Oct.
- Multi-city search follows SerpApi's
departure_tokenflow. - Auto refresh is now once daily at ~07:17 Asia/Ho_Chi_Minh to keep scheduled usage around 120 searches/month (4 searches per refresh).
No live/fake price is committed before the SerpApi key is configured and the workflow is run.
Summary
Adds Google Flights price tracking through SerpApi + GitHub Actions, without Cloudflare or a separate backend.
What this PR adds
flights.html— mobile-friendly Google Flights price dashboardscripts/fetch-flights.mjs— SerpApi Google Flights search/normalisation.github/workflows/update-flight-prices.yml— scheduled GitHub Actions refreshdata/flights.json— latest snapshot consumed by the static sitedata/flight-history.json— saved cheapest-price historySearch configuration
Google Flights / SerpApi flow
SerpApi multi-city selection is sequential. For each return-date scenario the fetcher:
departure_token,There are two return-date scenarios, therefore one refresh uses 4 SerpApi searches.
Flight dashboard features
API setup
Add this repository Actions secret after merge:
SERPAPI_API_KEY=<your private SerpApi key>The key is only read by GitHub Actions and is never written to the generated JSON or browser code.
Optional automatic price alert
Repository Actions variables:
FLIGHT_ALERT_AMOUNT— e.g.30000000FLIGHT_ALERT_CURRENCY— e.g.VND(optional)When the current cheapest total is at or below the target, the workflow opens/updates a GitHub Issue named
✈️ Flight price alert · China 2026. When the price moves back above the target, that issue is closed.Refresh schedule
Automatically at approximately 07:17 Asia/Ho_Chi_Minh once per day, plus manual
workflow_dispatch.With 4 searches per refresh, 30 scheduled days use about 120 SerpApi searches, leaving room for manual checks within the current 250-search free plan.
Preview
The PR preview workflow posts browser links for both the travel dashboard and
flights.htmland updates them on every commit.Until
SERPAPI_API_KEYis configured and the workflow is run frommain, the preview intentionally displays the setup-required state rather than fake prices.Price note
These are Google Flights search snapshots, not locked fares. Baggage, card or other optional fees may apply, and the final itinerary/price should be verified before payment.