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

QUICKSTART

GUIDE

Quickstart

Submit a product description to generate categories for it.

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

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

ParameterTypeDescription
contentStringProduct name and its parameters.
contextStringList of other categories to consider.
languageStringDefault: English.
voice_toneStringPreferred writing style parameter. It can be adjectives like funny or joyous, or even the name of a famous writer
max_quantityIntegerMaximum number of product categories to generate

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 for the submitted job.

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.

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

QUICKSTART

GUIDE

Quickstart

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

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

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

ParameterTypeDescription
dataObjectJob record object. Contains id, type, and attributes.
data.idStringThe job's unique UUID.
data.typeStringJob record type. Example: api_job_result.
data.attributesObjectJob attributes object. Contains status and, when the job succeeds, result.
data.attributes.statusENUMCurrent status of the asynchronous job. Allowed values: running, failed, queued, success.
data.attributes.resultObject ArrayGenerated product categories returned when the job has completed successfully.
data.attributes.result[].nameStringCategory name.
data.attributes.result[].weightNumberCategory 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.

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