> For the complete documentation index, see [llms.txt](https://hackathon-crew.gitbook.io/hackathon_crew-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hackathon-crew.gitbook.io/hackathon_crew-docs/api-reference.md). Agents can also search and read this documentation through its [MCP server](https://hackathon-crew.gitbook.io/hackathon_crew-docs/~gitbook/mcp).

# API Reference

Base URL : https\://museumquest-backend.onrender.com/api

## Museums:

#### GET `/museums`

Get all museums

**Response:**

```json
[
  {
    "id": 1,
    "name": "The Louvre",
    "city": "Paris",
    "country": "France",
    "yearFounded": 1793,
    "lat": 48.8606,
    "lng": 2.3376,
    "description": "...",
    "image": "./images/louvre.webp"
  }
]
```

#### GET `/museums/:id`

Get single museum by ID

### Passport System:

#### GET `/passport/:userId`

Get user's passport data

**Response:**

```json
{
  "username": "alice123",
  "xp": 145,
  "level": "Explorer",
  "stamps": [
    {
      "type": "VISITED",
      "museumId": 1,
      "timestamp": "2024-11-15T10:30:00Z"
    },
    {
      "type": "QUIZ_PASSED",
      "museumId": 1,
      "timestamp": "2024-11-15T10:45:00Z"
    }
  ],
  "visitedMuseums": [1, 2, 3]
}
```

#### POST `/passport/stamp`

Award a VISITED stamp

**Request:**

```json
{
  "userId": "alice123",
  "stampType": "VISITED",
  "museumId": 1,
  "username": "Alice"
}
```

**Response:**

```json
{
  "success": true,
  "xpGained": 10,
  "newXP": 155,
  "level": "Explorer"
}
```

#### POST `/passport/quiz`

Submit quiz results

**Request:**

```json
{
  "userId": "alice123",
  "museumId": 1,
  "score": 0.8
}
```

**Response:**

```json
{
  "success": true,
  "xpGained": 25,
  "newXP": 180,
  "level": "Curator"
}
```
