Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/astrxnomo/tourify/llms.txt

Use this file to discover all available pages before exploring further.

Places are the core resource in Tourify — individual points of interest (landmarks, restaurants, museums, etc.) that belong to a city and a category. All place endpoints are publicly accessible — no authentication token is required.

List Places

GET /api/places Returns a flat array of all places, optionally filtered by city, category, or a search term. Each place includes its images, city, category, and a computed average_rating. Results are ordered by average rating descending so that the best-rated places appear first. Authentication: Not required.

Query parameters

city_id
integer
Filter results to places that belong to the city with this ID. Omit to return places from all cities.
category_id
integer
Filter results to places that belong to the category with this ID. Omit to return places from all categories.
Full-text search term. The API performs a case-insensitive LIKE match against the place name, address, and the name of the related city. Multiple filters can be combined — for example, city_id=1&search=park returns places in city 1 whose name, address, or city name contains “park”.

Response — 200 OK

Returns a JSON array sorted by average_rating descending. Each element has the following shape:
[].id
integer
Auto-incremented place ID.
[].city_id
integer
FK referencing the parent city.
[].category_id
integer
FK referencing the place’s category.
[].name
string
The place name.
[].description
string
Long-form description of the place.
[].address
string
Street address of the place.
[].latitude
number | null
Decimal latitude coordinate (precision: 10, scale: 7).
[].longitude
number | null
Decimal longitude coordinate (precision: 10, scale: 7).
[].average_rating
number
Mean of all review ratings for the place, rounded to one decimal place. Returns 0 if there are no reviews.
[].images
array
Polymorphic images attached to this place via the imageable morph relation.
[].city
object
The city this place belongs to.
[].category
object
The category this place belongs to.
[].created_at
string
ISO 8601 creation timestamp.
[].updated_at
string
ISO 8601 last-update timestamp.
Example — all places
curl -X GET http://localhost:8000/api/places \
  -H "Accept: application/json"
Example — filter by city and category
curl -X GET "http://localhost:8000/api/places?city_id=1&category_id=2" \
  -H "Accept: application/json"
Example — search by keyword
curl -X GET "http://localhost:8000/api/places?search=park" \
  -H "Accept: application/json"
Example response (200)
[
  {
    "id": 3,
    "city_id": 1,
    "category_id": 2,
    "name": "Sagrada Família",
    "description": "Antoni Gaudí's iconic unfinished basilica, a UNESCO World Heritage Site.",
    "address": "Carrer de Mallorca, 401, 08013 Barcelona",
    "latitude": 41.4036299,
    "longitude": 2.1743558,
    "average_rating": 4.8,
    "reviews_avg_rating": 4.8,
    "images": [
      {
        "id": 21,
        "url": "https://example.com/images/sagrada.jpg",
        "imageable_type": "App\\Models\\Place",
        "imageable_id": 3,
        "created_at": "2026-05-01T08:00:00.000000Z",
        "updated_at": "2026-05-01T08:00:00.000000Z"
      }
    ],
    "city": {
      "id": 1,
      "name": "Barcelona",
      "description": "A vibrant city on the northeastern coast of Spain.",
      "country": "Spain",
      "created_at": "2026-05-01T08:00:00.000000Z",
      "updated_at": "2026-05-01T08:00:00.000000Z"
    },
    "category": {
      "id": 2,
      "name": "Monuments",
      "description": "Historic monuments and architectural landmarks.",
      "created_at": "2026-05-01T08:00:00.000000Z",
      "updated_at": "2026-05-01T08:00:00.000000Z"
    },
    "created_at": "2026-05-01T08:00:00.000000Z",
    "updated_at": "2026-05-01T08:00:00.000000Z"
  },
  {
    "id": 7,
    "city_id": 1,
    "category_id": 1,
    "name": "Museu Picasso",
    "description": "One of the most important collections of the artworks of Pablo Picasso.",
    "address": "Carrer de Montcada, 15-23, 08003 Barcelona",
    "latitude": 41.3851,
    "longitude": 2.1810,
    "average_rating": 4.3,
    "reviews_avg_rating": 4.3,
    "images": [],
    "city": {
      "id": 1,
      "name": "Barcelona",
      "description": "A vibrant city on the northeastern coast of Spain.",
      "country": "Spain"
    },
    "category": {
      "id": 1,
      "name": "Museums",
      "description": "Art galleries, history museums, and science centres."
    },
    "created_at": "2026-05-01T08:00:00.000000Z",
    "updated_at": "2026-05-01T08:00:00.000000Z"
  }
]

