Use the interactive GraphQL explorer in the following sections to run a sample query. A test property ID is passed into the explorer; its test data is returned. The GraphQL explorer will help you get comfortable with the GraphQL:
For each query, a test property ID is passed into the explorer; its test data is returned.
Click Run Query to execute the query in the explorer on the page. You can modify the query to retrieve the desired fields, and the explorer provides a list of fields when you start typing.
Click API Explorer to launch the full explorer in another tab/window, which provides syntax highlighting, schema introspection, real-time error highlighting, and auto-completion, among other things.
Retrieving all reviews for a property
This query retrieves all reviews for a property and paginates the reviews, 10 per page.
The ID scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as "4") or integer (such as 4) input value will be accepted as an ID.
Status of the response. The following values may be returned: APPROVED,
BEFORE_SUBMITTED_FOR_MODERATION, QUEUED_FOR_LANG_DETECT, REJECTED,
BEFORE_SUBMITTED_TO_ES, SUBMITTED, and REMOVEDBYCLIENT.
Be aware that reviews may be pending for up to 14 days depending on lodging partner actions and review content.
Representation of a physical property, including its units, reservations, and promotions.
Field
Description
reviews
Not nullable.
Reviews provided by travelers for the property that match the specified arguments. You can specify these arguments:
filter (type: ReviewFilter), which provides additional arguments to filter the reviews that are returned by the query.
pageSize (type: Int!), which is required and specifies the maximum number
of reviews on each page (up to 100) returned by the response. For example, if
there are 15 reviews on a property, you can retrieve two pages if this
argument is set to 10 (page 1 includes 10 reviews, page 2 includes 5 reviews).
after (type: String), which is the cursor from the previous query response
that marked the end of the previous page of results.
orderBy (type: ReviewsOrderBy), which provides the sort order of results;
only one field should be specified. If not specified, reviews are sorted by
review creation dateTime.
Value of the rating, from 1 (terrible) to 5 (excellent).
Note: Ratings on Expedia points of sale other than Expedia.com are displayed
using a 10-point scale, which is calculated by doubling the rating provided
through the API. For example, if a traveler submits a 2, 4 is displayed on
Hotels.com. Ratings on non-hotel points of sale are displayed using a 5-point scale.
Sort results in ascending order (oldest to newest).
DESC
Sort results in descending order (newest to oldest).
String
String
The String scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.