old stocks direct scrape #2

Open
opened 2026-07-10 12:01:26 +01:00 by jtr · 1 comment
Owner
https://app.mews.com/distributor/d0b39796-92ee-4664-bb50-aa4d00eb0c0c
Author
Owner

Implemented in commit c2e1a97 as the mews profile.

Approach: httpx against the Mews Booking Engine v1 API (api.mews.com/api/bookingEngine/v1/). No registration required — uses the same client identity as the public widget (Mews Distributor 5745.0.0) with a computed session token. Two API calls per scrape run: getAvailability once for 90 days (returns room counts per category), then getPricing per bookable date.

Room quantity: yes — availabilities[] count per room category from the availability endpoint.

Prices: proper net/gross split (amountBeforeTax = net, amountAfterTax = gross incl. VAT).

Timezone: reads ianaTimeZoneIdentifier from the property config, so BST/GMT handled correctly automatically.

Config param: only needs the UUID from the /distributor/ URL — enterpriseId, serviceId, and age category are fetched and cached on first call.

Implemented in commit c2e1a97 as the `mews` profile. **Approach:** httpx against the Mews Booking Engine v1 API (`api.mews.com/api/bookingEngine/v1/`). No registration required — uses the same client identity as the public widget (`Mews Distributor 5745.0.0`) with a computed session token. Two API calls per scrape run: `getAvailability` once for 90 days (returns room counts per category), then `getPricing` per bookable date. **Room quantity:** yes — `availabilities[]` count per room category from the availability endpoint. **Prices:** proper net/gross split (`amountBeforeTax` = net, `amountAfterTax` = gross incl. VAT). **Timezone:** reads `ianaTimeZoneIdentifier` from the property config, so BST/GMT handled correctly automatically. **Config param:** only needs the UUID from the `/distributor/` URL — `enterpriseId`, `serviceId`, and age category are fetched and cached on first call.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: hotel-manage-stack/rates#2
No description provided.