Skip to main content

Restaurant explorer

Goal: Power a discovery list or map screen from three read calls: brand → locations → hours.
Prep time: ~10 minutes

Off the shelf

The fastest path is FlynetDiscoveryClient from @flynetdev/core for the reads, plus the discovery components from @flynetdev/react for the UI: NearbyLocations, LocationCard, and OpenHoursBadge. Discovery components are presentational — fetch on the server with your API key and hand the result down as props, so the key never reaches the browser.
app/explore.tsx
NearbyLocations sorts venues by distance and renders each as a LocationCard; OpenHoursBadge computes “open now” from the weekly hours and the location’s IANA time zone. The same client-side filtering caveat below still applies — the components don’t change what the server returns.

From scratch

To see the three reads underneath, or work without React, call them directly. All three are Discovery routes: they take the API key, not an OAuth bearer.

What you’ll use

  • GET /flynet/v1/restaurants with X-API-Key
  • GET /flynet/v1/restaurants/{id}/locations with X-API-Key
  • GET /flynet/v1/locations/{id}/open_hours with X-API-Key

Code

Chef’s warning: Not every restaurant has locations. Brand entries without physical venues return { "locations": [], "pagination": {...} }. If you naively index locations[0] you’ll hit undefined and the chained call to /locations/{id}/open_hours will 400. Always check locations.length before indexing.
Tasting note: open_hours is not paginated: at most 7 entries, one per weekday. Missing days mean closed.
Chef’s warning: “Open now” is computed client-side from open_hours + the location’s IANA time_zone. GET /locations filter params (restaurant, neighborhood, payments_enabled, is_club) are accepted but not implemented for launch; filter client-side.
From the kitchen: Filter out locations with coordinate: { latitude: 0.0, longitude: 0.0 } before placing markers; that value indicates missing geocoding.
Tasting note: Location objects also carry reservation-related fields describing whether and how a venue takes bookings. See the API reference for the per-field shapes; there’s no standalone reservation resource at launch.
Next: Check-in feed: activity overlay for the same venues.