directrate

Changelog

What shipped, and when.

Dated from the gateway's own commits and the Actor's publishing notes.

Clearer errors for a slow source and for a room that is too small

  • A hotel search that gets no answer in time now says so: GET /v1/hotels and GET /v1/suggest answer 504 upstream_timeout, as /v1/shop already did. Until now they answered 500 with “internal error”. Not billed, and a retry a few seconds later often succeeds.
  • GET /v1/hotel falls back to the stored record when the chain does not answer in time, instead of answering 500.
  • Marriott, more guests than a room takes: a shop for an occupancy the hotel does not sell (four adults in one room, for example) answers 400 invalid_request with a sentence that says so. It used to answer 503 source_unavailable, which invited a retry that could not work. Not billed. In a comp set that hotel is one row with status: "error", and the other hotels are still answered.

Hotel ids on the OTAs, by name

  • GET /v1/hotels works on the OTAs: chain=booking (or expedia, hotelscom, ctrip, agoda) with q set to a hotel’s name and city returns that hotel with its id on the OTA as code, ready for /shop, /calendar and /compset on it. It works for any hotel listed on Google Hotels, a chain’s or an independent. A place instead of a name returns the first five hotels listed for it, and the answer’s note says that it is a sample.
  • One credit when an id comes back; nothing when the hotel is not listed on that OTA. These lookups run one at a time, so a busy moment answers 429 with a Retry-After.
  • The Apify Actor’s Find hotel codes mode takes an OTA the same way: put the hotel’s name in “Place or hotel name”. Until now that combination was refused.

MCP server

  • POST https://api.directrate.dev/mcp: the API as a Model Context Protocol server — Streamable HTTP, stateless, the same x-api-key. Sixteen tools — shop, award, parity, calendar, compset, stay, hotels, hotel, matrix, job, job_cells, watches, watch_create, watch_delete, chains, usage — each one is the /v1 endpoint it names, with that endpoint’s request schema as its input and its billing line as its price.
  • A tool call is replayed through the gateway’s own /v1 pipeline, so the key, the rate limit, the quota and the meter run once per call and the result carries credits_charged — the number X-Credits-Charged shows on REST. No surcharge; one allowance for REST, Apify and MCP.
  • Resources directrate://chains and directrate://pricing; prompts shop_hotel and direct_vs_ota. Refused calls are tool errors with the envelope and retry_after_sec, never protocol failures.
  • directrate.dev/mcp with the one-line install prompt and the Claude Code, Cursor, VS Code and Claude Desktop configs; /mcp/install.md is the guide as text for an agent to follow; docs.
  • OAuth sign-in for connectors: Claude.ai, Claude Desktop, Claude mobile and ChatGPT add https://api.directrate.dev/mcp as a custom connector and sign in — dynamic client registration, PKCE, a consent page that binds the connection to one of your API keys, hour-long access tokens with rotating refresh. Revoke the key to disconnect.
  • @directrate/mcp on npm: a stdio bridge for clients that only run local servers (npx -y @directrate/mcp, alias directrate-mcp, with DIRECTRATE_API_KEY); it forwards every request to the endpoint above, so its tools are always the server’s.
  • Feeds (POST /v1/feeds, /dashboard/feeds, docs): a matrix on a schedule — a rolling window of nights over up to 200 hotels, refreshed hourly to daily and billed as the same /matrix call — served as CSV, JSON lines or JSON at a stable URL under a per-feed token, for Google Sheets, Looker Studio, Power BI, Postgres, BigQuery and Snowflake. A per-feed monthly budget (half the plan’s allowance by default) stops a refresh that would cross it; a feed nobody reads for three intervals, or that fails three times, pauses itself. A signed feed.refreshed webhook is optional; GET /v1/usage now reports the committed scheduled spend.

Actor 0.2

Wyndham, the five OTAs, parity, stay, free-night certificates

  • Wyndham joins as the eleventh chain: public and member cash rates and a native price calendar; rooms and plans named by code, as the chain’s anonymous booking flow names them.
  • Booking.com, Expedia, Hotels.com, Trip.com and Agoda are sources of their own: /shop, /calendar and /compset with the OTA’s hotel id as the code, tax-inclusive on the comparable field, Genius / Member Price / Member deal reported apart.
  • POST /parity: the direct public rate, member rate and points beside each OTA’s public price for the same stay — per-channel gap, cheapest channel, deepest undercut, a verdict. The id map (GET /hotels/{chain}/{code}/ids) resolves OTA ids from Google Hotels’ own cross-source match; POST /hotels/ids/jobs fills it for a city without a burst.
  • POST /stay: a 2–14 night stay as one against each night alone, with the split verdict.
  • Free-night certificates on /award, /compset/award and matrix cells: Marriott 35k/40k/50k/85k, Hilton free night, IHG 40k, with the top-up each needs.
  • Watches gain condition: "undercut" — the parity alert.
  • Apify Actor 0.2 published: parity and stay modes, the OTAs as chains, certificate columns. Calendar pricing on the listing corrected to 0.1 credit a night on native-calendar chains.

Native calendars on nine chains

  • /calendar nights now ride each chain’s own date-range endpoint where one exists — IHG (62 nights of cash, member and points per call), Hilton (a month, points or cash), Marriott (30-day windows, cash or points), Choice (31 dates, award and cash), Radisson (a year of public and member cash with minimum stay), I Prefer (18 months of cash and points), Wyndham (a month of cash), Best Western (synthesised from 365-night rate-plan spans), Meliá (availability only, so /calendar skips the closed nights).
  • A night through a native calendar is billed 0.1 credit (0.25 on Wyndham) instead of the shop weight; calendar_night_credits is on GET /chains.
  • max_age on /shop, /award and /calendar bounds the cache staleness you accept; 0 forces live.
  • POST /matrix, /jobs, /export, /watches, /award/search, /award/value, /calendar/area: the cell store and the batch subsystem behind flexible-date award search, exports and signed-webhook watches.
  • Hyatt’s points calendar is not available yet; /calendar on Hyatt shops the open nights.

Actor 0.1

Launch: ten chains, the Apify Actor, pay-per-event

  • api.directrate.dev live with /shop, /award, /calendar, /compset, /compset/award, /suggest, /hotels, /hotel, /chains, /usage across Marriott, Hilton, Hyatt, IHG, Choice, Radisson, I Prefer, Meliá, Best Western and Premier Inn.
  • Every response states its own price in X-Credits-Charged; errors, not_found and timeouts bill 0; cache hits 0.25×; /compset per hotel returned with a 1-credit floor.
  • Public /status.json with measured uptime per source over the window, and /openapi.json with no key.
  • Apify Actor Hotel Rates, Award Points & OTA Parity published on the Store with one pay-per-event unit (credit-unit $0.003); the Free plan runs in demo mode (5 credits a run).
  • A past check-in date is refused as invalid_request on every chain, free, instead of being billed as a sold_out.