From a0a4690c08ad33a0e2e0df491013c6c146cc0de2 Mon Sep 17 00:00:00 2001 From: kasparasizi1 <132673909+kasparasizi1@users.noreply.github.com> Date: Thu, 23 Jul 2026 12:13:30 +0300 Subject: [PATCH] feat(flights): add sort_by (top|price) for full price-sorted inventory sort_by='price' returns the FULL GetShoppingResults inventory (every carrier, the cheap long-layover fares) plus Google's price floor / typical range / history. Default 'top' keeps the fast best-picks behaviour. Bumps 0.21.0 -> 0.22.0. --- CHANGELOG.md | 6 ++++++ package.json | 2 +- src/google/index.ts | 1 + src/google/types.ts | 10 ++++++++++ src/index.ts | 1 + src/internal/version.ts | 2 +- 6 files changed, 20 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d348245..44343bb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.22.0] - 2026-07-23 + +### Added + +- **Google Flights `sort_by`** — `client.google.flights.search({ ..., sort_by: "price" })` now returns the FULL price-sorted inventory (every carrier, the cheap long-layover fares) plus Google's own price floor, typical range, and price history, instead of only the ~6-8 "best" preview. Default `sort_by: "top"` keeps the fast best-picks behaviour. (SCR-123) + ## [0.21.0] - 2026-07-17 ### Added diff --git a/package.json b/package.json index 728fcbf..3a37ec1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "scrapebadger", - "version": "0.21.0", + "version": "0.22.0", "description": "Official Node.js SDK for ScrapeBadger - Async web scraping APIs for Twitter, Google, Vinted, Reddit, and more", "type": "module", "main": "./dist/index.js", diff --git a/src/google/index.ts b/src/google/index.ts index 3f2e650..3fdf5d7 100644 --- a/src/google/index.ts +++ b/src/google/index.ts @@ -32,6 +32,7 @@ export type { AutocompleteParams, FinanceQuoteParams, FlightsSearchParams, + FlightsSortBy, FlightsStopsFilter, FlightsTravelClass, FlightsTripType, diff --git a/src/google/types.ts b/src/google/types.ts index 5b849c5..1c588bd 100644 --- a/src/google/types.ts +++ b/src/google/types.ts @@ -647,6 +647,8 @@ export type FlightsTripType = "round_trip" | "one_way" | "multi_city"; export type FlightsTravelClass = "economy" | "premium_economy" | "business" | "first"; export type FlightsStopsFilter = "any" | "nonstop" | "one_stop" | "two_stops"; +export type FlightsSortBy = "top" | "price"; + export interface FlightsSearchParams { /** Departure airport IATA code (e.g. "JFK") or location ID. */ departure_id: string; @@ -673,4 +675,12 @@ export interface FlightsSearchParams { stops?: FlightsStopsFilter; /** Upper price filter. */ max_price?: number; + /** + * `"top"` (default) returns Google's ~6-8 "best" picks (fast). `"price"` + * returns the FULL price-sorted inventory (every carrier, the cheap + * long-layover fares) plus Google's own price floor, typical range, and + * price history — slower, and falls back to the "top" set under load. + * Round-trip initial search only. + */ + sort_by?: FlightsSortBy; } diff --git a/src/index.ts b/src/index.ts index 1443d23..c75a386 100644 --- a/src/index.ts +++ b/src/index.ts @@ -142,6 +142,7 @@ export type { AutocompleteParams, FinanceQuoteParams, FlightsSearchParams, + FlightsSortBy, FlightsStopsFilter, FlightsTravelClass, FlightsTripType, diff --git a/src/internal/version.ts b/src/internal/version.ts index 1223b7a..9aaee5c 100644 --- a/src/internal/version.ts +++ b/src/internal/version.ts @@ -6,4 +6,4 @@ * * @internal */ -export const SDK_VERSION = "0.16.0"; +export const SDK_VERSION = "0.22.0";