apyhub
Back
▣ 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, 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
https://api.eu.apyhub.com/sharpapi/generate-hospitality-product-categories

QUICKSTART

GUIDE

Quickstart

Submit a hospitality content job with the required content field.

curl -X POST "https://api.eu.apyhub.com/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
{
  "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*
Provide the content to generate travel product categories.
Specify the city to travel.
Provide additional context to improve paraphrasing accuracy.
Specify the country to travel.

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.

Request Body

ParameterTypeDescription
cityStringSpecify the city to travel.
contentStringProvide the content to generate travel product categories.
contextStringProvide additional context to improve paraphrasing accuracy.
countryStringSpecify the country to travel.
languageStringSpecify the language of the output. Default: English.
voice_toneStringSpecify the voice tone. Default: neutral.
max_quantityNumberMaximum number of product categories to generate. Minimum: 1.

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 unique identifier of the submitted job. Format: UUID.

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.

▣ ENDPOINT 02 / 02
GET
Generate Hospitality Product Categories - Check Job Status
https://api.eu.apyhub.com/sharpapi/generate-hospitality-product-categories/job/status/:job_id

QUICKSTART

GUIDE

Quickstart

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

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

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

ParameterTypeDescription
dataObjectWrapper object containing the job status payload.
data.idStringThe job result identifier, formatted as a UUID.
data.typeStringThe resource type for the job result.
data.attributesObjectWrapper object containing the job attributes.
data.attributes.typeStringThe generated task type.
data.attributes.statusENUMJob status. Allowed values: running, failed, queued, success.
data.attributes.resultObject ArrayThe generated hospitality product categories. Each item contains name and weight.
data.attributes.result[].nameStringThe name of the generated hospitality product category.
data.attributes.result[].weightNumberThe 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.

▣ 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.