Places
The places endpoints allow you to search for destinations and retrieve location details. Use these endpoints to help users find locations for their hotel searches.
The places endpoints do not require authentication and can be called without an API key.
The place models
PlaceSearchRequest object
- Name
text_query- Type
- string
- Description
The search text (city name, address, landmark, etc.). Required. Min length: 1.
- Name
type- Type
- string
- Description
Filter by place type (optional).
- Name
language- Type
- string
- Description
Response language code (e.g., "en", "es", "fr"). Optional.
PlaceSearchResponse object
- Name
results- Type
- array of PlaceSearchResult
- Description
Array of matching places.
PlaceSearchResult object
- Name
place_id- Type
- string
- Description
Unique identifier for the place (Google Places ID format).
- Name
display_name- Type
- string
- Description
Human-readable name for the place.
- Name
formatted_address- Type
- string
- Description
Full formatted address.
- Name
types- Type
- array of strings
- Description
Array of place types (locality, country, airport, etc.).
- Name
language- Type
- string
- Description
Language code of the response.
PlaceRetrieveRequest object
- Name
place_id- Type
- string
- Description
The place identifier from a search result. Required. Min length: 1.
PlaceDetails object
- Name
place_id- Type
- string
- Description
Unique identifier for the place.
- Name
display_name- Type
- string
- Description
Human-readable name for the place.
- Name
formatted_address- Type
- string
- Description
Full formatted address.
- Name
types- Type
- array of strings
- Description
Array of place types.
- Name
language- Type
- string
- Description
Language code of the response.
- Name
coordinates- Type
- Coordinates
- Description
Geographic coordinates.
Coordinates object
- Name
lat- Type
- number
- Description
Latitude.
- Name
lng- Type
- number
- Description
Longitude.
ApiResponse wrapper
All responses are wrapped in a standard API response format:
- Name
data- Type
- T
- Description
The response data (PlaceSearchResponse or PlaceDetails).
- Name
success- Type
- boolean
- Description
Whether the request was successful.
- Name
message- Type
- string
- Description
Error message if unsuccessful.
Search places
Search for places by text query. Returns a list of matching destinations that can be used for hotel availability searches.
Required parameters
- Name
text_query- Type
- string
- Description
The search text (city name, address, landmark, etc.).
Optional parameters
- Name
type- Type
- string
- Description
Filter by place type.
- Name
language- Type
- string
- Description
Response language code (e.g., "en", "es", "fr").
Request
curl -G https://api.tripedge.com/v1/places/search \
-d text_query="New York"
Response
{
"data": {
"results": [
{
"place_id": "ChIJOwg_06VPwokRYv534QaPC8g",
"display_name": "New York, NY, USA",
"formatted_address": "New York, NY, USA",
"types": ["locality", "political"],
"language": "en"
},
{
"place_id": "ChIJ7cv00DwsDogRAMDACa2m4K8",
"display_name": "New York Mills, MN, USA",
"formatted_address": "New York Mills, MN, USA",
"types": ["locality", "political"],
"language": "en"
},
{
"place_id": "ChIJ4dG5s4WEwokRY6X3gqy4TGw",
"display_name": "John F. Kennedy International Airport",
"formatted_address": "Queens, NY 11430, USA",
"types": ["airport", "point_of_interest"],
"language": "en"
}
]
},
"success": true,
"message": null
}
Retrieve place
Retrieves detailed information about a specific place, including its coordinates. Use the returned coordinates for availability searches when you have a place_id.
Path parameters
- Name
place_id- Type
- string
- Description
The place identifier from a search result.
Request
curl https://api.tripedge.com/v1/places/ChIJOwg_06VPwokRYv534QaPC8g
Response
{
"data": {
"place_id": "ChIJOwg_06VPwokRYv534QaPC8g",
"display_name": "New York, NY, USA",
"formatted_address": "New York, NY, USA",
"types": ["locality", "political"],
"language": "en",
"coordinates": {
"lat": 40.7127753,
"lng": -74.0059728
}
},
"success": true,
"message": null
}
Using places with availability
After retrieving a place, you can use either the place_id directly or the coordinates in your availability search.
Using place_id
The simplest approach - pass the place_id directly to the availability endpoint:
{
"place_id": "ChIJOwg_06VPwokRYv534QaPC8g",
"check_in": "2024-03-15",
"check_out": "2024-03-18",
"rooms": [{ "adults": 2, "children": 0, "children_ages": [] }]
}
Using coordinates
For more control over the search area, use coordinates with an optional radius:
{
"coordinates": {
"lat": 40.7127753,
"lng": -74.0059728
},
"radius": 10000,
"check_in": "2024-03-15",
"check_out": "2024-03-18",
"rooms": [{ "adults": 2, "children": 0, "children_ages": [] }]
}
The radius parameter specifies the search radius in meters (default: 10000, max: 50000).