apyhub
ARTIFICIAL INTELLIGENCE · SMART GENERATION

Generate Travel Review Sentiment API

What it does

Travel Review Sentiment analyzes review text and returns a sentiment classification for travel feedback. Send a content string in the request body, get back a job_id and status_url, then poll the job status endpoint until the result is ready.

Use it when you need to triage hotel, airline, tour, or destination reviews without reading every comment manually. The workflow is asynchronous, so it fits longer text or batch-style review processing where you submit a job first and check results later.

When the job completes successfully, the status response includes a data object with id, type, and attributes. Inside attributes, you get the job status plus a result object containing a numeric score and an opinion value such as POSITIVE. That makes it straightforward to route highly negative reviews to support, summarize customer feedback, or score destination sentiment in an analytics pipeline.

Travel Review Sentiment is a good fit for travel platforms, feedback dashboards, reputation monitoring, and moderation workflows that only need a compact sentiment result rather than full text analysis.

▣ ENDPOINT 01 / 02
POST
Generate Travel Review Sentiment Submit Job
http://localhost:8080/sharpapi/generate-travel-review-sentiment
QUICKSTARTGUIDE

Quickstart

Submit a travel review for sentiment analysis with a short text review.

curl -X POST "http://localhost:8080/sharpapi/generate-travel-review-sentiment" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"content":"The hotel was clean, the staff were friendly, and the location was perfect."}'

What you'll get back

Returns a JSON object with required job_id and status_url string fields. job_id is the submitted job identifier, and status_url is the URL to check the job status.

{
  "status_url": "https://apyhub.com/services/provider/sharpapi/api/v1/tth/review_sentiment/job/status/947963b5-1559-434b-9ae3-9146a6114d79",
  "job_id": "947963b5-1559-434b-9ae3-9146a6114d79"
}
TRY ITLIVE · 50 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
body*
Provide Review text to analyze the sentiment.

About this endpoint

What it does

Submits review text for asynchronous travel-review sentiment analysis. The request body provides the review content, and the response returns the job identifier and a status URL so you can check the job later.

Request Body

ParameterTypeMandatoryDescription
contentStringYesProvide review text to analyze the sentiment.

Response

Returns a JSON object with two string fields: job_id and status_url. Use job_id to identify the submitted job, and status_url to check the job status.

ParameterTypeMandatoryDescription
job_idStringYesThe submitted job identifier.
status_urlStringYesURL used to check the submitted job status.

Notes

This endpoint kicks off an async job and returns immediately with a job identifier; the actual work runs in the background. Pair this call with the corresponding job_check endpoint — poll that until the status reaches a terminal state to retrieve the result. Extract the job id from job_id.

Body

Name
Type
Description
bodyREQUIRED
object
▣ ENDPOINT 02 / 02
GET
Generate Travel Review Sentiment Check Job Status
http://localhost:8080/sharpapi/generate-travel-review-sentiment/job/status/:job_id
QUICKSTARTGUIDE

Quickstart

Check the status of a travel review sentiment job by its job_id path parameter.

curl -X GET "http://localhost:8080/sharpapi/generate-travel-review-sentiment/job/status/:job_id" \
  -H "apy-token: $APY_TOKEN"

What you'll get back

Returns a JSON object with a required data object. The data object includes id and type strings, plus an attributes object containing status, type, and optionally result with score and opinion.

{
  "data": {
    "id": "f85b7ac5-33cd-4796-8935-dc8c22219946",
    "type": "api_job_result",
    "attributes": {
      "type": "tth_review_sentiment",
      "status": "success",
      "result": {
        "score": 95,
        "opinion": "POSITIVE"
      }
    }
  }
}
TRY ITLIVE · 1 ATOM
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.

About this endpoint

What it does

Checks the status of a travel review sentiment analysis job by its job_id and returns the job record, including its current status and, when completed successfully, the sentiment result.

Path Parameter(s)

AttributeTypeMandatoryDescription
job_idStringYesThe job identifier, as a path parameter.

Response

Returns a JSON object with a data object field. data contains the job id and type, plus an attributes object with the job type, status, and result.

ParameterTypeMandatoryDescription
dataObjectYesThe job record wrapper.
data.idStringYesThe job identifier.
data.typeStringYesThe top-level resource type.
data.attributesObjectYesThe job attributes wrapper.
data.attributes.typeStringYesThe analysis type for this job.
data.attributes.statusENUMYesThe job status. Allowed values: success, failed, running, queued.
data.attributes.resultObjectNoThe analysis result object, populated when the job succeeds.
data.attributes.result.scoreIntegerYesThe sentiment score.
data.attributes.result.opinionStringYesThe sentiment opinion.

Path parameters

Name
Type
Description
job_idREQUIRED
string
▣ COMMON ERRORS

Errors any endpoint can return

400bad_request

Required parameter missing or malformed body.

401unauthorized

API key missing, revoked, or not authorized for this service.

429rate_limited

Your plan's per-second rate exceeded. Retry with exponential backoff.

503upstream_busy

Backend temporarily unavailable. Try again in a few seconds.