Restaurant API

This document outlines the API operations for retrieving restaurant data. The information with images may not unmatched. Below are the typical operations you can perform.

Base URL: https://fdelux.globeapp.dev/api

Endpoint Summary

Method Path Description
GET: /api/restaurants Fetch All Restaurants
GET: /api/restaurants/popular Fetch Popular Restaurants
POST: /api/restaurants/nearby Fetch Nearby Restaurants
GET: /api/restaurants/cuisine-categories Fetch Cuisine Categories
GET: /api/restaurants/dietary-options Fetch Dietary Options
POST: /api/restaurants/filter Filter Restaurants
GET: /api/restaurants/{id} Find Restaurant by ID
GET: /api/restaurants/{id}/menu-items Fetch Menu Items by Restaurant ID
GET: /api/restaurants/{id}/reviews Fetch Reviews by Restaurant ID

Fetch All Restaurants

  • Method: GET
  • Endpoint: /restaurants

Example Request URL: https://fdelux.globeapp.dev/api/restaurants

Request

headers
{
  "Content-Type": "application/json",
  "Authorization": "Bearer your-access-token"
}

Responses

200 OK
{
  "message": "All restaurants fetched successfully",
  "data": {
    "restaurants": [
      {
        "id": 2001,
        "name": "The Gourmet Bistro",
        "rating": 4.9,
        "location": {
          "street_address": "10 Downing Street",
          "city": "London",
          "state_province": "England",
          "postal_code": "SW1A 2AA",
          "country": "United Kingdom",
          "latitude": 51.5033,
          "longitude": -0.1276
        },
        "cover": "https://fdelux.globeapp.dev/images/restaurants/pexels-chan-walrus-958545.jpg",
        "cuisine": "French",
        "lowest_price": 2.24,
        "highest_price": 24.32
      },
      {
        "id": 2002,
        "name": "Spice Route Indian Cuisine",
        "rating": 4.5,
        "location": {
          "street_address": "25 Spice Alley",
          "city": "Manchester",
          "state_province": "England",
          "postal_code": "M1 1AA",
          "country": "United Kingdom",
          "latitude": 53.4808,
          "longitude": -2.2426
        },
        "cover": "https://fdelux.globeapp.dev/images/restaurants/pexels-rajesh-tp-1624487.jpg",
        "cuisine": "Indian",
        "lowest_price": 2.24,
        "highest_price": 24.32
      }
    ]
  }
}
401 Unauthenticated
{
  "message": "Authentication required. Please provide a Bearer token.",
  "details": "Include a valid Bearer token in the Authorization header."
}
500 Internal Server Error
{
  "message": "An unexpected error occurred while fetching all restaurants.",
  "details": "Error message details here."
}

Fetch Nearby Restaurants

  • Method: POST
  • Endpoint: /restaurants/nearby

Example Request URL: https://fdelux.globeapp.dev/api/restaurants/nearby

Request

headers
{
  "Content-Type": "application/json",
  "Authorization": "Bearer your-access-token"
}
body
{
  "latitude": 51.5074,
  "longitude": -0.1278,
  "radius": 50.0 // in kilometers
}

Responses

200 OK
{
  "message": "Found 1 nearby restaurants",
  "data": {
    "restaurant_count": 1,
    "restaurants": [
      {
        "id": 2001,
        "name": "The Gourmet Bistro",
        "rating": 4.9,
        "location": {
          "street_address": "10 Downing Street",
          "city": "London",
          "state_province": "England",
          "postal_code": "SW1A 2AA",
          "country": "United Kingdom",
          "latitude": 51.5033,
          "longitude": -0.1276
        },
        "cover": "https://fdelux.globeapp.dev/images/restaurants/pexels-chan-walrus-958545.jpg",
        "cuisine": "French",
        "lowest_price": 2.24,
        "highest_price": 24.32
      }
    ]
  }
}
400 Bad Request
{
  "message": "Invalid parameters for nearby search.",
  "details": "Please provide valid 'latitude', 'longitude' (numeric), and 'radius' (positive numeric) in the request body."
}
401 Unauthenticated
{
  "message": "Authentication required. Please provide a Bearer token.",
  "details": "Include a valid Bearer token in the Authorization header."
}
404 Not Found
{
  "message": "No nearby restaurants found",
  "details": "Try adjusting your coordinates or increasing the search radius."
}
405 Method Not Allowed
{
  "message": "Method Not Allowed",
  "details": "Only POST requests are supported for this endpoint when using a request body."
}
500 Internal Server Error
{
  "message": "An unexpected error occurred while fetching nearby restaurants.",
  "details": "Error message details here."
}

Fetch Cuisine Categories

  • Method: GET
  • Endpoint: /restaurants/cuisine-categories

Example Request URL: https://fdelux.globeapp.dev/api/restaurants/cuisine-categories

