apyhub
Back
▣ 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, 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
https://api.eu.apyhub.com/sharpapi/generate-travel-review-sentiment

QUICKSTART

GUIDE

Quickstart

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

curl -X POST "https://api.eu.apyhub.com/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 a job_id string — the UUID of the submitted job. Poll the job status endpoint with this id to retrieve the result.

{
  "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.

Request Body

ParameterTypeDescription
contentStringProvide review text to analyze the sentiment.

Response

Returns a JSON object with a job_id string — the UUID of the submitted job. Poll the job status endpoint with this id to retrieve the result.

ParameterTypeDescription
job_idStringThe submitted job identifier.

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.

▣ ENDPOINT 02 / 02
GET
Generate Travel Review Sentiment Check Job Status
https://api.eu.apyhub.com/sharpapi/generate-travel-review-sentiment/job/status/:job_id

QUICKSTART

GUIDE

Quickstart

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

curl -X GET "https://api.eu.apyhub.com/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)

AttributeTypeDescription
job_idStringThe 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.

ParameterTypeDescription
dataObjectThe job record wrapper.
data.idStringThe job identifier.
data.typeStringThe top-level resource type.
data.attributesObjectThe job attributes wrapper.
data.attributes.typeStringThe analysis type for this job.
data.attributes.statusENUMThe job status. Allowed values: success, failed, running, queued.
data.attributes.resultObjectThe analysis result object, populated when the job succeeds.
data.attributes.result.scoreIntegerThe sentiment score.
data.attributes.result.opinionStringThe sentiment opinion.
▣ 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.