{"openapi":"3.1.0","info":{"title":"MacroLens","version":"1.0.0","contact":{"name":"MacroLens","url":"https://github.com/Imac2014Ville/baselens"},"description":"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.","x-guidance":"Pay-per-call USDC on Base via x402. POST /company {country: NO|FR, query or id} ($0.02): official registry data for a company (status, legal form, address, industry, employees; France adds officers and revenue). POST /country-profile {country} ($0.01): latest GDP, growth, inflation, unemployment, population, debt, current account, trade, FDI, life expectancy in one call. POST /compare {countries (<=10 or G7), indicator} ($0.01): ranked latest values. POST /indicator {country, indicator, years} ($0.005): time series; indicators: gdp, gdp_per_capita, gdp_growth, inflation, unemployment, population, debt_to_gdp, current_account, interest_rate, exports, imports, fdi, gini, life_expectancy or a World Bank code. GET with query params also works. Malformed input returns 400 and unknown countries or failed lookups return non-2xx, so you are not charged."},"servers":[{"url":"https://macrolens.imac2014ville.workers.dev"}],"paths":{"/company":{"get":{"operationId":"companyGet","summary":"Official company registry lookup (Norway, France)","description":"Use when an agent needs to verify a company or pull official registry data: KYB check, counterparty due diligence, legal status, address, industry and employees from the government register. Norway (NO, Enhetsregisteret) and France (FR, SIRENE/RNE, also officers and revenue). Look up by name (query) or registry number (id).","tags":["company-registry","kyb","due-diligence","norway","france"],"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.02"},"protocols":[{"x402":{}}]},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"},"example":{"ok":true,"count":1,"companies":[{"country":"NO","registry":"Brønnøysund Register Centre, Enhetsregisteret","id":"923609016","name":"EQUINOR ASA","legalForm":{"code":"ASA"},"status":"active","industry":{"code":"06.100","description":"Utvinning av råolje"},"employees":21272,"address":"Forusbeen 50, 4035, STAVANGER, Norge"}],"source":"Brønnøysund Register Centre (NLOD)"}}}},"402":{"description":"Payment Required"}},"parameters":[{"name":"country","in":"query","required":true,"schema":{"type":"string","enum":["NO","FR"],"description":"Registry country: NO (Norway) or FR (France)"},"description":"Registry country: NO (Norway) or FR (France)"},{"name":"query","in":"query","required":false,"schema":{"type":"string","description":"Company name to search (2-100 chars); returns up to limit matches"},"description":"Company name to search (2-100 chars); returns up to limit matches"},{"name":"id","in":"query","required":false,"schema":{"type":"string","description":"Registry number instead of query: NO organisasjonsnummer (9 digits), FR SIREN (9) or SIRET (14)"},"description":"Registry number instead of query: NO organisasjonsnummer (9 digits), FR SIREN (9) or SIRET (14)"},{"name":"limit","in":"query","required":false,"schema":{"type":"number","description":"Max matches for a name search, 1-10 (default 5)"},"description":"Max matches for a name search, 1-10 (default 5)"}]},"post":{"operationId":"companyPost","summary":"Official company registry lookup (Norway, France)","description":"Use when an agent needs to verify a company or pull official registry data: KYB check, counterparty due diligence, legal status, address, industry and employees from the government register. Norway (NO, Enhetsregisteret) and France (FR, SIRENE/RNE, also officers and revenue). Look up by name (query) or registry number (id).","tags":["company-registry","kyb","due-diligence","norway","france"],"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.02"},"protocols":[{"x402":{}}]},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"},"example":{"ok":true,"count":1,"companies":[{"country":"NO","registry":"Brønnøysund Register Centre, Enhetsregisteret","id":"923609016","name":"EQUINOR ASA","legalForm":{"code":"ASA"},"status":"active","industry":{"code":"06.100","description":"Utvinning av råolje"},"employees":21272,"address":"Forusbeen 50, 4035, STAVANGER, Norge"}],"source":"Brønnøysund Register Centre (NLOD)"}}}},"402":{"description":"Payment Required"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"country":{"type":"string","enum":["NO","FR"],"description":"Registry country: NO (Norway) or FR (France)"},"query":{"type":"string","description":"Company name to search (2-100 chars); returns up to limit matches"},"id":{"type":"string","description":"Registry number instead of query: NO organisasjonsnummer (9 digits), FR SIREN (9) or SIRET (14)"},"limit":{"type":"number","description":"Max matches for a name search, 1-10 (default 5)"}},"required":["country"]}}}}}},"/country-profile":{"get":{"operationId":"countryProfileGet","summary":"One-call economic snapshot of a country","description":"Use when an agent needs a quick economic snapshot of a country in one call: latest GDP, GDP per capita, GDP growth, inflation, unemployment, population, government debt, current account, exports, imports, FDI, life expectancy and lending rate, with the year of each value. World Bank data for 200+ countries.","tags":["macro","economy","country-data","gdp","world-bank"],"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.01"},"protocols":[{"x402":{}}]},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"},"example":{"ok":true,"country":{"iso2":"JP","iso3":"JPN","name":"Japan","region":"East Asia & Pacific","incomeLevel":"High income"},"indicators":{"gdp":{"value":4026211000000,"year":2024,"units":"USD"},"inflation":{"value":2.7,"year":2024,"units":"%"},"unemployment":{"value":2.5,"year":2024,"units":"%"}},"source":"World Bank Open Data (CC BY 4.0)"}}}},"402":{"description":"Payment Required"}},"parameters":[{"name":"country","in":"query","required":true,"schema":{"type":"string","description":"ISO2 or ISO3 country code, e.g. US, DE, JPN (aggregates WLD, EUU also work)"},"description":"ISO2 or ISO3 country code, e.g. US, DE, JPN (aggregates WLD, EUU also work)"}]},"post":{"operationId":"countryProfilePost","summary":"One-call economic snapshot of a country","description":"Use when an agent needs a quick economic snapshot of a country in one call: latest GDP, GDP per capita, GDP growth, inflation, unemployment, population, government debt, current account, exports, imports, FDI, life expectancy and lending rate, with the year of each value. World Bank data for 200+ countries.","tags":["macro","economy","country-data","gdp","world-bank"],"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.01"},"protocols":[{"x402":{}}]},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"},"example":{"ok":true,"country":{"iso2":"JP","iso3":"JPN","name":"Japan","region":"East Asia & Pacific","incomeLevel":"High income"},"indicators":{"gdp":{"value":4026211000000,"year":2024,"units":"USD"},"inflation":{"value":2.7,"year":2024,"units":"%"},"unemployment":{"value":2.5,"year":2024,"units":"%"}},"source":"World Bank Open Data (CC BY 4.0)"}}}},"402":{"description":"Payment Required"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"country":{"type":"string","description":"ISO2 or ISO3 country code, e.g. US, DE, JPN (aggregates WLD, EUU also work)"}},"required":["country"]}}}}}},"/compare":{"get":{"operationId":"compareGet","summary":"Rank countries on a macro indicator","description":"Use when an agent needs to rank or benchmark countries on one macro indicator: pass up to 10 countries (or G7, BRICS, NORDICS) and an indicator such as unemployment, inflation, gdp_per_capita or debt_to_gdp; returns the latest value of each, ranked, with the year.","tags":["macro","ranking","country-comparison","world-bank","economy"],"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.01"},"protocols":[{"x402":{}}]},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"},"example":{"ok":true,"indicator":{"key":"unemployment","units":"%"},"ranking":[{"rank":1,"country":"Italy","iso2":"IT","year":2024,"value":6.5},{"rank":2,"country":"France","iso2":"FR","year":2024,"value":7.4}],"source":"World Bank Open Data (CC BY 4.0)"}}}},"402":{"description":"Payment Required"}},"parameters":[{"name":"countries","in":"query","required":true,"schema":{"type":"string","description":"Comma-separated ISO2/ISO3 codes (max 10) or a group: G7, BRICS, NORDICS, EUROPE_BIG4"},"description":"Comma-separated ISO2/ISO3 codes (max 10) or a group: G7, BRICS, NORDICS, EUROPE_BIG4"},{"name":"indicator","in":"query","required":true,"schema":{"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"},"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"},{"name":"order","in":"query","required":false,"schema":{"type":"string","enum":["desc","asc"],"description":"Ranking order (default desc, highest first)"},"description":"Ranking order (default desc, highest first)"}]},"post":{"operationId":"comparePost","summary":"Rank countries on a macro indicator","description":"Use when an agent needs to rank or benchmark countries on one macro indicator: pass up to 10 countries (or G7, BRICS, NORDICS) and an indicator such as unemployment, inflation, gdp_per_capita or debt_to_gdp; returns the latest value of each, ranked, with the year.","tags":["macro","ranking","country-comparison","world-bank","economy"],"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.01"},"protocols":[{"x402":{}}]},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"},"example":{"ok":true,"indicator":{"key":"unemployment","units":"%"},"ranking":[{"rank":1,"country":"Italy","iso2":"IT","year":2024,"value":6.5},{"rank":2,"country":"France","iso2":"FR","year":2024,"value":7.4}],"source":"World Bank Open Data (CC BY 4.0)"}}}},"402":{"description":"Payment Required"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"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"},"order":{"type":"string","enum":["desc","asc"],"description":"Ranking order (default desc, highest first)"}},"required":["countries","indicator"]}}}}}},"/indicator":{"get":{"operationId":"indicatorGet","summary":"Macro indicator time series for a country","description":"Use when an agent needs a macroeconomic time series for one country: GDP, GDP per capita, GDP growth, inflation, unemployment, population, debt to GDP, current account, exports, imports, FDI, Gini, life expectancy and 20+ more (or any World Bank code), default last 10 years, with units and source.","tags":["macro","gdp","inflation","unemployment","world-bank"],"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.005"},"protocols":[{"x402":{}}]},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"},"example":{"ok":true,"country":{"iso2":"US","iso3":"USA","name":"United States"},"indicator":{"key":"gdp","code":"NY.GDP.MKTP.CD","name":"GDP (current US$)","units":"USD"},"latest":{"year":2025,"value":30769700000000},"series":[{"year":2025,"value":30769700000000},{"year":2024,"value":29298013000000}],"source":"World Bank Open Data (CC BY 4.0)"}}}},"402":{"description":"Payment Required"}},"parameters":[{"name":"country","in":"query","required":true,"schema":{"type":"string","description":"ISO2 or ISO3 country code, e.g. US, DE, JPN (aggregates WLD, EUU also work)"},"description":"ISO2 or ISO3 country code, e.g. US, DE, JPN (aggregates WLD, EUU also work)"},{"name":"indicator","in":"query","required":true,"schema":{"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"},"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"},{"name":"years","in":"query","required":false,"schema":{"type":"number","description":"Number of most recent years, 1-60 (default 10)"},"description":"Number of most recent years, 1-60 (default 10)"}]},"post":{"operationId":"indicatorPost","summary":"Macro indicator time series for a country","description":"Use when an agent needs a macroeconomic time series for one country: GDP, GDP per capita, GDP growth, inflation, unemployment, population, debt to GDP, current account, exports, imports, FDI, Gini, life expectancy and 20+ more (or any World Bank code), default last 10 years, with units and source.","tags":["macro","gdp","inflation","unemployment","world-bank"],"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.005"},"protocols":[{"x402":{}}]},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"},"example":{"ok":true,"country":{"iso2":"US","iso3":"USA","name":"United States"},"indicator":{"key":"gdp","code":"NY.GDP.MKTP.CD","name":"GDP (current US$)","units":"USD"},"latest":{"year":2025,"value":30769700000000},"series":[{"year":2025,"value":30769700000000},{"year":2024,"value":29298013000000}],"source":"World Bank Open Data (CC BY 4.0)"}}}},"402":{"description":"Payment Required"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"country":{"type":"string","description":"ISO2 or ISO3 country code, e.g. US, DE, JPN (aggregates WLD, EUU also work)"},"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"},"years":{"type":"number","description":"Number of most recent years, 1-60 (default 10)"}},"required":["country","indicator"]}}}}}}},"x-discovery":{"ownershipProofs":["0xd2fb970fde8228c3a194e39eebc9beffb6f58b793f6464d0c26cfbc3343da25c30863f64b6fc345fd81fa95f885552c9c4b93cf46509edfba7840d378ca999c41c"]}}