---
title: "API Examples"
description: "Useful calls you can make to the API to see data."
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.easyjet-hackathon.uk/llms.txt
> Use this file to discover all available pages before exploring further.

# API Examples

Here are some example calls you can make to the live API to see useful information

All these examples are based on using CURL on your command line. They all expect the following two environment variables to be set.

```sh
export API=https://api.easyjet-hackathon.uk/
export KEY=the-key-everyone-shares
```



## REST API

### Health
See the status of the API and the data it is holding

```sh
curl $API/health
```
Response
```json
{
"ok": true,
"tables": {
    "bookings": 100,
    "csat": 100,
    "destination_airports": 170,
    "destinations": 189,
    "hotel_facility_items": 2013,
    "hotel_images": 2685,
    "hotels": 93,
    "members": 84
}
}
````

### Search for a holiday packages
This is searching against our live environment
```sh
curl -g -H "x-api-key: $KEY" "$API/api/search/packages?departure=MAN&geography=ES,ESBA&startDate=2026-11-06&duration=7&room[0].adults=2&room[0].children=0&room[0].infants=0&take=10&page=1&isFlexible=false"
```
Response
```json
{
"status": {
    "total": 162,
    "minPrice": 910.0,
    "maxPrice": 6435.0,
    "minPricePP": 455.0,
    "maxPricePP": 3218.0,
    "hasDiscont": true,
    "tracking": {
        "pToken": "aP41tm0p",
        "tracking": {
            "recommenderConfig": {
                "hash": "63a2eeb8a98255e2bda33523"
            },
            "ptoken": "aP41tm0p",
            "scorer": "personalized",
            "lastUserEvent": "pv_generic@2026-08-18T15:33:49.166312928Z"
        },
        "apiUrl": "https://api-y85858.smartseer.com/sort/v3/y85858"
    }
},
"offers": [
    ... 
],
"filters": [
    ...
],
"reorderFilters": false
}
```

### Hotel content
```sh
curl -g -H "x-api-key: $KEY" "$API/api/tripadvisor/7392738/reviews"
```
```json
{
"code": "X9000645",
"giataCode": "46801",
"name": "Catalonia Atenas",
"strapline": "ROOFTOP POOL WITH PANORAMIC VIEWS OF BARCELONA ",
"description": "<p>Located near the iconic Sagrada Familia, the Catalonia Atenas offers the perfect base for your <a href=\"~/link.aspx?_id=FEBF8B0F37CE403E90B751CFB0920264&amp;_z=z\">city break in Barcelona</a>. Expect a spacious room and plenty of essential amenities to help make your stay in this iconic city an extra-special one.</p><p>Begin your morning with a buffet breakfast, featuring a diverse range of meats, cheeses, and freshly baked pastries. When you&rsquo;re done, head to the rooftop pool and enjoy the Spanish sun, or take a moment to indulge at the hotel&rsquo;s luxury spa, which features an extensive menu of revitalising beauty treatments.</p><p>Meanwhile, the iconic Sagrada Familia&rsquo;s just a 17-minute stroll from the hotel. And, If you&rsquo;re looking to enjoy a little retail therapy, head to Las Glorias Shopping Centre, which offers a plethora of high-street brands and independent restaurants.</p><div>&nbsp;</div>",
"longitude": "2.1865",
"latitude": "41.411",
"address": "AVINGUDA MERIDIANA 151",
"postalCode": "8026",
"starRating": "4",
"rating": 3.8,
"numberOfReviews": 2368,
...
}
```


### Trip Advisor Reviews for a hotel
```sh
curl -g -H "x-api-key: $KEY" "$API/api/hotel/X9000645"
```
Response
```json
{
"data": [
    {
        "id": "1073321848",
        "lang": "en",
        "location_id": "7392738",
        "published_date": "2026-08-15T08:50:49-0400",
        "rating": 5,
        "helpful_votes": "0",
        "rating_image_url": "https://www.tripadvisor.com/img/cdsi/img2/ratings/traveler/s5.0-63520-5.svg",
        "url": "https://www.tripadvisor.com/ShowUserReviews-g188590-d7392738-r1073321848-Corendon_Amsterdam_New_West_a_Tribute_Portfolio_Hotel-Amsterdam_North_Holland_P.html?m=63520#review1073321848",
        "trip_type": null,
        "travel_date": "2026-05",
        "text": "Stayed for a couple of nights for the Harry Styles concert back in May.\n\nThe hotel was fantastic. Minutes walk from the tram stop which takes you straight into Central and to the Stadium.\n\nThe room was fantastic. Plenty of space. Spotless clean. \n\nStaff at the front desk were super friendly and professional, especially Victor Da Silva. \n\nWe forgot european plug to charge our phones and Victor sought one out for us to use during our stay. \n\nThere is a small shop in the hotel too for essentials if needed. \n\nWould definitely return next time we visit Amsterdam.",
        "user": {
            ...
        },
        "title": "Enjoyable Stay",
        "owner_response": {
            ...
        },
        "subratings": [
            ...
        ]
    },        
],
    "paging": {
    "next": null,
    "previous": null,
    "results": "5",
    "total_results": "5",
    "skipped": "0"
}
}
```

## GraphQL API

The Graph QL will let you search information that has been prepared for you. You can get to the 
[web interface for it to play with the data](https://api.easyjet-hackathon.uk/graphql). There you can build a example
query before you post it to the API.

### Get a list of all the bookings and the price

```
query MyQuery {
  bookings {
hotel_code
member_id
selling_price
  }
}
```
```sh
curl -H "x-api-key: $KEY" -H 'content-type: application/json' -d '{"query":"{ bookings { hotel_code member_id selling_price } }"}' $API/graphql
```
Response
```json
{
  "data": {
"bookings": [
  {
    "hotel_code": "CYLN0072",
    "member_id": "M0005",
    "selling_price": 2517.72
  },
  {
    "hotel_code": "TNNB0003",
    "member_id": "M0022",
    "selling_price": 1097.74
  },
  ...
```

### Bookings with hotel details
```
query MyQuery {
  bookings {
hotel_code 
member_id 
selling_price
hotel {
  name
  resort_name
  description
  tripadvisor_id
  giata_code
  latitude
  longitude
}
  }
}
```
```sh
curl -H "x-api-key: $KEY" -H 'content-type: application/json' -d '{"query":"{ bookings { hotel_code member_id selling_price hotel { name resort_name description tripadvisor_id giata_code latitude longitude } } }"}' $API/graphql


```
Response
```json
{
  "data": {
"bookings": [
  {
    "hotel_code": "CYLN0072",
    "member_id": "M0005",
    "selling_price": 2517.72,
    "hotel": {
      "name": "Mimosa Beach Hotel",
      "resort_name": "Protaras",
      "description": "Tempted by a chilled-out beach escape in Cyprus? This family-run hotel in the island&rsquo;s southeast corner is an ideal spot, with a sandy cove right on its doorstep and a couple of outdoor swimming pools, too &ndash; one for adults and another for children.&nbsp;<br />\n<br />\nExpect generous buffet breakfasts and dinners at the restaurant, and enjoy refreshing drinks at the poolside bar (which also offers a set menu lunch service).&nbsp;<br />\n<br />\nWhile this area offers plenty of peace and quiet, the towns of Protaras and Ayia Napa are also within easy reach, and home to an abundance of lively bars, clubs, cafes and restaurants. They&rsquo;re just a 5-10 minute taxi ride away (or a half hour walk into Protaras), and are great options for a day trip or a night out.&nbsp;<br />\n<div>&nbsp;</div>",
      "tripadvisor_id": "500760",
      "giata_code": "17482",
      "latitude": 34.9964,
      "longitude": 34.0703
    }
  },
  ...
```

Source: https://docs.easyjet-hackathon.uk/examples/index.mdx
