# MacroLens Compare Indicator

> MacroLens Compare Indicator is a paid API for AI agents from macrolens.imac2014ville.workers.dev, paid per call via x402, $0.01/call, status unknown (last checked 2026-10-10).

Compares and ranks a set of countries by a chosen macroeconomic indicator (GDP, inflation, unemployment, debt-to-GDP, and 30+ others) sourced from World Bank data

## Facts

- Endpoint: GET https://macrolens.imac2014ville.workers.dev/compare?utm_source=zero.xyz
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-10
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/macrolens-compare-indicator-2d6ac696
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_X1yBRfwLMaCXyj1aeiZfm

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 macrolens-compare-indicator-2d6ac696
```

Example prompt: Compare unemployment rates across the G7 countries and rank them from highest to lowest using World Bank data.

## When to prefer this

Choose this endpoint when you need to compare or rank multiple countries side-by-side on a specific macroeconomic indicator. It is ideal for benchmarking scenarios (e.g. G7 vs BRICS comparisons), policy research, or investment analysis where ranked cross-country data is needed. Prefer it over single-country lookups when the goal is relative comparison rather than a full country profile.

## Known failure modes

- Invalid or unsupported indicator key returns an error or empty result
- More than 10 country codes supplied exceeds the max limit
- Invalid ISO country codes not recognized
- Payment failure or insufficient USDC balance blocks the request
- World Bank data may be lagged by 1-2 years for some indicators
- Some indicators may not be available for all countries

## How this service works

Global macro statistics (GDP, inflation, unemployment, debt and 30+ indicators for 200+ countries), country profiles and rankings, and official company registry lookups (Norway, France) for AI agents. No API key: pay USDC on Base per call via x402.

## Output

Returns a JSON object with a ranked list of countries for the requested indicator, including each country's ISO2 code, rank, most recent year of data, numeric value, and the indicator's key name and units. Also includes the original data source attribution (World Bank Open Data CC BY 4.0).

## 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"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "countries",
      "indicator"
     ],
     "properties": {
      "order": {
       "enum": [
        "desc",
        "asc"
       ],
       "type": "string",
       "description": "Ranking order (default desc, highest first)"
      },
      "countries": {
       "type": "string",
       "description": "Comma-separated ISO2/ISO3 codes (max 10) or a group: G7, BRICS, NORDICS, EUROPE_BIG4"
      },
      "indicator": {
       "type": "string",
       "description": "Friendly key (gdp, gdp_per_capita, gdp_growth, inflation, unemployment, population, debt_to_gdp, current_account, interest_rate, exports, imports, fdi, gini, life_expectancy, ...) or a raw World Bank code like NY.GDP.MKTP.CD"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "ok": true,
  "source": "World Bank Open Data (CC BY 4.0)",
  "ranking": [
   {
    "iso2": "IT",
    "rank": 1,
    "year": 2024,
    "value": 6.5,
    "country": "Italy"
   },
   {
    "iso2": "FR",
    "rank": 2,
    "year": 2024,
    "value": 7.4,
    "country": "France"
   }
  ],
  "indicator": {
   "key": "unemployment",
   "units": "%"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/macrolens-compare-indicator-2d6ac696/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from macrolens.imac2014ville.workers.dev](https://www.zero.xyz/host/macrolens.imac2014ville.workers.dev/llms.txt)
