Skip to Content

Queries

L’objet Query

Attributs

  • idstring

    Identifiant unique de l'objet (préfixé, opaque).

  • objectstring

    query

  • textstring
  • marketstring

    Code du marché (pays ISO, par ex. FR).

  • categorystringnullable
  • intentenum

    The 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 · custom

  • sourceenum

    | | |---| | generated <br/> Generated from the catalog at onboarding / re-generation. | | manual <br/> Added by hand in the prompt panel. |

    Valeurs possibles : generated · manual

  • enabledboolean
  • visibilityobject

    Share (%) of the answers citing the brand over the period — null before any measurement.

  • livemodeboolean

    true pour les données réelles, false pour le bac à sable du mode test.

  • createdinteger

    Time at which the object was created (unix timestamp, seconds).

L'objet Query
{ "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 }

L’objet Panel cost

Attributs

  • objectstring

    panel_cost

  • queriesinteger
  • enabled_queriesinteger
  • cadenceenum

    How often a brand's panel is sampled (brands.sampling_cadence, stamped on every sampling as samplings.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').

    Valeurs possibles : weekly · daily

  • modelsarray of enum
  • cadencesarray of object
    Afficher les attributs enfants
    • cadenceenum

      Valeurs possibles : weekly · daily

    • availableboolean
    • cost_per_queryinteger
    • monthly_costinteger
    • coveredinteger
    • beyondinteger
    • measured_queriesinteger
    • runs_per_queryinteger
    • stable_queriesinteger
    • stable_runs_per_queryintegernullable
    • stable_savinginteger
  • currencystring

    eur

  • livemodeboolean

    true pour les données réelles, false pour le bac à sable du mode test.

L'objet Panel cost
{ "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.

Paramètres

  • brandstringobligatoire

    Brand id (br_…).

  • textstringobligatoire
  • marketstringobligatoire

    An 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 -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"}'
Réponse
{ "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

  • brandstringobligatoire

    Brand id (br_…).

  • querystringobligatoire

    Query id (qry_…).

  • textstring
  • categorystringnullable
  • enabledboolean

Retour

Renvoie l’objet query mis à jour. Lève une erreur en cas de problème.

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"}'
Réponse
{ "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

  • brandstringobligatoire

    Brand id (br_…).

  • querystringobligatoire

    Query id (qry_…).

Retour

Renvoie l’objet query. Lève une erreur en cas de problème.

curl https://api.skoup.ai/v1/brands/br_034CyfRFSXUqzrbzV6MAfZ/queries/qry_034ONPxljEmTTql8cv7qJk \ -H "Authorization: Bearer skoup_test_4eC39HqLyjWDarjtT1zdp7dc"
Réponse
{ "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.

Paramètres

  • brandstringobligatoire

    Brand id (br_…).

  • queriesinteger

Retour

Renvoie l’objet panel_cost. Lève une erreur en cas de problème.

curl https://api.skoup.ai/v1/brands/br_034CyfRFSXUqzrbzV6MAfZ/queries/cost \ -H "Authorization: Bearer skoup_test_4eC39HqLyjWDarjtT1zdp7dc"
Réponse
{ "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.

Paramètres

  • brandstringobligatoire

    Brand id (br_…).

  • marketstring
  • enabledstring
  • limitinteger

    Nombre d'objets à renvoyer, entre 1 et 100 (20 par défaut).

  • starting_afterstring

    Curseur : l'id du 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 https://api.skoup.ai/v1/brands/br_034CyfRFSXUqzrbzV6MAfZ/queries?limit=3 \ -H "Authorization: Bearer skoup_test_4eC39HqLyjWDarjtT1zdp7dc"
Réponse
{ "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 } ] }
Last updated on