AI Search Data API Quickstart

Get an API key, submit a Gemini prompt and collect the answer with polling or webhooks. Start your querying.ai integration step by step.

1. Prepare your API key

Create a free account and generate a key in the dashboard. Store it in the server environment variable QUERYING_API_KEY; do not put it in browser code or a public repository. New accounts start with 2,000 credits and no card.

2. Submit a prompt

The command submits a Gemini prompt with a US market setting. The country code does not translate the question: write the prompt in the language you want. Use task.id from the accepted response in the next step.

curl -X POST https://api.querying.ai/v1/async/task \
  -H "Authorization: Bearer $QUERYING_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "taskType": "GEMINI",
  "payload": {
    "prompt": "best wireless earbuds for commuting",
    "country": "US"
  }
}'

3. Collect the completed result

Replace TASK_ID with the accepted ID. If QUEUED or RUNNING, check again after a delay; when COMPLETED, read response. Handle FAILED explicitly instead of treating it as an empty successful answer. Public polling must occur within 24 hours of completion.

curl https://api.querying.ai/v1/async/task/TASK_ID \
  -H "Authorization: Bearer $QUERYING_API_KEY"

4. Receive results with a webhook

Add webhook.url to the submission JSON to receive terminal results on your server. Prepare an HTTPS receiver and implement the documented signature verification and retry contract. Deduplicate redeliveries by task.id.

{
  "taskType": "GEMINI",
  "payload": {
    "prompt": "best wireless earbuds for commuting",
    "country": "US"
  },
  "webhook": {
    "url": "https://your-server.example.com/querying-webhook"
  }
}

5. Add engines and scheduled measurement

Check each engine’s taskType, prompt/query input and response schema before expanding. Handle insufficient credits or concurrency limits rather than retrying indefinitely. To track brand visibility over time, save a consistent prompt set in Monitors.

Full API documentation

Explore related capabilities