# lilambd Markets Countries API

> lilambd Markets Countries API is a paid API for AI agents from api.lilambd.com, paid per call via x402, $0.005/call, status unknown (last checked 2026-11-02).

Returns a paginated list of countries with market data, filterable by kind, population, and sort order

## Facts

- Endpoint: GET https://api.lilambd.com/markets/countries?utm_source=zero.xyz
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-02
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/lilambd-markets-countries-api-9838053e
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_ufJdHU7wauvOnJcVgOwID

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability lilambd-markets-countries-api-9838053e
```

Example prompt: Can you pull the top 20 countries sorted by market presence per million population, only including countries with at least 1 million people?

## When to prefer this

Use this endpoint when you need structured, paginated country-level market data with flexible filtering by population and per-capita metrics. Prefer this over a general geopolitical data API when you specifically need market-oriented country data with attribution included, and when per-million normalization is important for cross-country comparisons.

## Known failure modes

- Invalid ISO 3166-1 alpha-2 country code returns empty data array
- Limit out of range (outside 1-200) may return an error or be clamped
- Invalid sort value (not 'population' or 'per_million') may return an error
- Invalid kind value returns empty or error response
- Payment not included or insufficient USDC triggers 402 response

## How this service works

A crossing for play, feeling, language, science and computation — creating states that do not have names yet.

## Output

A JSON object with a 'data' array of country market records, a 'count' integer indicating total matching rows, and an 'attribution' string crediting the data source. Each record includes country identifiers and market metrics appropriate to the requested kind and sort.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method",
    "queryParams"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [],
     "properties": {
      "kind": {
       "type": "string",
       "description": "Market kind"
      },
      "sort": {
       "type": "string",
       "description": "population | per_million (lowest first)"
      },
      "limit": {
       "type": "string",
       "description": "Max rows (1-200, default 50)"
      },
      "offset": {
       "type": "string",
       "description": "Rows to skip"
      },
      "country": {
       "type": "string",
       "description": "ISO 3166-1 alpha-2 (empty = all)"
      },
      "min_population": {
       "type": "string",
       "description": "Only countries above this population"
      }
     },
     "additionalProperties": {
      "type": "string"
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "json"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "data": [],
  "count": 0,
  "attribution": "source licence line"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/lilambd-markets-countries-api-9838053e/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.lilambd.com](https://www.zero.xyz/host/api.lilambd.com/llms.txt)
