Queries
L’objet Query
Attributs
idstringIdentifiant unique de l'objet (préfixé, opaque).
objectstringquerytextstringmarketstringCode du marché (pays ISO, par ex.
FR).categorystringnullableintentenumThe shopping-query templates of the spec: « meilleur X », « X vs Z », « alternatives à X ». Detected on manual prompts, explicit on generated ones; anything else is custom.
Valeurs possibles :
best_x·x_vs_z·alternatives_to_x·customsourceenum| | |---| |
generated<br/> Generated from the catalog at onboarding / re-generation. | |manual<br/> Added by hand in the prompt panel. |Valeurs possibles :
generated·manualenabledbooleanvisibilityobjectShare (%) of the answers citing the brand over the period — null before any measurement.
livemodebooleantruepour les données réelles,falsepour le bac à sable du mode test.createdintegerTime at which the object was created (unix timestamp, seconds).
{
"id": "qry_034ONPxljEmTTql8cv7qJk",
"object": "query",
"text": "meilleur vélo gravel carbone à moins de 3000 €",
"market": "FR",
"category": "string",
"intent": "best_x",
"source": "generated",
"enabled": true,
"visibility": {},
"livemode": true,
"created": 1790000000
}Create a query
POST/v1/brands/{brand}/queries
Adds a query to the panel of an activated market, enabled: it is
asked from the next weekly sampling on. A duplicate on the market, or
a full quota (quota_exceeded), answers 422.
Paramètres
brandstringobligatoireBrand id (
br_…).textstringobligatoiremarketstringobligatoireAn activated market of the brand (ISO 3166-1 alpha-2).
categorystringnullable
Retour
Renvoie l’objet query créé. Lève une erreur en cas de problème.
curl
curl -X POST https://api.skoup.ai/v1/brands/br_034CyfRFSXUqzrbzV6MAfZ/queries \
-H "Authorization: Bearer skoup_test_4eC39HqLyjWDarjtT1zdp7dc" \
-H "Content-Type: application/json" \
-d '{"text":"meilleur vélo gravel carbone à moins de 3000 €","market":"FR","category":"string"}'{
"id": "qry_034ONPxljEmTTql8cv7qJk",
"object": "query",
"text": "meilleur vélo gravel carbone à moins de 3000 €",
"market": "FR",
"category": "string",
"intent": "best_x",
"source": "generated",
"enabled": true,
"visibility": {},
"livemode": true,
"created": 1790000000
}Update a query
PATCH/v1/brands/{brand}/queries/{query}
Edits the text or the category, or enables / disables the query. Disabling frees a slot of the quota; enabling takes one.
Paramètres
brandstringobligatoireBrand id (
br_…).querystringobligatoireQuery id (
qry_…).textstringcategorystringnullableenabledboolean
Retour
Renvoie l’objet query mis à jour. Lève une erreur en cas de problème.
curl
curl -X PATCH https://api.skoup.ai/v1/brands/br_034CyfRFSXUqzrbzV6MAfZ/queries/qry_034ONPxljEmTTql8cv7qJk \
-H "Authorization: Bearer skoup_test_4eC39HqLyjWDarjtT1zdp7dc" \
-H "Content-Type: application/json" \
-d '{"text":"meilleur vélo gravel carbone à moins de 3000 €","category":"string"}'{
"id": "qry_034ONPxljEmTTql8cv7qJk",
"object": "query",
"text": "meilleur vélo gravel carbone à moins de 3000 €",
"market": "FR",
"category": "string",
"intent": "best_x",
"source": "generated",
"enabled": true,
"visibility": {},
"livemode": true,
"created": 1790000000
}Retrieve a query
GET/v1/brands/{brand}/queries/{query}
Paramètres
brandstringobligatoireBrand id (
br_…).querystringobligatoireQuery id (
qry_…).
Retour
Renvoie l’objet query. Lève une erreur en cas de problème.
curl
curl https://api.skoup.ai/v1/brands/br_034CyfRFSXUqzrbzV6MAfZ/queries/qry_034ONPxljEmTTql8cv7qJk \
-H "Authorization: Bearer skoup_test_4eC39HqLyjWDarjtT1zdp7dc"{
"id": "qry_034ONPxljEmTTql8cv7qJk",
"object": "query",
"text": "meilleur vélo gravel carbone à moins de 3000 €",
"market": "FR",
"category": "string",
"intent": "best_x",
"source": "generated",
"enabled": true,
"visibility": {},
"livemode": true,
"created": 1790000000
}List queries
GET/v1/brands/{brand}/queries
The queries of the brand’s panel — the questions asked to the AI models every week — with the share of the answers citing the brand over the period.
Paramètres
brandstringobligatoireBrand id (
br_…).marketstringenabledstringlimitintegerNombre d'objets à renvoyer, entre 1 et 100 (20 par défaut).
starting_afterstringCurseur : l'
iddu dernier objet de la page précédente.
Retour
Un dictionnaire dont la propriété data contient jusqu’à limit objets query, du plus récent au plus ancien, et has_more indique s’il reste une page. Lève une erreur en cas de problème.
curl
curl https://api.skoup.ai/v1/brands/br_034CyfRFSXUqzrbzV6MAfZ/queries?limit=3 \
-H "Authorization: Bearer skoup_test_4eC39HqLyjWDarjtT1zdp7dc"{
"object": "list",
"url": "/v1/brands/br_034CyfRFSXUqzrbzV6MAfZ/queries",
"has_more": false,
"data": [
{
"id": "qry_034ONPxljEmTTql8cv7qJk",
"object": "query",
"text": "meilleur vélo gravel carbone à moins de 3000 €",
"market": "FR",
"category": "string",
"intent": "best_x",
"source": "generated",
"enabled": true,
"visibility": {},
"livemode": true,
"created": 1790000000
}
]
}