---
title: "Fetch data from a plain-language request"
method: GET
path: "/fetch"
tags: ["agent"]
---

# Fetch data from a plain-language request

`GET /fetch`

## Request

- Base URL: `https://sampuli.site/api/v1`
- URL: `https://sampuli.site/api/v1/fetch`
- Auth: none declared

Resolve a natural request ("a SWIFT code for China", "Kenya phone number") to a spec and generate it in one call. Sampuli maps the country (China→cn) and field ("SWIFT code"→swift) for you. The JSON response echoes the resolved `spec` so the caller can see the interpretation.

## Query parameters

- `q` string, required
- `n` integer
- `fields` string
- `seed` string
- `format` 'json' | 'csv' | 'ndjson' | 'xml'
- `pretty` '1'

## Response `200`

The resolved spec and generated data.

- object
  - `query` string
  - `spec` string
  - `country` string
  - `field` string, nullable
  - `data` unknown

## Other responses

- `400`: Error
- `422`: Error

---

[API](https://skmtc.dev/sampuli/apis/sampuli-api.md) · [All operations](https://skmtc.dev/sampuli/apis/sampuli-api/llms.txt) · [OpenAPI document](https://skmtc.dev/sampuli/apis/sampuli-api/revisions/55c96e65fa3c?raw)
