apyhub
ARTIFICIAL INTELLIGENCE · E-COMMERCE QUICK TOOLS

Generate Product Categories API

What it does

Product Category Generator takes a product name and supporting parameters, then returns a job you can poll until category suggestions are ready. Send the content field with the product name and its parameters, and optionally include context for other categories to consider, language, voice_tone, and max_quantity.

Use it when you need to organise a catalog, map new SKUs into a taxonomy, or draft category suggestions for onboarding workflows. The initial response includes a job_id and a status_url, so you can track the asynchronous request without blocking your app.

When the job completes, the status endpoint returns the current status as running, queued, failed, or success. On success, the result is an array of category objects with name and weight, which lets you rank or filter the suggested categories in your own system.

Product Category Generator is a fit for e-commerce tooling, content classification, and catalog operations where you need machine-generated category candidates from product input.

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

Quickstart

Submit a product description to generate categories for it.

curl -X POST "http://localhost:8080/sharpapi/generate-product-categories" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "content": "Wireless noise-cancelling headphones with Bluetooth connectivity"
  }'

What you'll get back

Returns a JSON object with two string fields: job_id for the submitted job identifier and status_url for the URL to poll the job status.

{
  "status_url": "https://apyhub.com/services/provider/sharpapi/api/v1/ecommerce/product_categories/job/status/cf22cd59-7cab-432c-8d90-e8d376d63960",
  "job_id": "cf22cd59-7cab-432c-8d90-e8d376d63960"
}
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*
Product name and its parameters.
List of other categories to consider.

About this endpoint

What it does

Submits a job to generate product categories from the provided product content and optional context, language, voice tone, and maximum quantity settings. The endpoint returns identifiers you can use to track the job status.

Request Body

ParameterTypeMandatoryDescription
contentStringYesProduct name and its parameters.
contextStringNoList of other categories to consider.
languageStringNoDefault: English.
voice_toneStringNoPreferred writing style parameter. It can be adjectives like funny or joyous, or even the name of a famous writer
max_quantityIntegerNoMaximum number of product categories to generate

Response

Returns a JSON object with job_id and status_url string fields. job_id is the unique identifier for the submitted job, and status_url is the URL used to poll for job status.

ParameterTypeMandatoryDescription
job_idStringYesThe unique identifier for the submitted job.
status_urlStringYesThe URL to poll for 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. Use job_id from the response to track the job.

Body

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

Quickstart

Check the status of a product-categories job by its job_id in the path.

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

What you'll get back

Returns a JSON object with a data object. Inside data, id is the job UUID, type is the resource type, and attributes contains the job status and, when available, the result array of category objects.

{
  "data": {
    "id": "2f6c7c7b-8f2d-4b7a-9f3a-2b1c9d8e4a11",
    "type": "api_job_result",
    "attributes": {
      "status": "success",
      "result": [
        { "name": "Electronics", "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 an asynchronous product-category generation job using its job ID. The response returns the job record and, when the job has completed successfully, the generated result array.

Path Parameter(s)

AttributeTypeMandatoryDescription
job_idStringYesThe job's unique UUID.

Response

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

ParameterTypeMandatoryDescription
dataObjectYesJob record object. Contains id, type, and attributes.
data.idStringYesThe job's unique UUID.
data.typeStringYesJob record type. Example: api_job_result.
data.attributesObjectYesJob attributes object. Contains status and, when the job succeeds, result.
data.attributes.statusENUMYesCurrent status of the asynchronous job. Allowed values: running, failed, queued, success.
data.attributes.resultObject ArrayNoGenerated product categories returned when the job has completed successfully.
data.attributes.result[].nameStringNoCategory name.
data.attributes.result[].weightNumberNoCategory weight.

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 result fields under data.attributes.result are only populated once status is success.

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.