Queries
The Query object
Attributes
idstringUnique identifier of the object (prefixed, opaque).
objectstringquerytextstringmarketstringMarket code (ISO country, e.g.
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.
Possible values:
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. |Possible values:
generated·manualenabledbooleanvisibilityobjectShare (%) of the answers citing the brand over the period — null before any measurement.
livemodebooleantruefor live data,falsefor the test-mode sandbox.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
}The Panel cost object
Attributes
objectstringpanel_costqueriesintegerenabled_queriesintegercadenceenumHow often a brand's panel is sampled (
brands.sampling_cadence, stamped on every sampling assamplings.cadence): weekly × 4 runs per prompt (default) or daily × 1 run (Growth and above). Runs and cycles per month live in config('skoup.billing.cadences').Possible values:
weekly·dailymodelsarray of enumcadencesarray of objectShow child attributes
cadenceenumPossible values:
weekly·dailyavailablebooleancost_per_queryintegermonthly_costintegercoveredintegerbeyondintegermeasured_queriesintegerruns_per_queryintegerstable_queriesintegerstable_runs_per_queryintegernullablestable_savinginteger
currencystringeurlivemodebooleantruefor live data,falsefor the test-mode sandbox.
{
"object": "panel_cost",
"queries": 12,
"enabled_queries": 12,
"cadence": "weekly",
"models": [
"chatgpt"
],
"cadences": [
{
"cadence": "weekly",
"available": true,
"cost_per_query": 12,
"monthly_cost": 12,
"covered": 12,
"beyond": 12,
"measured_queries": 12,
"runs_per_query": 12,
"stable_queries": 12,
"stable_runs_per_query": 12,
"stable_saving": 12
}
],
"currency": "eur",
"livemode": true
}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, a trial or a contract with a limit only), answers 422.
Parameters
brandstringrequiredBrand id (
br_…).textstringrequiredmarketstringrequiredAn activated market of the brand (ISO 3166-1 alpha-2).
categorystringnullable
Returns
Returns the created query object. Raises an error if something goes wrong.
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.
Parameters
brandstringrequiredBrand id (
br_…).querystringrequiredQuery id (
qry_…).textstringcategorystringnullableenabledboolean
Returns
Returns the updated query object. Raises an error if something goes wrong.
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}
Parameters
brandstringrequiredBrand id (
br_…).querystringrequiredQuery id (
qry_…).
Returns
Returns the query object. Raises an error if something goes wrong.
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
}Retrieve the panel cost
GET/v1/brands/{brand}/queries/cost
What the enabled queries — or queries queries — cost a month with
the brand’s AI models, weekly and daily, in euro cents: what the
included amount covers, what goes beyond it (balance, pay-as-you-go)
and how many queries a month of cycles would measure with what is
left to spend.
Parameters
brandstringrequiredBrand id (
br_…).queriesinteger
Returns
Returns the panel_cost object. Raises an error if something goes wrong.
curl
curl https://api.skoup.ai/v1/brands/br_034CyfRFSXUqzrbzV6MAfZ/queries/cost \
-H "Authorization: Bearer skoup_test_4eC39HqLyjWDarjtT1zdp7dc"{
"object": "panel_cost",
"queries": 12,
"enabled_queries": 12,
"cadence": "weekly",
"models": [
"chatgpt"
],
"cadences": [
{
"cadence": "weekly",
"available": true,
"cost_per_query": 12,
"monthly_cost": 12,
"covered": 12,
"beyond": 12,
"measured_queries": 12,
"runs_per_query": 12,
"stable_queries": 12,
"stable_runs_per_query": 12,
"stable_saving": 12
}
],
"currency": "eur",
"livemode": true
}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.
Parameters
brandstringrequiredBrand id (
br_…).marketstringenabledstringlimitintegerNumber of objects to return, between 1 and 100 (default 20).
starting_afterstringCursor: the
idof the last object of the previous page.
Returns
A dictionary with a data property holding up to limit query objects, newest first, and has_more telling whether another page exists. Raises an error if something goes wrong.
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
}
]
}