Skip to content

Add server-side filters to airbnb_search#32

Open
FabioFleitas wants to merge 2 commits into
openbnb-org:mainfrom
FabioFleitas:add-search-filters
Open

Add server-side filters to airbnb_search#32
FabioFleitas wants to merge 2 commits into
openbnb-org:mainfrom
FabioFleitas:add-search-filters

Conversation

@FabioFleitas

Copy link
Copy Markdown

Summary

Adds server-side filter parameters to airbnb_search for the filters Airbnb's UI exposes but the tool didn't pass through. Lets agents narrow searches by amenities, quality flags, and minimum room counts before the response is returned, which matters on popular destinations where the unfiltered set is hundreds of listings.

What changed

New airbnb_search parameters:

  • amenities — typed enum array. Supported values: wifi, air_conditioning, washer, kitchen, free_parking, pool, hot_tub, king_bed, self_checkin. Mapped internally to Airbnb's numeric IDs (e.g. amenities[]=4).
  • instantBook — boolean → ib=true
  • guestFavorite — boolean → guest_favorite=true
  • minBedrooms, minBeds, minBathrooms — numbers → min_*
  • ne_lat, ne_lng, sw_lat, sw_lng — numbers. Manual bounding-box override; suppresses the Photon/Nominatim geocoder for that request when all four are supplied (useful when the agent already has map coordinates).

README:

  • Adds Features bullets and parameter documentation for the new fields.

Implementation notes

  • Amenity name → numeric ID mapping lives in a constants table (AMENITY_IDS), discovered by toggling each filter in Airbnb's "All filters" modal and reading the URL. New amenities can be added with one line — same recon technique as future-proofing.
  • King bed lives under "Amenities → Features" in Airbnb's modal (not under "Rooms and beds"), so it's exposed via amenities: ["king_bed"] rather than a separate bed-type filter. Documented in the parameter description.
  • "Allows pets" isn't added as a separate filter parameter because the existing pets >= 1 parameter already filters for pet-friendly listings (Airbnb encodes both as pets=N).
  • Superhost is no longer a top-level filter in Airbnb's current UI, so it's not exposed.
  • Unknown amenity names log a warning and are dropped silently rather than failing the request — typo-tolerant.

Testing

End-to-end via the MCP stdio protocol against Lisbon, Portugal:

  • Each filter sends the expected URL params (amenities map to correct IDs, booleans to the right flags, etc.).
  • Manual bbox correctly suppresses the third-party geocoder.
  • Unknown amenity warns + drops silently while valid amenities still attach.
  • Real result inventory changes as expected (page 1, top-5 listing IDs vs unfiltered baseline):
    • amenities: ["king_bed"] → 0/5 overlap (completely different inventory)
    • minBedrooms: 4 → 0/5 overlap (small-bedroom places filtered out)
    • guestFavorite: true → 4/5 overlap (clean subset of baseline, as expected for a curated bucket)
    • instantBook: true → 1/5 overlap (partial subset)

FabioFleitas and others added 2 commits April 26, 2026 19:28
Wire up the search filters Airbnb's UI exposes but the tool didn't:
- amenities: typed enum array (wifi, air_conditioning, washer, kitchen,
  free_parking, pool, hot_tub, king_bed, self_checkin) → mapped to
  Airbnb's internal numeric IDs via a constants map
- instantBook, guestFavorite booleans
- minBedrooms, minBeds, minBathrooms numbers
- ne_lat / ne_lng / sw_lat / sw_lng for manual bounding-box override,
  which suppresses Photon/Nominatim geocoding when all four are supplied

The existing 'pets' parameter already filters for pet-friendly listings
when set to >= 1; documented in the amenities description rather than
adding a duplicate boolean.

Superhost is no longer present in Airbnb's filter modal, so not exposed.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds Features bullets and parameter documentation for the amenity
filters, Guest Favorite, Instant Book, min bedroom/bed/bathroom
counts, and manual bbox override introduced in the previous commit.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

1 participant