Search suggestion

This endpoint is used to suggest location (state, city, province, district,...), project (as Vinhomes, TimeCitys,...), streets (as Cau Giay, Giai Phong,...), and rooms base on term user typed.

Endpoint

Method URI Headers
GET /api/search/suggestion
Accept: application/json
Accept-Language: <language>

Data Params

Param Description Type Required
query Term search. String Yes

Request & Response Examples

Successful Response

201

Example request

curl -X POST \
  'https://api.luxstay.com/api/search/suggestion?page=1' \
  -H 'Accept: application/json' \
  -H 'Accept-Language: en' \
  -H 'Mobile-Client: android' \
  -H 'cache-control: no-cache' \
  -d query=hanoi
1
2
3
4
5
6
7

Example response

{
  "data": {
    "country": [
      
    ],
    "state": [
      {
        "id": 352,
        "display_text": "Ha\u0300 N\u00f4\u0323i, Vietnam",
        "type": "state",
        "count": 1270,
        "name": "H\u00e0 N\u1ed9i",
        "path": "vietnam\/ha-noi"
      }
    ],
    "city": [
      
    ],
    "area": [
      
    ],
    "room": [
      {
        "id": 13671,
        "display_text": "Bungalow Room 3 apartment - T\u1ea3n \u0110\u00e0 Spa Resort",
        "type": "Rooms",
        "count": 0
      },
      {
        "id": 13674,
        "display_text": "Bungalow 1 ph\u00f2ng  - T\u1ea3n \u0110\u00e0 Spa Resort",
        "type": "Rooms",
        "count": 0
      },
      {
        "id": 13678,
        "display_text": "Family Room Lake View - T\u1ea3n \u0110\u00e0 Spa Resort",
        "type": "Rooms",
        "count": 0
      },
      {
        "id": 17109,
        "display_text": "V\u01b0\u1eddn Qu\u1ea3 Villa",
        "type": "Rooms",
        "count": 0
      },
      {
        "id": 13675,
        "display_text": "Lake view Executive Suite 02 - T\u1ea3n \u0110\u00e0 Spa Resort",
        "type": "Rooms",
        "count": 0
      },
      {
        "id": 13670,
        "display_text": "Manor House - T\u1ea3n \u0110\u00e0 Spa Resort",
        "type": "Rooms",
        "count": 0
      }
    ],
    "destination": [
      
    ]
  },
  "code": 200,
  "request_id": "14891298-9b01-4058-9c15-53cc17b1e53a"
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66

Error Response

Reason validation errors

Example response

{
    "message": "The given data was invalid.",
    "errors": {
        "name": [
            "The query field is required."
        ]
    }
}
1
2
3
4
5
6
7
8
Last Updated: 5/2/2019, 10:18:33 AM