Request

headers
{
  "Content-Type": "application/json",
  "Authorization": "Bearer your-access-token"
}

Responses

200 OK
{
    "message": "Cuisine categories fetched successfully",
    "data": {
        "cuisine_categories": [
            "All",
            "French",
            "Indonesian",
            "Italian",
            "Vegan",
            "Japanese",
            "Cafe"
        ]
    }
}
401 Unauthenticated
{
  "message": "Authentication required. Please provide a Bearer token.",
  "details": "Include a valid Bearer token in the Authorization header."
}
500 Internal Server Error
{
  "message": "An unexpected error occurred while fetching cuisine-categories.",
  "details": "Error message details here."
}

Fetch Dietary Options

  • Method: GET
  • Endpoint: /restaurants/dietary-options

Example Request URL: https://fdelux.globeapp.dev/api/restaurants/dietary-options

Request

headers
{
  "Content-Type": "application/json",
  "Authorization": "Bearer your-access-token"
}

Responses

200 OK
{
  "message": "Dietary options fetched successfully",
  "data": {
    "dietary_options": [
      "All",
      "Vegetarian",
      "Gluten-Free",
      "Halal",
      "Vegan",
      "Organic",
      "Pescatarian",
      "Vegan Options"
    ]
  }
}
401 Unauthenticated
{
  "message": "Authentication required. Please provide a Bearer token.",
  "details": "Include a valid Bearer token in the Authorization header."
}
500 Internal Server Error
{
  "message": "An unexpected error occurred while fetching dietary options.",
  "details": "Error message details here."
}

Filter Restaurants

  • Method: POST
  • Endpoint: /restaurants/filter

Example Request URL: https://fdelux.globeapp.dev/api/restaurants/filter

Request

headers
{
  "Content-Type": "application/json",
  "Authorization": "Bearer your-access-token"
}
body
{
  "cuisine": "Italian",
  "dietary_option": "Vegetarian"
}

Responses

200 OK
{
  "message": "Restaurants filtered successfully",
  "data": {
    "restaurant_count": 1,
    "restaurants": [
      {
        "id": 2003,
        "name": "Pasta Paradise",
        "rating": 4.6,
        "location": {
          "street_address": "15 Pasta Lane",
          "city": "Rome",
          "state_province": "Lazio",
          "postal_code": "00100",
          "country": "Italy",
          "latitude": 41.9028,
          "longitude": 12.4964
        },
        "cover": "https://fdelux.globeapp.dev/images/restaurants/pexels-engin-akyurt-2955816.jpg",
        "cuisine": "Italian",
        "lowest_price": 2.24,
        "highest_price": 24.32
      }
    ]
  }
}
400 Bad Request
{
  "message": "Missing required parameters.",
  "details": "Please provide both \"cuisine\" (string) and \"dietary_option\" (string) in the request body."
}
401 Unauthenticated
{
  "message": "Authentication required. Please provide a Bearer token.",
  "details": "Include a valid Bearer token in the Authorization header."
}
404 Not Found
{
  "message": "No restaurants found matching the criteria",
  "details": "Try adjusting your filter parameters."
}
405 Method Not Allowed
{
  "message": "Method Not Allowed",
  "details": "Only POST requests are supported for this endpoint when using a request body."
}
500 Internal Server Error
{
  "message": "An unexpected error occurred while filtering restaurants.",
  "details": "Error message details here."
}

Find Restaurant by ID

  • Method: GET
  • Endpoint: /restaurants/{id}

Example Request URL: https://fdelux.globeapp.dev/api/restaurants/2001

Request

headers
{
  "Content-Type": "application/json",
  "Authorization": "Bearer your-access-token"
}

Responses

