Pointify

Guides

Build a fare calendar

Show the cheapest fare for every day on a route. Load what is cached first so the grid appears at once, then fill the gaps with a live search.

Step 1: Load cached fares

GET /v1/calendar/fares returns the cheapest cached fare for each day from start_date to end_date (up to 62 days). It answers at once.

curl "https://api.pointifytravels.com/v1/calendar/fares?origin=JFK&destination=LAX&start_date=2027-01-13&end_date=2027-01-19" \
  -H "Authorization: Bearer $POINTIFY_API_KEY"
Response
{
  "origin": "JFK",
  "destination": "LAX",
  "fares": [
    {
      "date": "2027-01-13",
      "price": 169
    },
    {
      "date": "2027-01-19",
      "price": null
    }
  ],
  "source": "partial",
  "payWith": "cash",
  "search_type": "both"
}

Days we have not priced yet come back with price: null and are priced in the background, so the same call a few minutes later fills them in. source says how complete the answer is: cache (every day known), partial or warming (none yet).

Step 2: Fill gaps live

If the traveler is waiting, price the days live with POST /v1/calendar/search. It streams one calendar_day event per day around target_date, cached days first, then complete.

curl -N -X POST "https://api.pointifytravels.com/v1/calendar/search" \
  -H "Authorization: Bearer $POINTIFY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"origin":"JFK","destination":"LAX","target_date":"2027-01-23","days_before":3,"days_after":3}'

Step 3: Merge the two

Key days by date. Draw the cached grid first, then update cells as live days arrive.

JavaScript
// days: Map of "YYYY-MM-DD" -> { cash, points }
const days = new Map();

// 1. Cached fares (price may be null for days not priced yet)
for (const { date, price } of cached.fares) {
  days.set(date, { cash: price, points: null });
}

// 2. Live calendar_day events from the stream fill in and refresh days
function onCalendarDay(day) {
  days.set(day.date, { cash: day.min_cash, points: day.min_points });
  render(days); // redraw as each day arrives
}

What to show users

  • Each day's price, with the cheapest day in the range highlighted.
  • Days without a price as "checking", not as sold out.
  • A cash and points switch: search_type picks which. With points, the cached calendar returns miles prices instead of cash.
  • A short note that prices are the lowest found and can change at booking.

Both endpoints return sample data with a test key. See Test mode.

Ready to find your best fare?

Create a free account to save your travel plans and explore cash and points options.

Create Free Account