# Worlddata — Wrapped API

> **You are on:** `https://api.beta.paywithlocus.com/api` | [llms.txt](https://beta.paywithlocus.com/llms.txt) | [docs](https://docs.paywithlocus.com)
>
> Locus runs on multiple environments -- make sure every URL you call matches your expected environment.
> | Environment | Landing | API | Docs |
> |---|---|---|---|
> | Production | paywithlocus.com | api.paywithlocus.com | docs.paywithlocus.com |
> | Beta | beta.paywithlocus.com | api.beta.paywithlocus.com | docs.paywithlocus.com |
> | Stage | stage.paywithlocus.com | api.stage.paywithlocus.com | docs.paywithlocus.com |
>
> If the API URL above doesn't match your expected environment, re-fetch this file from the correct domain.

> Explore global statistics and compare countries across population, economy, demographics, quality of life, education, and health metrics. Search worldwide data on everything from life expectancy and languages to religions and regional breakdowns to gain comprehensive insights into how nations rank against each other.

**Category:** Government & Public Data | **Website:** [worlddata.info/](https://worlddata.info/) | **Docs:** [parse.bot/marketplace/199791d0-dc7f-490a-b324-671849562c15/worlddata-info-api](https://parse.bot/marketplace/199791d0-dc7f-490a-b324-671849562c15/worlddata-info-api)

Pay-per-use API proxy for Locus Pro. Each call burns credits from your workspace balance.

## Access

**Base URL:** `https://api.beta.paywithlocus.com/api/wrapped/credits/worlddata/`
**Auth:** `Authorization: Bearer <LOCUS_CREDITS_SECRET_KEY>` (an `lcr_` secret key or a scoped `lcac_` agent credential)
**Required header:** `Idempotency-Key: <fresh UUID per call>`. A retry with the same key replays the stored result without a new charge.
**Response:** the provider response after any endpoint-specific normalization. `X-Locus-Credits-Charged` carries the charge and `X-Locus-Credits-Balance` the remaining balance. Insufficient credits return `402` before the provider is called.
**Pricing:** estimated costs below are USD. Locus debits the credit equivalent at your workspace rate.

Full call contract: https://docs.paywithlocus.com/api-reference/introduction

> Using a Pay With Locus wallet key (`claw_` prefix)? Wallet routes are documented separately: https://docs.paywithlocus.com/wrapped-apis/for-agents

## Endpoints

### Compare countries

Side-by-side comparison of two countries across population, economy, infrastructure, healthcare, education, climate, and more. Sections vary by country pair.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `country1` | string | Yes | ISO 3166-1 alpha-3 code for the first country (e.g. 'USA', 'DEU', 'FRA', 'JPN'). |
| `country2` | string | Yes | ISO 3166-1 alpha-3 code for the second country (e.g. 'DEU', 'GBR', 'CHN', 'IND'). |

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/worlddata/compare-countries \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"country1":"<string>","country2":"<string>"}'
```

### Get average body height

Countries ranked by average body height, including weight and BMI.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/worlddata/get-average-body-height \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### Get countries by region

Countries and statistics grouped by sub-region for a continent, including most spoken languages and country listings.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `region` | string | Yes | Continent/region name: 'europe', 'asia', 'africa', 'america', 'oceania'. |

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/worlddata/get-countries-by-region \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"region":"<string>"}'
```

### Get country codes

International country codes for all countries: ISO 3166-1 alpha-2, alpha-3, numeric, IOC, FIPS 10, license plate, and internet domain codes.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/worlddata/get-country-codes \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### Get country economy

Economic statistics for a country including top companies, imports/exports, and budget data, organized by section.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `country_path` | string | Yes | Country path as 'continent/country' (e.g. 'europe/germany', 'america/usa', 'asia/japan'). |

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/worlddata/get-country-economy \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"country_path":"<string>"}'
```

### Get country overview

Detailed overview of a single country covering languages, religions, economy, transport, land use, and political indicators. Data is organized into named sections.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `country_path` | string | Yes | Country path as 'continent/country' (e.g. 'europe/germany', 'asia/japan', 'america/usa', 'africa/nigeria'). |

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/worlddata/get-country-overview \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"country_path":"<string>"}'
```

### Get country population history

Year-by-year historical population growth for a country, including birth/death rates compared to world averages. May include sub-national regional data.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `country_path` | string | Yes | Country path as 'continent/country' (e.g. 'europe/germany', 'asia/japan', 'america/usa'). |

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/worlddata/get-country-population-history \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"country_path":"<string>"}'
```

### Get education by country

Countries ranked by educational attainment from elementary through doctoral levels, with an overall ranking score.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/worlddata/get-education-by-country \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### Get iq by country

Countries ranked by average IQ score, with average income, education expenditure per inhabitant, and average daily maximum temperature.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/worlddata/get-iq-by-country \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### Get languages worldwide

Global ranking of languages by number of native speakers, including how many countries each is spoken in and used as an official language.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/worlddata/get-languages-worldwide \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### Get largest countries

Countries ranked by total population, including area and population density per km².

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/worlddata/get-largest-countries \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### Get life expectancy worldwide

Countries ranked by life expectancy, including male and female life expectancy, birth rate, and death rate.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/worlddata/get-life-expectancy-worldwide \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### Get population density worldwide

Countries ranked by population density (inhabitants per km²). Each record includes country name, area, population, and density.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/worlddata/get-population-density-worldwide \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### Get population growth worldwide

Ranked list of countries by average annual population growth rate for a given period. Each record includes country name, average yearly growth percentage, and total growth over the period. Defaults to 2015-2024 when no period is specified.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `period` | string | No | Time period in 'YYYY-YYYY' format. |

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/worlddata/get-population-growth-worldwide \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"period":"<string>"}'
```

### Get quality of life

Countries ranked by composite quality of life index with sub-scores for stability, rights, health, safety, climate, costs, and popularity.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/worlddata/get-quality-of-life \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### Get refugees data

Refugee statistics: top countries of origin and top destination countries with asylum application counts per year.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/worlddata/get-refugees-data \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### Get religions worldwide

Global distribution of religions ranked by worldwide percentage of followers, including regional distribution details.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/worlddata/get-religions-worldwide \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### Search site

Full-text search across all worlddata.info content. Returns matching page titles, URLs, and description snippets.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `query` | string | Yes | Search keyword or phrase (e.g. 'population', 'climate France', 'GDP'). |

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/worlddata/search-site \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"query":"<string>"}'
```

## Next steps

- [All wrapped API providers](https://beta.paywithlocus.com/wapi/index.md): pick another provider.
- [Find and call tools](https://beta.paywithlocus.com/agent/tools.md): price ceilings, async results, and errors.
- [Credits and billing](https://beta.paywithlocus.com/agent/billing.md): what a call costs and how to add credits.
- [Agent docs index](https://beta.paywithlocus.com/agent/index.md): every Locus agent page.