Skip to main content
GET
/
interests
Get All Interests
curl --request GET \
  --url https://api.example.com/interests
{
  "success": [
    {
      "id": 123,
      "name": "<string>"
    }
  ]
}

Endpoint

GET /interests

Description

Returns all interests available in the MayTravel system. This endpoint requires no authentication and returns a complete list of interests that users can associate with their profiles.

Request

This endpoint does not require any parameters or request body.

Headers

No special headers are required for this endpoint.

Response

success
array
Array of interest objects

Success Response (200 OK)

[
  {
    "id": 1,
    "name": "Hiking"
  },
  {
    "id": 2,
    "name": "Photography"
  },
  {
    "id": 3,
    "name": "Cultural Heritage"
  },
  {
    "id": 4,
    "name": "Adventure Sports"
  }
]

Error Response (500 Internal Server Error)

{
  "error": "Database connection failed"
}

Code Examples

const response = await fetch('http://your-api-base-url.com/interests', {
  method: 'GET',
  headers: {
    'Content-Type': 'application/json'
  }
});

const interests = await response.json();
console.log(interests);

Notes

  • This endpoint returns all interests without pagination
  • The interests are retrieved directly from the database
  • No authentication is required to view the list of interests

Build docs developers (and LLMs) love