---
title: "Agent Query"
method: POST
path: "/api/v1/agent/query"
tags: ["Agent"]
---

# Agent Query

`POST /api/v1/agent/query`

## Request

- Base URL: `https://api.africadb.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.africadb.com/api/v1/agent/query`
- Auth: none declared

## Request body

- AgentQueryRequest
  - `question` string, required: Plain-English question about African data. Examples: "What's the GDP of Kenya?" or "Compare inflation in Nigeria and South Africa" or "Which African country has the highest life expectancy?"
  - `max_countries` integer

## Response `200`

Successful Response

- AgentQueryResponse
  - `ok` boolean
  - `question` string, required
  - `answer` string, required
  - `indicator` ResolvedIndicator
    - `id` string, required
    - `name` string, required
    - `unit` string
    - `source_label` string
    - `freshness_status` string, nullable
  - `countries` ResolvedCountry[]
    - `code` string, required
    - `name` string, required
  - `rows` AnswerRow[]
    - `country_code` string, required
    - `country_name` string, required
    - `value` number, nullable, required
    - `year` integer, nullable, required
    - `unit` string
    - `source_id` string
    - `run_id` string
    - `verify_url` string
  - `citations` object
  - `grounded` boolean
  - `generated_at` string, date-time
  - `diagnostics` object

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/africadb/apis/africa-data-bank-api.md) · [All operations](https://skmtc.dev/africadb/apis/africa-data-bank-api/llms.txt) · [OpenAPI document](https://skmtc.dev/africadb/apis/africa-data-bank-api/revisions/2a50da82945b?raw)
