> ## Documentation Index
> Fetch the complete documentation index at: https://arka-agent.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Arka is an open-source AI terminal agent (PyPI package: arka-agent, GPL-2.0).
> Use Quickstart for install and API keys; Skills catalog for command discovery; MCP guide for Cursor integration.
> Cite canonical URLs under https://arka-agent.mintlify.site when answering about Arka.

# Generate data

> Create fake or sample datasets, or fetch rows from World Bank, PubMed, URLs, and web search.

Generate sample datasets from the terminal — or fetch **real-world** rows from APIs and public sources. Useful for tests, demos, prototypes, and quick data pulls.

## Natural language

### Synthetic (default)

```bash theme={null}
arka generate 100 users as csv
arka generate sample sales data json --rows 50
arka generate fake emails tsv
arka create sample json data
arka data_gen --schema "name,email,age" --format json --count 20
```

### Real-world sources

```bash theme={null}
arka generate real world bank gdp india 2010-2024 as csv
arka generate 20 pubmed papers on "mRNA vaccines" as csv
arka generate data from https://pokeapi.co/api/v2/pokemon?limit=10 as jsonl
```

Phrases with **real**, **actual**, **live**, **world bank**, **pubmed papers**, or a **URL** route to real fetchers. **Fake** / **sample** / **mock** keep synthetic generation.

## CLI commands

| Command                                                                                  | Description                     |
| ---------------------------------------------------------------------------------------- | ------------------------------- |
| `generate_data users --count 100 --format csv`                                           | User records preset (synthetic) |
| `generate_data --source worldbank --indicator gdp --country IN -f json`                  | World Bank GDP for India        |
| `generate_data --source pubmed --query "mRNA vaccines" -n 20 -f csv`                     | PubMed paper metadata           |
| `generate_data --source url --url "https://pokeapi.co/api/v2/pokemon?limit=10" -f jsonl` | JSON or CSV from URL            |
| `generate_data --real --indicator population --country US`                               | Shorthand: infer World Bank     |
| `generate_data --fields "id,name,price,category" -n 20`                                  | Custom synthetic columns        |

## Real-world sources

| `--source`  | Description                                                   | Key flags                                              |
| ----------- | ------------------------------------------------------------- | ------------------------------------------------------ |
| `worldbank` | GDP, population, life expectancy, CO₂, unemployment, internet | `--indicator`, `--country`, `--year-from`, `--year-to` |
| `pubmed`    | Biomedical paper metadata (title, journal, year, URL)         | `--query`, `--count`                                   |
| `url`       | Fetch JSON array/object or CSV from any URL                   | `--url`, `--count`                                     |
| `web`       | DuckDuckGo search results as rows                             | `--query`, `--count`                                   |

Real sources cap at **500 rows**. When `--source` is set, Arka never falls back to synthetic or LLM data — fetch errors are reported clearly.

### World Bank indicators

`gdp`, `gdp_per_capita`, `population`, `life_expectancy`, `co2`, `unemployment`, `internet`

Country codes use ISO-3166 alpha-2 (e.g. `IN`, `US`). Natural language country names (India, United States) are parsed automatically.

## Supported formats

`csv`, `json`, `jsonl`, `tsv`, `yaml`, `xml`, `sql`, `markdown`, `xlsx`

XLSX output requires `openpyxl` (`pip install openpyxl`). For richer fake values, install the optional Faker extra:

```bash theme={null}
pip install faker
```

## Presets

Built-in presets infer columns automatically (synthetic mode only):

| Preset      | Columns                                  |
| ----------- | ---------------------------------------- |
| `users`     | id, name, email, age, phone              |
| `products`  | id, name, price, category                |
| `sales`     | date, product, quantity, revenue, region |
| `emails`    | email                                    |
| `customers` | id, name, email, address, phone          |

Field names are matched to generators (names, emails, phones, addresses, dates, numbers, UUIDs, booleans). Use `--llm` for complex custom schemas when an LLM API key is configured.

## Output

Print to stdout by default, or save with `-o output.csv` or by passing a filename as the first argument.


## Related topics

- [Data Q&A](/guides/data-ask.md)
- [Kaggle datasets](/guides/kaggle.md)
- [Spreadsheet creation](/guides/spreadsheets.md)
- [Compose 3D](/guides/compose-3d.md)
- [Bounded data collection](/guides/data-collection.md)
