ai_sample
Samples the same prompt multiple times to measure how often each business appears in AI answers, providing a visibility rate rather than a one-off result.
Instructions
Use when measuring HOW OFTEN an AI answer names a business, not just whether it did once. Read-only: it asks the same question samples times and reports how often each business appears; nothing is changed or posted anywhere. The runs take one to three minutes, longer than a tool call can wait, so this returns a job_id right away -- call ai_sample_status with it to get the result.
COLLECTING: ai_sample_status is free and the result does not expire. Typical answers are ready in 30-60 seconds and the slowest in about 130 -- wait 30 seconds before the first check and roughly 15 between checks. status is "pending" or "running" until then.
WHY SAMPLE: a model composes its answer per request, so one answer is a sample, not a fact -- ask twice ten minutes apart and the businesses and their order can differ. A client asking "am I showing up in AI answers?" is asking for a rate, which a single ai_scraper or ai_mode call cannot give.
REPEATS: an identical request within 10 minutes returns the run already in progress (deduplicated: true, 0 credits), so retrying after a dropped connection is safe. To measure the same prompt again on purpose, pass force_new: true. Pass idempotency_key to group requests yourself.
PLATFORMS: chat_gpt and gemini cost 4 credits per sample; google_ai_mode costs 2 credits per sample and requires a location. The mention and visibility tools read stored aggregates, so they are not sampleable -- running one ten times returns the same numbers ten times.
COST: samples x the per-run price; 10 samples on chat_gpt is 40 credits. Samples that never complete are refunded, and the final figure is credits_charged on the status response.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| keyword | Yes | The prompt or keyword to ask repeatedly (e.g. "best plumber in Orchard Park NY") | |
| samples | Yes | How many times to run the prompt, 2-25. Below about 5 the rate is too coarse to act on; 10 is the usual daily figure. | |
| language | No | Language to ask in, as ISO 639-1 code or name (e.g. "fr", "French"). Defaults to the language of the market you pass. | |
| location | No | Location (e.g. "Orchard Park, NY"). Required on google_ai_mode. Gemini supports city-level; ChatGPT resolves to country. | |
| platform | Yes | Which generator to sample. google_ai_mode is Google AI Mode and requires a location. | |
| force_new | No | Run the prompt again even though an identical submit is within the 10-minute replay window. This is how you take a SECOND measurement of the same prompt on purpose; without it the repeat is treated as a retry and returns the first job. | |
| idempotency_key | No | Your own key for this submit. Two submits carrying the same key return the same job for 24 hours, whatever their parameters. Use it when you are driving runs from a schedule and want the grouping to be yours rather than ours. | |
| force_web_search | No | Require the platform to search the web before answering. chat_gpt only. Use it when a local prompt comes back as a clarifying question rather than an answer. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| job_id | Yes | ||
| status | Yes | ||
| poll_url | Yes | ||
| deduplicated | No | ||
| estimated_seconds | Yes | ||
| samples_requested | Yes |