apyhub
ARTIFICIAL INTELLIGENCE · SMART GENERATION

Generate Hospitality Product Categories API

What it does

Hospitality Product Categories generates a ranked list of product category names from your travel or hospitality content. Send a content string, and you can also include city, country, language, context, voice_tone, and max_quantity to shape the output. The submit endpoint returns a job_id and status_url, so you can process larger requests asynchronously.

Use Hospitality Product Categories when you need structured category ideas from unstructured text: hotel collections, destination guides, tour packages, amenity groupings, or marketplace merchandising for a travel brand. The service is built for content classification and category generation, not for booking or geocoding.

Poll the job status endpoint with the returned job_id. When the job finishes successfully, the response includes a result array with category objects. Each object contains a name and a weight, letting you sort or filter categories by relevance in your own workflow.

If you are building content operations, travel commerce tooling, or an AI-assisted taxonomy generator, this service gives you machine-readable category suggestions you can plug into dashboards, search filters, or CMS pipelines.

▣ ENDPOINT 01 / 02
POST
Generate Hospitality Product Categories - Submit Job
http://localhost:8080/sharpapi/generate-hospitality-product-categories
QUICKSTARTGUIDE

Quickstart

Submit a hospitality content job with the required content field.

curl -X POST "http://localhost:8080/sharpapi/generate-hospitality-product-categories" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"content":"Hotels in Paris"}'

What you'll get back

Returns a JSON object with:

  • job_id (string, UUID): the unique identifier of the submitted job
  • status_url (string, URI): the URL to poll for the job status and result
{
  "status_url": "https://apyhub.com/services/provider/sharpapi/api/v1/tth/hospitality_product_categories/job/status/831f5f92-13dd-49f2-aaf1-b27dbb6829cd",
  "job_id": "831f5f92-13dd-49f2-aaf1-b27dbb6829cd"
}
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*
Specify the city to travel.
Provide the content to generate travel product categories.
Provide additional context to improve paraphrasing accuracy.
Specify the country to travel.
Specify the language of the output.
Specify the voice tone.
Maximum number of product categories to generate.

About this endpoint

What it does

Submits a job to generate hospitality product categories from the provided content. The request body supplies the source content and optional context, and the response returns a job identifier plus a status URL for polling the result later.

Request Body

ParameterTypeMandatoryDescription
cityStringNoSpecify the city to travel.
contentStringYesProvide the content to generate travel product categories.
contextStringNoProvide additional context to improve paraphrasing accuracy.
countryStringNoSpecify the country to travel.
languageStringNoSpecify the language of the output. Default: English.
voice_toneStringNoSpecify the voice tone. Default: neutral.
max_quantityNumberNoMaximum number of product categories to generate. Minimum: 1.

Response

Returns a JSON object with a job_id string field and a status_url string field. Use job_id to identify the submitted job, and poll status_url to check the job’s status and retrieve the result.

ParameterTypeMandatoryDescription
job_idStringYesThe unique identifier of the submitted job. Format: UUID.
status_urlStringYesURL to poll for the job's status and result. Format: URI.

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 identifier from job_id.

Body

Name
Type
Description
bodyREQUIRED
object
▣ ENDPOINT 02 / 02
GET
Generate Hospitality Product Categories - Check Job Status
http://localhost:8080/sharpapi/generate-hospitality-product-categories/job/status/:job_id
QUICKSTARTGUIDE

Quickstart

Check the status of a hospitality categories generation job by its job_id.

curl -X GET "http://localhost:8080/sharpapi/generate-hospitality-product-categories/job/status/:job_id" \
  -H "apy-token: $APY_TOKEN"

What you'll get back

Returns a JSON object with a data object. data contains the job id (UUID), type (api_job_result), and attributes, which include the job type, status, and result array.

{
  "data": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "type": "api_job_result",
    "attributes": {
      "type": "tth_hospitality_product_categories",
      "status": "success",
      "result": [
        {
          "name": "Hotel Amenities",
          "weight": 0.92
        }
      ]
    }
  }
}
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 previously submitted hospitality product category generation job using its job UUID, and returns the job result payload when available.

Path Parameter(s)

AttributeTypeMandatoryDescription
job_idStringYesThe job identifier, formatted as a UUID.

Response

Returns a JSON object with a data object field. The data object contains id and type string fields, plus an attributes object with type as a string, status as a string enum, and result as an array of objects.

ParameterTypeMandatoryDescription
dataObjectNoWrapper object containing the job status payload.
data.idStringNoThe job result identifier, formatted as a UUID.
data.typeStringNoThe resource type for the job result.
data.attributesObjectNoWrapper object containing the job attributes.
data.attributes.typeStringNoThe generated task type.
data.attributes.statusENUMNoJob status. Allowed values: running, failed, queued, success.
data.attributes.resultObject ArrayNoThe generated hospitality product categories. Each item contains name and weight.
data.attributes.result[].nameStringNoThe name of the generated hospitality product category.
data.attributes.result[].weightNumberNoThe relevance weight/score of this category.

Notes

Poll this endpoint with the job_id returned by the submit call. The data.attributes.status field cycles through transitional values (queued, running) before reaching a terminal state (success, failed). The data.attributes.result field is only populated once status is success; treat it as absent otherwise.

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.