200 OK
{
  "message": "Restaurant fetched successfully",
  "data": {
    "restaurant": {
      "id": 101,
      "name": "The Gourmet Haven",
      "description": "A Michelin-starred restaurant offering a modern twist on classic French cuisine.",
      "rating": 4.9,
      "lowest_price": 17.92,
      "highest_price": 41.6,
      "location": {
        "street_address": "10 Rue de la Paix",
        "city": "Paris",
        "state_province": "Île-de-France",
        "postal_code": "75002",
        "country": "France",
        "latitude": 48.8672,
        "longitude": 2.3263
      },
      "contact": {
        "phone": "+33 1 40 12 34 56",
        "email": "[email protected]",
        "website": "https://www.gourmethaven.fr"
      },
      "cover": "https://fdelux.globeapp.dev/images/restaurants/pexels-pixabay-262978.jpg",
      "images": [
        "https://fdelux.globeapp.dev/images/restaurants/pexels-pixabay-262978.jpg",
        "https://fdelux.globeapp.dev/images/restaurants/pexels-reneasmussen-3289078.jpg",
        "https://fdelux.globeapp.dev/images/restaurants/pexels-valeriya-32083393.jpg",
        "https://fdelux.globeapp.dev/images/restaurants/pexels-fwstudio-1722183.jpg"
      ],
      "image_sources": [
        "https://www.pexels.com/"
      ],
      "cuisine": "French",
      "dietary_options": [
        "Vegetarian",
        "Gluten-Free"
      ],
      "amenities": [
        "Free Wi-Fi",
        "Outdoor Seating",
        "Private Dining Rooms",
        "Valet Parking"
      ],
      "opening_hours": {
        "monday": "18:00-22:00",
        "tuesday": "18:00-22:00",
        "wednesday": "18:00-22:00",
        "thursday": "18:00-22:00",
        "friday": "18:00-23:00",
        "saturday": "18:00-23:00",
        "sunday": "Closed"
      }
    }
  }
}
400 Bad Request
{
  "message": "Invalid ID parameter",
  "details": "ID must be a valid integer."
}
401 Unauthenticated
{
  "message": "Authentication required. Please provide a Bearer token.",
  "details": "Include a valid Bearer token in the Authorization header."
}
404 Not Found
{
  "message": "Restaurant not found",
  "details": "No restaurant found with the provided ID: 2001"
}
500 Internal Server Error
{
  "message": "An unexpected error occurred while finding the restaurant.",
  "details": "Error message details here."
}

Fetch Menu Items by Restaurant ID

  • Method: GET
  • Endpoint: /restaurants/{id}/menu-items

Example Request URL: https://fdelux.globeapp.dev/api/restaurants/2001/menu-items

Request

headers
{
  "Content-Type": "application/json",
  "Authorization": "Bearer your-access-token"
}

Responses

200 OK
{
  "message": "Menu items fetched successfully",
  "data": {
    "menu_items": [
      {
        "id": 2001,
        "restaurant_id": 101,
        "name": "Pan-Seared Scallops",
        "description": "Perfectly seared scallops with saffron risotto and asparagus tips.",
        "price": 17.92,
        "image": "https://fdelux.globeapp.dev/images/restaurants/pexels-vovkapanda-6213714.jpg"
      },
      {
        "id": 2002,
        "restaurant_id": 101,
        "name": "Wagyu Beef Tenderloin",
        "description": "Grade A5 Wagyu beef, cooked to perfection, served with truffle mashed potatoes.",
        "price": 41.6,
        "image": "https://fdelux.globeapp.dev/images/restaurants/pexels-goumbik-1352269.jpg"
      }
    ]
  }
}
400 Bad Request
{
  "message": "Invalid restaurant ID parameter",
  "details": "Restaurant ID must be a valid integer."
}
401 Unauthenticated
{
  "message": "Authentication required. Please provide a Bearer token.",
  "details": "Include a valid Bearer token in the Authorization header."
}
404 Not Found
{
  "message": "No menu items found for this restaurant",
  "details": "No menu item data available for restaurant ID: 2001"
}
500 Internal Server Error
{
  "message": "An unexpected error occurred while fetching menu items.",
  "details": "Error message details here."
}

Fetch Reviews by Restaurant ID

  • Method: GET
  • Endpoint: /restaurants/{id}/reviews

Example Request URL: https://fdelux.globeapp.dev/api/restaurants/2001/reviews

Request

headers
{
  "Content-Type": "application/json",
  "Authorization": "Bearer your-access-token"
}

Responses

200 OK
{
  "message": "Reviews fetched successfully",
  "data": {
    "reviews": [
      {
        "id": 1,
        "restaurant_id": 2001,
        "user_id": 21,
        "user_name": "Emily White",
        "rating": 5.0,
        "comment": "Absolutely phenomenal! The Coq au Vin was a culinary masterpiece. Impeccable service and ambiance.",
        "created_at": "2025-07-01T19:00:00"
      },
      {
        "id": 2,
        "restaurant_id": 2001,
        "user_id": 22,
        "user_name": "David Green",
        "rating": 4.5,
        "comment": "Great food and a lovely atmosphere. The Salade Niçoise was fresh and delicious. A bit pricey but worth it.",
        "created_at": "2025-07-02T20:30:00"
      }
    ]
  }
}
400 Bad Request
{
  "message": "Invalid restaurant ID parameter",
  "details": "Restaurant ID must be a valid integer."
}
401 Unauthenticated
{
  "message": "Authentication required. Please provide a Bearer token.",
  "details": "Include a valid Bearer token in the Authorization header."
}
404 Not Found
{
  "message": "No reviews found for this restaurant",
  "details": "No review data available for restaurant ID: 2001"
}
500 Internal Server Error
{
  "message": "An unexpected error occurred while fetching reviews.",
  "details": "Error message details here."
}