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.

Read the docs ↗
You submit a task
curl -X POST https://api.querying.ai/v1/async/task \
  -H "Authorization: Bearer vt_live_…" \
  -H "Content-Type: application/json" \
  -d '{
    "taskType": "GEMINI",
    "payload": { "prompt": "best wireless earbuds 2026" },
    "webhook": { "url": "https://yours.app/hooks/querying" }
  }'
Your webhook receives
{
  "task": {
    "id": "8f2c1e40-…",
    "taskType": "GEMINI",
    "status": "COMPLETED",
    "createdAt": "2026-07-17T04:12:00.000Z"
  },
  "credits": { "creditsToCharge": 1.25, "creditsCharged": 1.25 },
  "response": {
    "text": "The best wireless earbuds in 2026 are …",
    "sources": [
      { "position": 1,
        "url": "https://example.com/review",
        "label": "Best earbuds, reviewed" }
    ],
    "timing": { "totalMs": 7400 }
  }
}

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 and use it only from your server. New accounts start with 500 credits before adding a payment method.

2. Submit a prompt

The command submits a Gemini prompt with a US market setting. Write the prompt in the language you want; it is sent as written. Use task.id from the accepted response in the next step.

cURL
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 PROCESSING, check again after a delay; when COMPLETED, read response. When FAILED, read the error details. Public polling must occur within 24 hours of completion.

cURL
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 with the documented signature verification. Delivery makes up to 5 attempts: the initial request and 4 retries with backoff. Deduplicate redeliveries by task.id.

JSON
{
  "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. When a request hits insufficient credits or concurrency limits, resolve the cause and then retry. To track brand visibility over time, save a consistent prompt set in Monitors.

Explore related capabilities

Start with 500 free credits

Run your first task in the Playground, or call the API with your key.