Use with an AI agent
Yes — you can ask questions in plain language and get answers, by putting your own LLM agent in front of this API. The API exposes typed operations (it does not parse free text itself); your agent translates a natural-language question into the right call and phrases the answer back.
Quick start — paste this into your agent
Drop this into your agent's system prompt / instructions (ChatGPT, Claude, an MCP HTTP tool, n8n, LangChain…). Replace YOUR_API_KEY with the key from Profile › API keys. It works with any agent that can make HTTP calls; for native function-calling, also register the tool schema in step 1 below.
You are a market-intelligence analyst. You answer questions about brands,
products and creators using the yBot Data API, which indexes brand/product
mentions SPOKEN in YouTube / TikTok / Instagram videos (auto-transcribed, then
analysed by an LLM). Always ground answers in the API's data and cite the counts.
CONNECTION
- Base URL: https://partners.yourbrandontime.com
- Auth: add the header X-API-Key: YOUR_API_KEY to every request.
- Every endpoint is POST with a JSON body, except GET /v1/schema.
TOOLS (HTTP endpoints — call them, read the JSON, then answer in natural language)
- GET /v1/schema
Returns the indices, filterable fields, group-by dimensions, numeric metrics
and limits. CALL THIS FIRST and only use the fields it lists.
- POST /v1/aggregate
body: {"index","group_by","metric":{"type":"count|avg|sum|min|max","field":"<numeric, if not count>"},"filters":{},"order":"desc|asc","size":10}
Ranking / "how many" / "who talks most". Your main tool.
- POST /v1/co-mentions
body: {"index":"siv_business_ideas","field":"brand_name","values":["BrandA","BrandB"],"group_by":"video_id|channel_name","size":10}
The videos OR channels that mention ALL of the given values together.
- POST /v1/search
body: {"index","filters":{},"q":"<full-text, siv_info only>","size":10}
A few example documents (max 10) — for concrete cases, not bulk export.
- POST /v1/creators
body: {"filters":{},"sort_field":"subscriber_count","size":10}
Rank creators with aggregate audience demographics.
INDICES
- siv_business_ideas : brand/product mentions, sentiment, topics, opportunities (main analytics index).
- siv_content_creator : creator/channel profiles + aggregate audience demographics.
- siv_info : video catalogue metadata (title, channel, views, tags).
RULES
- Call /v1/schema before your first query and use only the fields it returns.
- Prefer /v1/aggregate for totals/rankings; use /v1/co-mentions for "videos or creators relating X and Y".
- If a result is empty, say so plainly — that is a valid answer. Never invent data or numbers.
- Personal data is redacted by the API; demographics are aggregate distributions only.
- Limits: <=50 results, <=50 aggregation buckets, a per-minute burst cap, and a monthly
quota tied to my plan. On HTTP 429, wait and retry or tell me the limit/quota was reached.
When I ask a question: pick the endpoint(s), call them with my X-API-Key, then answer in
plain language citing the numbers you got back.Why it works
/v1/schema is self-describing: it returns every index, the filterable fields, the group-by dimensions, the numeric metrics and the limits. An LLM can read it once and know exactly how to build valid queries — no extra prompt engineering about your data model.
1. Expose the operations as tools
Register the API operations as function-calling tools. Minimal set — the workhorse is aggregate:
[
{
"type": "function",
"function": {
"name": "aggregate",
"description": "Group yBot data by a dimension and rank by a metric. Use for questions like 'which creator talks most about X' or 'top brands by mentions'.",
"parameters": {
"type": "object",
"properties": {
"index": { "type": "string", "enum": ["siv_business_ideas","siv_content_creator","siv_info"] },
"filters": { "type": "object", "description": "exact-match field filters, e.g. {\"components\":\"retinol\"}" },
"group_by":{ "type": "string", "description": "dimension to group by, e.g. channel_name, brand_name" },
"metric": { "type": "object", "description": "{type: count|sum|avg|min|max, field?: <numeric>}" },
"size": { "type": "integer" }
},
"required": ["index","group_by","metric"]
}
}
},
{ "type": "function", "function": { "name": "search", "description": "Return example documents matching filters (+ optional full-text q).", "parameters": { "type": "object" } } },
{ "type": "function", "function": { "name": "creators", "description": "Rank creators with metrics and aggregate audience demographics.", "parameters": { "type": "object" } } },
{ "type": "function", "function": { "name": "co_mentions", "description": "Find the videos OR channels that mention ALL of N values together (e.g. two brands, or a brand + an ingredient). Use for 'which videos relate X and Y' / 'who talks about both X and Y'.", "parameters": { "type": "object" } } },
{ "type": "function", "function": { "name": "get_schema","description": "Return the queryable indices, fields, dimensions and metrics.", "parameters": { "type": "object" } } }
]2. System prompt
Tell the agent what the tools are and to ground answers in the data:
You are a market-intelligence assistant for yBot data (YouTube/TikTok/Instagram).
To answer, call the provided tools against the yBot Data API. If unsure which
field or dimension exists, call get_schema first. Prefer "aggregate" for ranking
/ "how many" / "who talks most" questions. Always base answers on returned data;
cite the counts. Never invent numbers.3. Wire each tool to an HTTP call
When the model calls a tool, forward it to the API with the key and return the JSON to the model. Example (Python, OpenAI-style):
import requests
BASE = "https://partners.yourbrandontime.com"
HEADERS = {"X-API-Key": "YOUR_API_KEY", "Content-Type": "application/json"}
def call_tool(name, args):
if name == "get_schema":
return requests.get(f"{BASE}/v1/schema", headers=HEADERS).json()
return requests.post(f"{BASE}/v1/{name}", headers=HEADERS, json=args).json()
# in your chat loop, when the model emits a tool_call:
# result = call_tool(tool_call.name, json.loads(tool_call.arguments))
# -> append result as the tool message, let the model answer in NL4. Worked example
User: “¿Qué creadora habla más de retinol y con qué sentimiento?”
Agent → tool call:
aggregate({
"index": "siv_business_ideas",
"filters": { "components": "retinol" },
"group_by": "channel_name",
"metric": { "type": "count" },
"size": 5
})API → returns a ranked buckets list (e.g. mad about skin 11,294; dr dray 5,944…). The agent may follow up with a second call grouping the same filter by sentiment, then answers in natural language citing the counts.
5. Worked example — relating two brands
User: “Find videos that relate Nike and IKEA.”
Agent → tool call (one video must mention both):
co_mentions({
"index": "siv_business_ideas",
"field": "brand_name",
"values": ["Nike", "IKEA"],
"group_by": "video_id",
"size": 10
})API → returns { results: [] } — no single video mentions both. That empty result is the answer, not a failure: the agent should say so rather than invent one. It can then widen to group_by: "channel_name" to find creators who cover both topics separately, or resolve any returned video_id to a title via search on siv_info. Contrast with ["Nike","Adidas"], which returns real co-occurring videos (sneaker/football comparisons).
Tip: co_mentions only ever returns IDs + counts (it is an aggregation), so it is available to every key — even aggregate keys — without exposing raw documents.
MCP / other agent frameworks
Any framework that supports HTTP tools / function calling works (OpenAI, Anthropic, LangChain, LlamaIndex, n8n, …). The four REST operations are the universal interface;/v1/schema lets the agent self-configure.
If you'd rather POST a plain-text question and get an answer without building your own agent, ask your yBot contact about the managed /v1/ask option (yBot runs the LLM that turns your question into queries).