apyhub
MARKETING · SMART GENERATION

Generate Tours & Activities Product Categories API

What it does

Tour Category Generator turns travel content into ranked tours-and-activities product categories. Send a content string, and optionally add city, country, language, context, and max_quantity to shape the output. The job returns a job_id and status_url first, then a status record when you check the job.

Use it when you need to map destination copy, activity descriptions, or curated travel inventory into a normalized category list. The submitted content drives the classification; city and country can help anchor the travel context, while language lets you request the output in the language you need.

When the job finishes, the status response includes a result array of category objects with name and weight, along with a status value of success, failed, running, or queued. That makes it easy to sort category suggestions by relevance and feed them into travel search, merchandising, or content organization workflows.

Tour Category Generator is a good fit for travel platforms that need structured categories from unstructured copy without building their own taxonomy pipeline.

▣ ENDPOINT 01 / 02
POST
Generate Tours & Activities Product Categories Submit Job
http://localhost:8080/sharpapi/generate-tours-activities-product-catego
QUICKSTARTGUIDE

Quickstart

Submit a travel content generation job with the required content field.

curl -X POST "http://localhost:8080/sharpapi/generate-tours-activities-product-catego" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "content": "Best family-friendly attractions in Paris"
  }'

What you'll get back

Returns a JSON object with two string fields: job_id and status_url. job_id is the submitted job identifier, and status_url is the URL you can use to check the job status.

{
  "status_url": "https://apyhub.com/services/provider/sharpapi/api/v1/tth/ta_product_categories/job/status/d4b1bfda-371e-4e8c-b63f-340a7cccdeeb",
  "job_id": "d4b1bfda-371e-4e8c-b63f-340a7cccdeeb"
}
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 of travel.
Provide the content to generate travel product categories.
Provide additional context to improve paraphrasing accuracy
Specify the country related to travel.
Specify the language of the output, defaults to `English`
Specify the maximum length of the paraphrased content

About this endpoint

What it does

Submits an async job to generate tours and activities product categories from the provided content and optional travel context. The response returns a job identifier and a status URL to check the job later.

Request Body

ParameterTypeMandatoryDescription
cityStringNoSpecify the city of travel.
contentStringYesProvide the content to generate travel product categories.
contextStringNoProvide additional context to improve paraphrasing accuracy.
countryStringNoSpecify the country related to travel.
languageStringNoSpecify the language of the output, defaults to English.
max_quantityNumberNoSpecify the maximum length of the paraphrased content.

Response

Returns a JSON object with job_id and status_url string fields. job_id identifies the submitted job, and status_url is the URL used to check the job status. Success returns an object shaped like { job_id, status_url }.

ParameterTypeMandatoryDescription
job_idStringYesJob identifier for the submitted async job.
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 identifier from job_id.

Body

Name
Type
Description
bodyREQUIRED
object
▣ ENDPOINT 02 / 02
GET
Generate Tours & Activities Product Categories Check Job Status
http://localhost:8080/sharpapi/generate-tours-activities-product-catego/job/status/:job_id
QUICKSTARTGUIDE

Quickstart

Check the status of a job by its job_id.

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

What you'll get back

Returns a JSON object with a data object. data contains id and type for the job result, plus an attributes object with status, type, and result. status is one of success, failed, running, or queued.

{
  "data": {
    "id": "55bc3311-d16e-4949-83a0-d367b7f79f89",
    "type": "api_job_result",
    "attributes": {
      "status": "success",
      "type": "tth_ta_product_categories",
      "result": [
        {
          "name": "Boat Tours",
          "weight": 9.5
        }
      ]
    }
  }
}
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 job for generating tours and activities product categories using the provided job_id. The response returns the job result wrapper with its current status and, when available, the generated result list.

Path Parameter(s)

AttributeTypeMandatoryDescription
job_idStringYesJob identifier, a string.

Response

Returns a JSON object with a data object field. The data object contains id and type string fields, plus an attributes object that includes status and type strings, and may include a result array of objects with name and weight fields.

AttributeTypeMandatoryDescription
dataObjectYesJob result wrapper object.
data.idStringYesJob identifier, a string.
data.typeStringYesResource type, a string.
data.attributesObjectYesJob attributes object.
data.attributes.typeStringYesResult type identifier, a string.
data.attributes.statusENUMYesJob status. Allowed values: success, failed, running, queued.
data.attributes.resultObject ArrayNoGenerated categories returned when available. Each item contains name and weight.
data.attributes.result[].nameStringYesCategory name, a string.
data.attributes.result[].weightNumberYesCategory weight, a number.

Notes

Poll this endpoint with the job_id returned by the submit call. The status field cycles through transitional values (queued, running) before reaching a terminal state (success, failed). The result fields are only populated once status is success; treat them 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.