Get Place

GET /api/places/{place} Returns a single place by ID with all related data eager-loaded: images, city, category, and reviews (each review includes the author’s user object). A computed average_rating is appended to the response. Authentication: Not required.

Path parameters

place
integer
required
The ID of the place to retrieve.

Response — 200 OK

id
integer
The place’s ID.
city_id
integer
FK referencing the parent city.
category_id
integer
FK referencing the place’s category.
name
string
The place name.
description
string
Long-form description of the place.
address
string
Street address of the place.
latitude
number | null
Decimal latitude coordinate (precision: 10, scale: 7).
longitude
number | null
Decimal longitude coordinate (precision: 10, scale: 7).
average_rating
number
Mean of all review ratings for the place, rounded to one decimal place. Returns 0 if there are no reviews.
images
array
Polymorphic images attached to this place.
city
object
The city this place belongs to.
category
object
The category this place belongs to.
reviews
array
All reviews submitted for this place via the polymorphic reviewable morph relation. Each review includes the author’s user object.
created_at
string
ISO 8601 creation timestamp.
updated_at
string
ISO 8601 last-update timestamp.
If no place with the given {place} ID exists, Laravel returns a 404 Not Found response automatically via model binding.
Example request
curl -X GET http://localhost:8000/api/places/3 \
  -H "Accept: application/json"
Example response (200)
{
  "id": 3,
  "city_id": 1,
  "category_id": 2,
  "name": "Sagrada Família",
  "description": "Antoni Gaudí's iconic unfinished basilica, a UNESCO World Heritage Site.",
  "address": "Carrer de Mallorca, 401, 08013 Barcelona",
  "latitude": 41.4036299,
  "longitude": 2.1743558,
  "average_rating": 4.8,
  "images": [
    {
      "id": 21,
      "url": "https://example.com/images/sagrada.jpg",
      "imageable_type": "App\\Models\\Place",
      "imageable_id": 3,
      "created_at": "2026-05-01T08:00:00.000000Z",
      "updated_at": "2026-05-01T08:00:00.000000Z"
    }
  ],
  "city": {
    "id": 1,
    "name": "Barcelona",
    "description": "A vibrant city on the northeastern coast of Spain.",
    "country": "Spain",
    "created_at": "2026-05-01T08:00:00.000000Z",
    "updated_at": "2026-05-01T08:00:00.000000Z"
  },
  "category": {
    "id": 2,
    "name": "Monuments",
    "description": "Historic monuments and architectural landmarks.",
    "created_at": "2026-05-01T08:00:00.000000Z",
    "updated_at": "2026-05-01T08:00:00.000000Z"
  },
  "reviews": [
    {
      "id": 5,
      "reviewable_type": "App\\Models\\Place",
      "reviewable_id": 3,
      "user_id": 42,
      "rating": 5,
      "comment": "Absolutely breathtaking. A must-see when visiting Barcelona.",
      "user": {
        "id": 42,
        "name": "Ada Lovelace",
        "email": "ada@example.com",
        "role_id": 2,
        "push_token": null,
        "created_at": "2026-05-15T10:30:00.000000Z",
        "updated_at": "2026-05-15T10:30:00.000000Z"
      },
      "created_at": "2026-05-10T14:22:00.000000Z",
      "updated_at": "2026-05-10T14:22:00.000000Z"
    },
    {
      "id": 9,
      "reviewable_type": "App\\Models\\Place",
      "reviewable_id": 3,
      "user_id": 17,
      "rating": 4,
      "comment": "Stunning architecture, but very crowded.",
      "user": {
        "id": 17,
        "name": "Grace Hopper",
        "email": "grace@example.com",
        "role_id": 2,
        "push_token": null,
        "created_at": "2026-05-12T09:00:00.000000Z",
        "updated_at": "2026-05-12T09:00:00.000000Z"
      },
      "created_at": "2026-05-13T11:05:00.000000Z",
      "updated_at": "2026-05-13T11:05:00.000000Z"
    }
  ],
  "created_at": "2026-05-01T08:00:00.000000Z",
  "updated_at": "2026-05-01T08:00:00.000000Z"
}

Build docs developers (and LLMs) love